Commit 00e13906 authored by wdy's avatar wdy

根据子任务id查询总任务详情

parent e5ccadd0
......@@ -33,4 +33,6 @@ public interface TaskMapper extends BaseMapper<Task> {
Long findBySystemReviewTaskId(@Param("systemReviewId") Long systemReviewId);
Task getByUserIdTemporary(@Param("userId") Long userId);
Task getBySubtaskId(@Param("subId") Long subId);
}
......@@ -58,4 +58,6 @@ public interface TaskService extends IService<Task> {
void temporaryStorageTask(TaskCreateRequest request);
TaskGetInfoResponse getByUserId(Long userId);
TaskGetInfoResponse getBySubtaskId(TaskSubGetInfoRequest request);
}
......@@ -432,6 +432,31 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
}
@Override
public TaskGetInfoResponse getBySubtaskId(TaskSubGetInfoRequest request) {
TaskGetInfoResponse response = new TaskGetInfoResponse();
Task task = taskMapper.getBySubtaskId(request.getId());
BeanUtils.copyBeanProp(response, task);
// 小组成员
List<TaskUserRelation> relation = taskUserRelationService.selectQTeamMembers(task.getId());
response.setAuditors(relation);
// 整车样品信息
List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(task.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE);
if (relationList.size() != 0 && relationList != null) {
List<Sample> completeVehicleSampleList = sampleManagementMapper.findByIdList(relationList);
response.setCompleteVehicleSample(completeVehicleSampleList);
}
// 零部件样品信息
List<TaskSampleRelation> partRelationList = taskSampleRelationService.selectByTaskId(task.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE);
if (partRelationList.size() != 0 && partRelationList != null) {
List<Sample> partVehicleSampleList = sampleManagementMapper.findByIdList(partRelationList);
response.setPartVehicleSample(partVehicleSampleList);
}
return response;
}
public Long saveSystemReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) {
// 构建并保存任务信息
......
......@@ -91,6 +91,16 @@ public class TaskController extends BaseController {
return R.ok(response);
}
@ApiOperation("根据子任务id查看任务详情")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getBySubtaskId")
public R<TaskGetInfoResponse> getBySubtaskId(@Validated @RequestBody TaskSubGetInfoRequest request) {
TaskGetInfoResponse response = taskService.getBySubtaskId(request);
return R.ok(response);
}
@ApiOperation("用户发布的任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
......
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "TaskSubGetInfoRequest", description = "根据子任务id查看任务详情")
@Data
public class TaskSubGetInfoRequest {
@ApiModelProperty("id")
private Long id;
}
......@@ -252,6 +252,19 @@
FROM t_task
WHERE task_initiator_id = #{userId} and task_status = 'TEMPORARILY'
</select>
<select id="getBySubtaskId" resultType="com.ruoyi.domain.Task">
SELECT id, system_review_task_id, car_review_task_id,
task_status,run_status,next_node,task_no,task_name,confidentiality_level,
product_name,product_model,
entrusted_unit,entrusted_unit_address,entrusted_unit_phone,
entrusted_unit_code,vehicle_sample_information,part_sample_information,
task_initiator_id,task_initiator,task_initiator_dept,
task_begin_time,task_end_time,create_time,
leader_id,leader,standard_id,name,
standard_no,file,task_list
FROM t_task
WHERE system_review_task_id = #{subId} OR car_review_task_id = #{subId}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment