@@ -20,6 +20,17 @@ public class TaskController { | |||
@Autowired | |||
private ITaskService taskService; | |||
/** | |||
* 获取任务详情 | |||
* | |||
* @param taskId 任务ID | |||
* @return | |||
*/ | |||
@GetMapping("/{taskId}") | |||
public JsonResult detail(@PathVariable("taskId") String taskId) { | |||
return taskService.detail(taskId); | |||
} | |||
/** | |||
* 获取任务分页列表 | |||
* |
@@ -1,6 +1,7 @@ | |||
package com.tuoheng.task.service; | |||
import com.tuoheng.common.core.common.IBaseService; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.task.entity.Task; | |||
/** | |||
@@ -10,4 +11,12 @@ import com.tuoheng.task.entity.Task; | |||
* @since 2022-06-30 | |||
*/ | |||
public interface ITaskService extends IBaseService<Task> { | |||
/** | |||
* 获取任务详情 | |||
* | |||
* @param taskId | |||
* @return | |||
*/ | |||
JsonResult detail(String taskId); | |||
} |
@@ -7,20 +7,18 @@ import com.tuoheng.common.core.common.BaseQuery; | |||
import com.tuoheng.common.core.common.BaseServiceImpl; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.common.core.utils.StringUtils; | |||
import com.tuoheng.task.api.fegin.vo.CityVo; | |||
import com.tuoheng.task.entity.Stream; | |||
import com.tuoheng.task.entity.Inspection; | |||
import com.tuoheng.task.entity.Task; | |||
import com.tuoheng.task.mapper.StreamMapper; | |||
import com.tuoheng.task.mapper.InspectionMapper; | |||
import com.tuoheng.task.mapper.TaskMapper; | |||
import com.tuoheng.task.query.StreamQuery; | |||
import com.tuoheng.task.query.TaskQuery; | |||
import com.tuoheng.task.service.ITaskService; | |||
import com.tuoheng.task.vo.StreamInfoVo; | |||
import com.tuoheng.task.vo.TaskVo; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.util.List; | |||
/** | |||
* 任务表 服务实现类 | |||
* | |||
@@ -33,6 +31,9 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement | |||
@Autowired | |||
private TaskMapper taskMapper; | |||
@Autowired | |||
private InspectionMapper inspectionMapper; | |||
/** | |||
* 获取任务分页列表 | |||
* | |||
@@ -50,4 +51,19 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement | |||
return JsonResult.success(pageData); | |||
} | |||
@Override | |||
public JsonResult detail(String taskId) { | |||
taskMapper.selectById(taskId); | |||
List<Inspection> inspectionList = inspectionMapper.selectList(new LambdaQueryWrapper<Inspection>() | |||
.eq(Inspection::getTaskId, taskId) | |||
.eq(Inspection::getMark, 1) | |||
.orderByAsc(Inspection::getCreateTime)); | |||
if(StringUtils.isNotEmpty(inspectionList)){ | |||
} | |||
return JsonResult.success(); | |||
} | |||
} |
@@ -0,0 +1,95 @@ | |||
package com.tuoheng.task.vo; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.util.Date; | |||
@Data | |||
public class TaskDetailVo { | |||
/** | |||
* 任务ID | |||
*/ | |||
private String id; | |||
/** | |||
* 任务编号 | |||
*/ | |||
private String code; | |||
/** | |||
* 任务名称 | |||
*/ | |||
private String name; | |||
/** | |||
* 河道ID | |||
*/ | |||
private String streamId; | |||
/** | |||
* 期望巡检日期 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | |||
private Date inspectionHopeTime; | |||
/** | |||
* 任务状态:1任务待飞行 2任务飞行中 3任务飞行完成 | |||
*/ | |||
private Integer status; | |||
/** | |||
* 备注 | |||
*/ | |||
private String note; | |||
/** | |||
* 飞手ID | |||
*/ | |||
private String flightHand; | |||
/** | |||
* 飞手名称 | |||
*/ | |||
private String flightHandName; | |||
/** | |||
* 飞行设备 | |||
*/ | |||
private String equipmentId; | |||
/** | |||
* 挂载设备(多选逗号","分隔) | |||
*/ | |||
private String equipmentMountId; | |||
/** | |||
* 挂载设备(多选逗号","分隔) | |||
*/ | |||
private String equipmentMountName; | |||
/** | |||
* 5G云盒ID | |||
*/ | |||
private String cloudBoxId; | |||
/** | |||
* 天气 | |||
*/ | |||
private String weather; | |||
/** | |||
* 飞行高度(保留两位小数) | |||
*/ | |||
private String flyHeight; | |||
/** | |||
* 执行开始时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | |||
private Date executionStartTime; | |||
} |