| | |
| | | import com.sandu.ximon.admin.vo.TaskTerminalVO; |
| | | import com.sandu.ximon.admin.vo.TaskVO; |
| | | import com.sandu.ximon.dao.bo.IpVolumeMissionBo; |
| | | import com.sandu.ximon.dao.domain.*; |
| | | import com.sandu.ximon.dao.domain.BroadcastV2TaskFile; |
| | | import com.sandu.ximon.dao.domain.BroadcastV2TaskTerminal; |
| | | import com.sandu.ximon.dao.domain.IpVolumeFile; |
| | | import com.sandu.ximon.dao.domain.IpVolumeMission; |
| | | import com.sandu.ximon.dao.mapper.IpVolumeMissionMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | |
| | | import java.math.BigInteger; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | |
| | |
| | | //return new ArrayList<>(); |
| | | } |
| | | |
| | | public IpVolumeMission getByTaskId(Integer taskId) { |
| | | public TaskVO getByTaskId(Integer taskId) { |
| | | TaskVO task = TaskAPIUtils.getTask(taskId); |
| | | if (task == null) { |
| | | throw new BusinessException("服务器未找到该任务"); |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | byId.setWeeks("0" + Integer.toBinaryString(byId.getWeek())); |
| | | task.setWeeks("0" + Integer.toBinaryString(byId.getWeek())); |
| | | // byId.setWeeks("0" + Integer.toBinaryString(byId.getWeek())); |
| | | |
| | | // IpVolumeMissionBo bo = new IpVolumeMissionBo(); |
| | | List<BroadcastV2TaskFile> taskFiles = broadcastV2TaskFileService.list(Wrappers.lambdaQuery(BroadcastV2TaskFile.class) |
| | |
| | | // if(taskFiles.isEmpty()||taskTerminals.isEmpty()){ |
| | | // throw new BusinessException(""); |
| | | // } |
| | | if(!taskFiles.isEmpty()){ |
| | | taskFiles.forEach( |
| | | fileId->{ |
| | | if (!taskFiles.isEmpty()) { |
| | | taskFiles.forEach( |
| | | fileId -> { |
| | | // IpVolumeFile volumeFile = ipVolumeFileService.getById(fileId.getFileId()); |
| | | // if(volumeFile==null){ |
| | | // throw new BusinessException("任务文件不存在"); |
| | | // } |
| | | byId.getFileIds().add(fileId.getFileId()); |
| | | } |
| | | ); |
| | | task.getFileIds().add(fileId.getFileId()); |
| | | // byId.getFileIds().add(fileId.getFileId()); |
| | | } |
| | | ); |
| | | |
| | | } |
| | | if(!taskTerminals.isEmpty()){ |
| | | if (!taskTerminals.isEmpty()) { |
| | | taskTerminals.forEach( |
| | | terminalId->{ |
| | | terminalId -> { |
| | | // BroadcastTerminalV2Entity v2Entity = ipVolumeService.getById(terminalId.getTerminalId()); |
| | | // if(v2Entity==null){ |
| | | // throw new BusinessException("该任务暂无设备使用"); |
| | | // } |
| | | byId.getTerminalIds().add(terminalId.getTerminalId()); |
| | | task.getTerminalIds().add(terminalId.getTerminalId()); |
| | | // byId.getTerminalIds().add(terminalId.getTerminalId()); |
| | | } |
| | | ); |
| | | } |
| | | |
| | | return byId; |
| | | return task; |
| | | |
| | | |
| | | } |