|
@@ -4,6 +4,7 @@ import com.yunfeiyun.agmp.iots.warn.service.ReCountService;
|
|
|
import com.yunfeiyun.agmp.iots.warn.service.WarnService;
|
|
import com.yunfeiyun.agmp.iots.warn.service.WarnService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
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.Value;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
@@ -18,6 +19,9 @@ public class WarnJob {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private WarnService warnService;
|
|
private WarnService warnService;
|
|
|
|
|
|
|
|
|
|
+ @Value("${warn.cbdDateDiff:1}")
|
|
|
|
|
+ private String cbdDateDiff;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 每天凌晨12点清除重复次数...
|
|
* 每天凌晨12点清除重复次数...
|
|
|
*/
|
|
*/
|
|
@@ -41,12 +45,13 @@ public class WarnJob {
|
|
|
*/
|
|
*/
|
|
|
@Scheduled(cron = "0 0/20 * * * ?")
|
|
@Scheduled(cron = "0 0/20 * * * ?")
|
|
|
public void pestWarnJob20() {
|
|
public void pestWarnJob20() {
|
|
|
- log.info("【设备预警】测报类检测,0 0/20 * * * ? 临时配置 每20分钟执行一次");
|
|
|
|
|
- // 处理虫害
|
|
|
|
|
- warnService.processWarningPestData();
|
|
|
|
|
- // 处理病害
|
|
|
|
|
- warnService.processWarningDiseaseData();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if("0".equals(cbdDateDiff)){
|
|
|
|
|
+ log.info("【设备预警】测报类检测,0 0/20 * * * ? 临时配置 每20分钟执行一次");
|
|
|
|
|
+ // 处理虫害
|
|
|
|
|
+ warnService.processWarningPestData();
|
|
|
|
|
+ // 处理病害
|
|
|
|
|
+ warnService.processWarningDiseaseData();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|