Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Task group queue query all list error #10237

Merged
merged 2 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,21 @@ public Result modifyPriority(@ApiIgnore @RequestAttribute(value = Constants.SESS
/**
* query task group queue list paging
*
* @param loginUser login user
* @param pageNo page number
* @param pageSize page size
* @param groupId ID for task group
* @param taskName Task Name
* @param processName Process instance name
* @param status Task queue status
* @param loginUser login user
* @param pageNo page number
* @param pageSize page size
* @return queue list
*/
@ApiOperation(value = "queryTasksByGroupId", notes = "QUERY_ALL_TASKS_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "groupId", value = "GROUP_ID", required = true, dataType = "Int", example = "1"),
@ApiImplicitParam(name = "groupId", value = "GROUP_ID", required = false, dataType = "Int", example = "1", defaultValue = "-1"),
@ApiImplicitParam(name = "taskInstanceName", value = "TASK_INSTANCE_NAME", required = false, dataType = "String", example = "taskName"),
@ApiImplicitParam(name = "processInstanceName", value = "PROCESS_INSTANCE_NAME", required = false, dataType = "String", example = "processName"),
@ApiImplicitParam(name = "status", value = "STATUS", required = false, dataType = "Int", example = "1"),
@ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataType = "Int", example = "1"),
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20")
})
Expand All @@ -313,7 +320,7 @@ public Result modifyPriority(@ApiIgnore @RequestAttribute(value = Constants.SESS
@ApiException(QUERY_TASK_GROUP_QUEUE_LIST_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryTasksByGroupId(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("groupId") Integer groupId,
@RequestParam(value = "groupId", required = false, defaultValue = "-1") Integer groupId,
@RequestParam(value = "taskInstanceName",required = false) String taskName,
@RequestParam(value = "processInstanceName",required = false) String processName,
@RequestParam(value = "status",required = false) Integer status,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ public interface TaskGroupQueueService {

/**
* query tasks in task group queue by group id
* @param loginUser login user
* @param groupId group id
* @param pageNo page no
* @param pageSize page size
* @param loginUser login user
* @param groupId group id
* @param taskName Task Name
* @param processName Process instance name
* @param status Task queue status
* @param pageNo page no
* @param pageSize page size

* @return tasks list
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,26 @@
left join t_ds_process_definition p_f on process.process_definition_code = p_f.code
and process.process_definition_version = p_f.version
join t_ds_project as p on p_f.project_code = p.code
where queue.group_id = #{groupId}
<if test="taskName != null and taskName != ''">
and task_name like concat('%', #{taskName}, '%')
</if>
<if test="processName != null and processName != ''">
and process.name like concat('%', #{processName}, '%')
</if>
<if test="status != null">
and queue.status =#{status}
</if>
<if test="projects != null and projects.size() > 0">
and p.code in
<foreach collection="projects" index="index" item="i" open="(" separator="," close=")">
#{i.code}
</foreach>
</if>
<where>
<if test="groupId != null and groupId != -1">
queue.group_id = #{groupId}
</if>
<if test="taskName != null and taskName != ''">
and task_name like concat('%', #{taskName}, '%')
</if>
<if test="processName != null and processName != ''">
and process.name like concat('%', #{processName}, '%')
</if>
<if test="status != null">
and queue.status =#{status}
</if>
<if test="projects != null and projects.size() > 0">
and p.code in
<foreach collection="projects" index="index" item="i" open="(" separator="," close=")">
#{i.code}
</foreach>
</if>
</where>
order by queue.update_time desc
</select>

Expand Down