|
@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
import com.iflytop.nuclear.mapper.TaskMapper; |
|
|
import com.iflytop.nuclear.mapper.TaskMapper; |
|
|
import com.iflytop.nuclear.model.Account; |
|
|
import com.iflytop.nuclear.model.Account; |
|
|
|
|
|
import com.iflytop.nuclear.model.NuclearCoreConfig; |
|
|
import com.iflytop.nuclear.model.Task; |
|
|
import com.iflytop.nuclear.model.Task; |
|
|
|
|
|
import com.iflytop.nuclear.service.NuclearCoreConfigService; |
|
|
import com.iflytop.nuclear.service.TaskService; |
|
|
import com.iflytop.nuclear.service.TaskService; |
|
|
import com.iflytop.nuclear.vo.TaskVO; |
|
|
import com.iflytop.nuclear.vo.TaskVO; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
@ -20,6 +22,9 @@ import java.util.List; |
|
|
@Service |
|
|
@Service |
|
|
public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService { |
|
|
public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
NuclearCoreConfigService nuclearCoreConfigService; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<TaskVO> getTaskInfoByUsername(String username, String user_role) { |
|
|
public List<TaskVO> getTaskInfoByUsername(String username, String user_role) { |
|
|
List<Task> list = null; |
|
|
List<Task> list = null; |
|
@ -32,6 +37,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta |
|
|
} |
|
|
} |
|
|
List<TaskVO> result= new ArrayList<>(); |
|
|
List<TaskVO> result= new ArrayList<>(); |
|
|
for (Task task: list) { |
|
|
for (Task task: list) { |
|
|
|
|
|
// 查询该task上传过excel吗 |
|
|
|
|
|
QueryWrapper<NuclearCoreConfig> nuclearCoreConfigQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
nuclearCoreConfigQueryWrapper.eq("task_id", task.getId()); |
|
|
|
|
|
List<NuclearCoreConfig> nuclearCoreConfigList = nuclearCoreConfigService.list(nuclearCoreConfigQueryWrapper); |
|
|
|
|
|
boolean canUpload = true; |
|
|
|
|
|
if (nuclearCoreConfigList.size() > 0) { |
|
|
|
|
|
canUpload = false; |
|
|
|
|
|
} |
|
|
TaskVO taskVO = TaskVO.builder() |
|
|
TaskVO taskVO = TaskVO.builder() |
|
|
.taskName(task.getTaskName()) |
|
|
.taskName(task.getTaskName()) |
|
|
.checkOrder(task.getCheckOrder()) |
|
|
.checkOrder(task.getCheckOrder()) |
|
@ -42,6 +55,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta |
|
|
.operatorName(task.getOperatorId()) |
|
|
.operatorName(task.getOperatorId()) |
|
|
.startTime(task.getStartTime()) |
|
|
.startTime(task.getStartTime()) |
|
|
.endTime(task.getEndTime()) |
|
|
.endTime(task.getEndTime()) |
|
|
|
|
|
.canUpload(canUpload) |
|
|
.build(); |
|
|
.build(); |
|
|
result.add(taskVO); |
|
|
result.add(taskVO); |
|
|
} |
|
|
} |
|
|