Commit 7adcb6da authored by wdy's avatar wdy

查询用户发起的任务

parent 7eeaf27c
...@@ -66,9 +66,12 @@ public class Task { ...@@ -66,9 +66,12 @@ public class Task {
@JsonFormat(shape = JsonFormat.Shape.STRING) @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long carReviewTaskId; private Long carReviewTaskId;
@ApiModelProperty("任务状态(NEW、FINISH)") @ApiModelProperty("任务状态NEW(新建的)、PENDING(运行中的)、FINISH(已结束的)")
private String taskStatus; private String taskStatus;
@ApiModelProperty("任务运行状态[RUNNABLE(可运行的)、RUNNING(运行中的)]")
private String runStatus;
@ApiModelProperty("下一个节点 SUB_TASK_SRAIF(体系审查子任务)、SUB_TASK_TRFIS(车辆实验子任务)、SUB_TASK_GRFIS(车辆问卷子任务)") @ApiModelProperty("下一个节点 SUB_TASK_SRAIF(体系审查子任务)、SUB_TASK_TRFIS(车辆实验子任务)、SUB_TASK_GRFIS(车辆问卷子任务)")
private String nextNode; private String nextNode;
......
...@@ -37,4 +37,11 @@ public interface TaskService extends IService<Task> { ...@@ -37,4 +37,11 @@ public interface TaskService extends IService<Task> {
void deleteTask(TaskDeleteRequest request); void deleteTask(TaskDeleteRequest request);
void startTask(TaskStartRequest request); void startTask(TaskStartRequest request);
/**
* 用户发起的任务
* @param request
* @return
*/
List<TaskFindResponse> findCreate(TaskFindRequest request,Long userId);
} }
...@@ -185,6 +185,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -185,6 +185,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
taskStateFacade.doStart(task); taskStateFacade.doStart(task);
} }
@Override
public List<TaskFindResponse> findCreate(TaskFindRequest request,Long userId) {
List<TaskFindResponse> responses = taskMapper.findByUserId(request,userId);
return responses;
}
public Long saveSystemReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) { public Long saveSystemReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) {
// 构建并保存任务信息 // 构建并保存任务信息
......
...@@ -71,6 +71,16 @@ public class TaskController extends BaseController { ...@@ -71,6 +71,16 @@ public class TaskController extends BaseController {
return R.ok(response); return R.ok(response);
} }
@ApiOperation("用户发布的任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findCreate")
public TableDataInfo<TaskFindResponse> findCreate(@Validated @RequestBody TaskFindRequest request) {
startPage(request);
return getDataTable(taskService.findCreate(request,getUserId()));
}
@ApiOperation("查询处理中的任务") @ApiOperation("查询处理中的任务")
@Trace @Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")}) @Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
......
...@@ -35,6 +35,9 @@ public class TaskFindResponse { ...@@ -35,6 +35,9 @@ public class TaskFindResponse {
@ApiModelProperty("任务状态(NEW、PENDING、FINISH)") @ApiModelProperty("任务状态(NEW、PENDING、FINISH)")
private String taskStatus; private String taskStatus;
@ApiModelProperty("任务运行状态[RUNNABLE(可运行的)、RUNNING(运行中的)]")
private String runStatus;
@ApiModelProperty("下一个节点 SUB_TASK_SRAIF(体系审查子任务)、SUB_TASK_TRFIS(车辆实验子任务)、SUB_TASK_GRFIS(车辆问卷子任务)") @ApiModelProperty("下一个节点 SUB_TASK_SRAIF(体系审查子任务)、SUB_TASK_TRFIS(车辆实验子任务)、SUB_TASK_GRFIS(车辆问卷子任务)")
private String nextNode; private String nextNode;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<id property="systemReviewTaskId" column="system_review_task_id" jdbcType="BIGINT"/> <id property="systemReviewTaskId" column="system_review_task_id" jdbcType="BIGINT"/>
<id property="carReviewTaskId" column="car_review_task_id" jdbcType="BIGINT"/> <id property="carReviewTaskId" column="car_review_task_id" jdbcType="BIGINT"/>
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/> <result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
<result property="runStatus" column="run_status" jdbcType="VARCHAR"/>
<result property="nextNode" column="next_node" jdbcType="VARCHAR"/> <result property="nextNode" column="next_node" jdbcType="VARCHAR"/>
<result property="taskNo" column="task_no" jdbcType="VARCHAR"/> <result property="taskNo" column="task_no" jdbcType="VARCHAR"/>
<result property="taskName" column="task_name" jdbcType="VARCHAR"/> <result property="taskName" column="task_name" jdbcType="VARCHAR"/>
...@@ -41,7 +42,9 @@ ...@@ -41,7 +42,9 @@
<id property="carReviewTaskId" column="car_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="taskNo" column="task_no" jdbcType="VARCHAR"/>
<result property="taskName" column="task_name" jdbcType="VARCHAR"/> <result property="taskName" column="task_name" jdbcType="VARCHAR"/>
<result property="productModel" column="product_model" jdbcType="VARCHAR"/>
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/> <result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
<result property="runStatus" column="run_status" jdbcType="VARCHAR"/>
<result property="nextNode" column="next_node" jdbcType="VARCHAR"/> <result property="nextNode" column="next_node" jdbcType="VARCHAR"/>
<result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/> <result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/>
<result property="systemTaskBeginTime" column="system_task_begin_time" jdbcType="TIMESTAMP"/> <result property="systemTaskBeginTime" column="system_task_begin_time" jdbcType="TIMESTAMP"/>
...@@ -135,6 +138,7 @@ ...@@ -135,6 +138,7 @@
<select id="findByUserId" resultMap="ResponseMap"> <select id="findByUserId" resultMap="ResponseMap">
SELECT t.id, t.system_review_task_id, t.car_review_task_id, SELECT t.id, t.system_review_task_id, t.car_review_task_id,
t.task_no,t.task_name,t.task_status, t.task_no,t.task_name,t.task_status,
t.product_model,
t.leader_id,t.leader, t.leader_id,t.leader,
t.task_begin_time, t.task_begin_time,
t.next_node, t.next_node,
...@@ -148,6 +152,7 @@ ...@@ -148,6 +152,7 @@
left join t_system_review_task srt on t.system_review_task_id = srt.id 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 left join t_car_review_task crt on t.car_review_task_id = crt.id
<where> <where>
and t.task_initiator_id = #{userId}
<if test="request.standardId != null and request.standardId != ''"> <if test="request.standardId != null and request.standardId != ''">
and t.standard_id = #{request.standardId} and t.standard_id = #{request.standardId}
</if> </if>
...@@ -167,6 +172,9 @@ ...@@ -167,6 +172,9 @@
(request.inspectionItem = 'grfis' AND t.car_review_task_id IS NOT NULL) (request.inspectionItem = 'grfis' AND t.car_review_task_id IS NOT NULL)
) )
</if> </if>
<if test="request.taskStatus != null and request.taskStatus != ''">
and t.task_status = #{request.taskStatus}
</if>
</where> </where>
</select> </select>
......
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