Commit 5660e8c4 authored by W_Y's avatar W_Y

查询进行中的任务

parent d65cb58e
......@@ -2,7 +2,9 @@ package com.ruoyi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.Task;
import com.ruoyi.web.request.TaskFindPendingRequest;
import com.ruoyi.web.request.TaskListRequest;
import com.ruoyi.web.response.TaskFindPendingResponse;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -12,4 +14,6 @@ import java.util.List;
public interface TaskMapper extends BaseMapper<Task> {
List<Task> findList(TaskListRequest request);
List<TaskFindPendingResponse> findPending(TaskFindPendingRequest request);
}
......@@ -3,7 +3,10 @@ package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.Task;
import com.ruoyi.web.request.TaskCreateRequest;
import com.ruoyi.web.request.TaskFindPendingRequest;
import com.ruoyi.web.request.TaskListRequest;
import com.ruoyi.web.response.TaskFindPendingResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -17,4 +20,11 @@ public interface TaskService extends IService<Task> {
List<Task> findList(TaskListRequest request);
void createTask(TaskCreateRequest request);
/**
* 查询进行中的任务
* @param request
* @return
*/
List<TaskFindPendingResponse> findPending(TaskFindPendingRequest request);
}
......@@ -12,7 +12,9 @@ import com.ruoyi.mapper.TaskMapper;
import com.ruoyi.service.*;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.request.TaskCreateRequest;
import com.ruoyi.web.request.TaskFindPendingRequest;
import com.ruoyi.web.request.TaskListRequest;
import com.ruoyi.web.response.TaskFindPendingResponse;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -107,6 +109,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
}
@Override
public List<TaskFindPendingResponse> findPending(TaskFindPendingRequest request) {
return taskMapper.findPending(request);
}
public Long saveSystemReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) {
// 构建并保存任务信息
......
......@@ -11,8 +11,10 @@ import com.ruoyi.domain.TaskUserRelation;
import com.ruoyi.service.TaskService;
import com.ruoyi.service.TaskUserRelationService;
import com.ruoyi.web.request.TaskCreateRequest;
import com.ruoyi.web.request.TaskFindPendingRequest;
import com.ruoyi.web.request.TaskGetInfoRequest;
import com.ruoyi.web.request.TaskListRequest;
import com.ruoyi.web.response.TaskFindPendingResponse;
import com.ruoyi.web.response.TaskGetInfoResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -72,4 +74,13 @@ public class TaskController extends BaseController {
return R.ok(response);
}
@ApiOperation("查询处理中的任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findPending")
public TableDataInfo<TaskFindPendingResponse> findPending(@Validated @RequestBody TaskFindPendingRequest request) {
startPage(request);
return getDataTable(taskService.findPending(request));
}
}
package com.ruoyi.web.request;
import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@ApiModel(value = "TaskFindPendingRequest", description = "查询进行中总任务")
@Data
public class TaskFindPendingRequest extends PageDomain {
@ApiModelProperty("任务编号")
private String taskNo;
@ApiModelProperty("名称关键词")
private String taskName;
@ApiModelProperty("任务开始时间")
private Date taskBeginTime;
@ApiModelProperty("子任务状态")
private String subStatus;
}
package com.ruoyi.web.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "TaskFindPendingResponse", description = "进行中的总任务")
@Data
public class TaskFindPendingResponse {
@ApiModelProperty("主键")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
@ApiModelProperty("体系审查任务id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long systemReviewTaskId;
@ApiModelProperty("车辆检查任务id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long carReviewTaskId;
@ApiModelProperty("任务编号")
private String taskNo;
@ApiModelProperty("任务名称")
private String taskName;
@ApiModelProperty("任务状态(NEW、PENDING、FINISH)")
private String taskStatus;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@ApiModelProperty("审核组长id")
private Long leaderId;
@ApiModelProperty("审核组长姓名")
private String leader;
@ApiModelProperty("体系审查任务状态")
private String reviewStatus;
@ApiModelProperty("车型审查任务状态")
private String carReviewStatus;
@ApiModelProperty("测试任务状态")
private String carTestStatus;
}
......@@ -16,10 +16,10 @@
FROM t_standard
<where>
<if test="params.name != null and params.name != ''">
name like concat('%',#{params.name},'%')
and name like concat('%',#{params.name},'%')
</if>
<if test="params.standardNo != null and params.standardNo != ''">
standard_no = #{params.standardNo}
and standard_no = #{params.standardNo}
</if>
</where>
</select>
......
......@@ -41,6 +41,20 @@
<result property="file" column="file" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="ResponseMap" type="com.ruoyi.web.response.TaskFindPendingResponse">
<id property="id" column="id" jdbcType="BIGINT"/>
<id property="systemReviewTaskId" column="system_review_task_id" jdbcType="BIGINT"/>
<id property="carReviewTaskId" column="car_review_task_id" jdbcType="BIGINT"/>
<result property="taskNo" column="task_no" jdbcType="VARCHAR"/>
<result property="taskName" column="task_name" jdbcType="VARCHAR"/>
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
<result property="leaderId" column="leader_id" jdbcType="BIGINT"/>
<result property="leader" column="leader" jdbcType="VARCHAR"/>
<result property="reviewStatus" column="review_status" jdbcType="VARCHAR"/>
<result property="carReviewStatus" column="car_review_status" jdbcType="VARCHAR"/>
<result property="carTestStatus" column="car_test_status" jdbcType="VARCHAR"/>
</resultMap>
<select id="findList" parameterType="com.ruoyi.web.request.TaskListRequest" resultMap="BaseResultMap">
SELECT id, system_review_task_id, car_review_task_id,
task_no,task_name,task_status,product_name,product_model,
......@@ -63,6 +77,32 @@
</where>
order by create_time desc
</select>
<select id="findPending" parameterType="com.ruoyi.web.request.TaskFindPendingRequest" resultMap="ResponseMap">
SELECT t.id, t.system_review_task_id, t.car_review_task_id,
t.task_no,t.task_name,t.task_status,
t.leader_id,t.leader,
srt.task_status review_status,
crt.review_status car_review_status,
crt.test_status car_test_status
FROM t_task t
left join t_system_review_task srt on t.system_review_task_id = srt.id
left join t_car_review_task crt on t.car_review_task_id = crt.id
<where>
t.task_status IN ("NEW","PENDING")
<if test="taskNo != null and taskNo != ''">
and t.task_no = #{taskNo}
</if>
<if test="taskName != null and taskName != ''">
and t.task_name like concat('%',#{taskName},'%')
</if>
<if test="taskBeginTime != null and taskBeginTime != ''">
and t.task_begin_time = #{taskBeginTime}
</if>
<if test="subStatus != null and subStatus != ''">
and review_status = #{subStatus} OR car_review_status = #{subStatus} OR car_test_status = #{subStatus}
</if>
</where>
</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