| | |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.minio.entity.MinIoConstant; |
| | | import com.sandu.ximon.admin.param.IpVolumeMissionParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | |
| | | /** |
| | | * 删除任务 |
| | | * |
| | | * @param taskId |
| | | * @param taskIds |
| | | * @return0:成功 1:任务不处于空闲状态 2:服务器删除失败 |
| | | */ |
| | | public Integer deleteMission(Integer taskId) { |
| | | Integer del = TaskAPIUtils.delTask(taskId); |
| | | if (del == 0) { |
| | | IpVolumeMission byId = getById(taskId); |
| | | if (byId == null) { |
| | | return -1; |
| | | } |
| | | removeById(taskId); |
| | | broadcastV2TaskFileService.deleteByTaskId(taskId); |
| | | broadcastV2TaskTerminalService.deleteByTaskId(taskId); |
| | | public Integer deleteMission(List<Integer> taskIds) { |
| | | //删除失败的集合 |
| | | List<Integer> delIds = new ArrayList<Integer>(); |
| | | if (!taskIds.isEmpty()) { |
| | | taskIds.forEach(taskId -> { |
| | | Integer del = TaskAPIUtils.delTask(taskId); |
| | | if (del == 0) { |
| | | IpVolumeMission byId = getById(taskId); |
| | | if (byId == null) { |
| | | return; |
| | | } |
| | | removeById(taskId); |
| | | broadcastV2TaskFileService.deleteByTaskId(taskId); |
| | | broadcastV2TaskTerminalService.deleteByTaskId(taskId); |
| | | // broadcastV2TaskTerminalService.removeById(taskId); |
| | | } else { |
| | | delIds.add(taskId); |
| | | } |
| | | |
| | | /** |
| | | * IP音柱任务删除 日志记录开始 |
| | | */ |
| | | String content = "{删除的任务ID:" + taskId |
| | | + ",任务删除结果:" + del |
| | | + " }"; |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "IP音柱任务删除", content); |
| | | /** |
| | | * IP音柱任务删除 日志记录结束 |
| | | */ |
| | | }); |
| | | } else { |
| | | throw new BusinessException("任务id不能为空"); |
| | | } |
| | | |
| | | /** |
| | | * IP音柱任务删除 日志记录开始 |
| | | */ |
| | | String content = "{删除的任务ID:" + taskId |
| | | + ",任务删除结果:" + del |
| | | + " }"; |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "IP音柱任务删除", content); |
| | | /** |
| | | * IP音柱任务删除 日志记录结束 |
| | | */ |
| | | |
| | | |
| | | return del; |
| | | if (delIds.isEmpty()) { |
| | | return 0; |
| | | } else { |
| | | throw new BusinessException("部分删除失败,失败的集合为:" + delIds); |
| | | } |
| | | } |
| | | |
| | | |