定时任务-修改文本状态
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package com.adc.da.scheduled;
|
||||
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@EnableScheduling
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ImplementScheduledJob {
|
||||
|
||||
@Autowired
|
||||
private SarStandardsInfoDao sarStandardsInfoDao;
|
||||
|
||||
|
||||
@Scheduled(cron = "0 0 0 * * ?") //每天的凌晨0点执行
|
||||
// @Scheduled(cron="*/5 * * * * ?")
|
||||
@Async
|
||||
public void schedulingTasks() {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+5
-5
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
@EnableScheduling
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ScheduledJob {
|
||||
public class WarningScheduledJob {
|
||||
|
||||
/**
|
||||
* 根据配置文件设置是否开启定时器
|
||||
@@ -84,7 +84,7 @@ public class ScheduledJob {
|
||||
|
||||
LinkedList<WarningEO> warningList = new LinkedList<>();//需预警的标准和条款列表集合
|
||||
//分解单(条款) 新车型 mark=1
|
||||
List<WarningEO> itemForXCXSSRQ = sarStandardItemDao.select(term, "XCXSSRQ");
|
||||
List<WarningEO> itemForXCXSSRQ = sarStandardItemDao.selectWithinTerm(term, "XCXSSRQ");
|
||||
for (WarningEO warningEO : itemForXCXSSRQ) {
|
||||
warningEO.setId(UUIDUtils.randomUUID20())
|
||||
.setPower("1")
|
||||
@@ -94,7 +94,7 @@ public class ScheduledJob {
|
||||
warningList.addAll(itemForXCXSSRQ);
|
||||
|
||||
//分解单(条款) 在产车型 mark=2
|
||||
List<WarningEO> itemForZCCSSRQ = sarStandardItemDao.select(term, "ZCCSSRQ");
|
||||
List<WarningEO> itemForZCCSSRQ = sarStandardItemDao.selectWithinTerm(term, "ZCCSSRQ");
|
||||
for (WarningEO warningEO : itemForZCCSSRQ) {
|
||||
warningEO.setId(UUIDUtils.randomUUID20())
|
||||
.setPower("1")
|
||||
@@ -104,7 +104,7 @@ public class ScheduledJob {
|
||||
warningList.addAll(itemForZCCSSRQ);
|
||||
|
||||
//标准 新车型 预警 mark=3
|
||||
List<WarningEO> standInfoXCXSSRQ = sarStandardInfoDao.select(term, "XCXSSRQ");
|
||||
List<WarningEO> standInfoXCXSSRQ = sarStandardInfoDao.selectWithinTerm(term, "XCXSSRQ");
|
||||
for (WarningEO warningEO : standInfoXCXSSRQ) {
|
||||
warningEO.setId(UUIDUtils.randomUUID20())
|
||||
.setPower("1")
|
||||
@@ -115,7 +115,7 @@ public class ScheduledJob {
|
||||
|
||||
|
||||
//标准 在产车型 mark=4
|
||||
List<WarningEO> standInfoZCCSSRQ = sarStandardInfoDao.select(term, "ZCCSSRQ");
|
||||
List<WarningEO> standInfoZCCSSRQ = sarStandardInfoDao.selectWithinTerm(term, "ZCCSSRQ");
|
||||
for (WarningEO warningEO : standInfoZCCSSRQ) {
|
||||
warningEO.setId(UUIDUtils.randomUUID20())
|
||||
.setPower("1")
|
||||
@@ -12,6 +12,6 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface SarStandardInfoDao{
|
||||
|
||||
public List<WarningEO> select(DataDTO date, String str);
|
||||
public List<WarningEO> selectWithinTerm(DataDTO date, String str);
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,6 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface SarStandardItemDao extends BaseMapper{
|
||||
|
||||
public List<WarningEO> select(DataDTO date, String str);
|
||||
public List<WarningEO> selectWithinTerm(DataDTO date, String str);
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</resultMap>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<select id="select" resultMap="resultMap" parameterType="com.adc.da.scheduled.entity.DataDTO">
|
||||
<select id="selectWithinTerm" resultMap="resultMap" parameterType="com.adc.da.scheduled.entity.DataDTO">
|
||||
SELECT
|
||||
info.ID,
|
||||
info.STAND_NUMBER,
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<result column="ZRGCS" property="dutyEngineer"/>
|
||||
</resultMap>
|
||||
<!-- 查询条件 -->
|
||||
<select id="select" resultMap="resultMap" parameterType="com.adc.da.scheduled.entity.DataDTO">
|
||||
<select id="selectWithinTerm" resultMap="resultMap" parameterType="com.adc.da.scheduled.entity.DataDTO">
|
||||
SELECT
|
||||
items.ID,
|
||||
STAND_ID,
|
||||
|
||||
Reference in New Issue
Block a user