REM:
1. 增加获取为过期任务接口
This commit is contained in:
HuangXin 2021-01-19 11:23:30 +08:00
parent bf512cab01
commit a738c4f13e
5 changed files with 34 additions and 1 deletions

View File

@ -41,6 +41,13 @@ public interface DisposeTaskManager {
*/ */
List<DisposeTask> getExpiredTasks(); List<DisposeTask> getExpiredTasks();
/**
* Gets un expired tasks.
*
* @return the un expired tasks
*/
List<DisposeTask> getUnExpiredTasks();
/** /**
* Gets new dispose tasks. * Gets new dispose tasks.
* *

View File

@ -88,6 +88,16 @@ public class DisposeTaskManagerImpl implements DisposeTaskManager {
return disposeTaskMapper.getExpiredTasks(); return disposeTaskMapper.getExpiredTasks();
} }
/**
* Gets un expired tasks.
*
* @return the un expired tasks
*/
@Override
public List<DisposeTask> getUnExpiredTasks() {
return disposeTaskMapper.getUnExpiredTasks();
}
/** /**
* Gets new dispose tasks. * Gets new dispose tasks.
* *

View File

@ -104,4 +104,11 @@ public interface DisposeTaskMapper {
* @return the expired tasks * @return the expired tasks
*/ */
List<DisposeTask> getExpiredTasks(); List<DisposeTask> getExpiredTasks();
/**
* Gets un expired tasks.
*
* @return the un expired tasks
*/
List<DisposeTask> getUnExpiredTasks();
} }

View File

@ -462,7 +462,7 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService {
} }
// 对新建的任务创建对应处置设备任务信息 // 对新建的任务创建对应处置设备任务信息
for (DisposeTask v : disposeTaskManager.getExpiredTasks()) { for (DisposeTask v : disposeTaskManager.getUnExpiredTasks()) {
// 设置任务状态, 开始创建任务 // 设置任务状态, 开始创建任务
disposeTaskManager.changeDisposeTaskStatus(v.getId(), DisposeTaskStatus.TASK_STARTING); disposeTaskManager.changeDisposeTaskStatus(v.getId(), DisposeTaskStatus.TASK_STARTING);

View File

@ -139,6 +139,15 @@
WHERE currentStatus = ${@com.dispose.common.DisposeTaskStatus@TASK_NEW.getValue()} WHERE currentStatus = ${@com.dispose.common.DisposeTaskStatus@TASK_NEW.getValue()}
</select> </select>
<select id="getUnExpiredTasks" resultType="com.dispose.pojo.entity.DisposeTask">
SELECT *
FROM dispose_task
WHERE currentStatus != ${@com.dispose.common.DisposeTaskStatus@TASK_FINISHED.getValue()}
AND currentStatus != ${@com.dispose.common.DisposeTaskStatus@TASK_CANCELED.getValue()}
AND currentStatus != ${@com.dispose.common.DisposeTaskStatus@TASK_EXPIRED.getValue()}
AND planEndTime > CURRENT_TIMESTAMP()
</select>
<select id="getExpiredTasks" resultType="com.dispose.pojo.entity.DisposeTask"> <select id="getExpiredTasks" resultType="com.dispose.pojo.entity.DisposeTask">
SELECT * SELECT *
FROM dispose_task FROM dispose_task