parent
3e06e8c776
commit
499ea8f733
|
@ -61,4 +61,11 @@ public interface TaskInfoMapper extends Mapper<TaskInfo>, MySqlMapper<TaskInfo>
|
|||
* @return the task info current status
|
||||
*/
|
||||
int getTaskInfoCurrentStatus(Long id);
|
||||
|
||||
/**
|
||||
* Remove task by id.
|
||||
*
|
||||
* @param id the id
|
||||
*/
|
||||
void removeTaskInfoById(Long id);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.dispose.common.IPAddrType;
|
|||
import com.dispose.dispose.DeviceRouter;
|
||||
import com.dispose.dispose.DisposeEntryManager;
|
||||
import com.dispose.mapper.DisposeDeviceMapper;
|
||||
import com.dispose.mapper.TaskInfoMapper;
|
||||
import com.dispose.pojo.entity.DisposeDevice;
|
||||
import com.dispose.pojo.po.DisposeDeviceCapacity;
|
||||
import com.dispose.pojo.po.MulReturnType;
|
||||
|
@ -35,6 +36,8 @@ public class DisposeNodeManagerImpl implements DisposeNodeManager {
|
|||
private DisposeDeviceMapper disposeDeviceMapper;
|
||||
@Resource
|
||||
private UserAccountService userAccountService;
|
||||
@Resource
|
||||
private TaskInfoMapper taskInfoMapper;
|
||||
|
||||
/**
|
||||
* Cleanup dispose node cache.
|
||||
|
@ -120,6 +123,9 @@ public class DisposeNodeManagerImpl implements DisposeNodeManager {
|
|||
return ErrorCode.ERR_NOSUCHDEVICE;
|
||||
}
|
||||
|
||||
//删除task info表中的任务
|
||||
taskInfoMapper.removeTaskInfoById(dev.getId());
|
||||
|
||||
// 删除数据库和缓存中内容
|
||||
disposeDeviceMapper.delDisposeDeviceByIp(ipAddr);
|
||||
disposeDevMap.remove(ipAddr);
|
||||
|
@ -146,7 +152,7 @@ public class DisposeNodeManagerImpl implements DisposeNodeManager {
|
|||
|
||||
try {
|
||||
// 获取处置设备硬件访问接口
|
||||
dp = DeviceRouter.getDeviceRouterFactory(dev.getType(), dev.getIpAddr());
|
||||
dp = DeviceRouter.deviceRouterFactory(dev);
|
||||
|
||||
// 判断设备是否在线
|
||||
if (!dp.getDeviceLinkStatus()) {
|
||||
|
|
|
@ -34,4 +34,11 @@
|
|||
WHERE id = #{id, jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<delete id="removeTaskInfoById" parameterType="java.lang.Long">
|
||||
DELETE
|
||||
task_info
|
||||
FROM task_info
|
||||
WHERE task_info.deviceId = #{deviceId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue