parent
bf512cab01
commit
a738c4f13e
|
@ -41,6 +41,13 @@ public interface DisposeTaskManager {
|
|||
*/
|
||||
List<DisposeTask> getExpiredTasks();
|
||||
|
||||
/**
|
||||
* Gets un expired tasks.
|
||||
*
|
||||
* @return the un expired tasks
|
||||
*/
|
||||
List<DisposeTask> getUnExpiredTasks();
|
||||
|
||||
/**
|
||||
* Gets new dispose tasks.
|
||||
*
|
||||
|
|
|
@ -88,6 +88,16 @@ public class DisposeTaskManagerImpl implements DisposeTaskManager {
|
|||
return disposeTaskMapper.getExpiredTasks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets un expired tasks.
|
||||
*
|
||||
* @return the un expired tasks
|
||||
*/
|
||||
@Override
|
||||
public List<DisposeTask> getUnExpiredTasks() {
|
||||
return disposeTaskMapper.getUnExpiredTasks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets new dispose tasks.
|
||||
*
|
||||
|
|
|
@ -104,4 +104,11 @@ public interface DisposeTaskMapper {
|
|||
* @return the expired tasks
|
||||
*/
|
||||
List<DisposeTask> getExpiredTasks();
|
||||
|
||||
/**
|
||||
* Gets un expired tasks.
|
||||
*
|
||||
* @return the un expired tasks
|
||||
*/
|
||||
List<DisposeTask> getUnExpiredTasks();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -139,6 +139,15 @@
|
|||
WHERE currentStatus = ${@com.dispose.common.DisposeTaskStatus@TASK_NEW.getValue()}
|
||||
</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 *
|
||||
FROM dispose_task
|
||||
|
|
Loading…
Reference in New Issue