From d8d8c8ace7fe371cc4978bab346c9a6e5350fa3d Mon Sep 17 00:00:00 2001 From: shiji <1913712590@qq.com> Date: Mon, 17 Jul 2023 11:22:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=A8=A1=E5=9D=97=20?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BB=BB=E5=8A=A1=E7=B1=BB=E5=9E=8B=EF=BC=8C?= =?UTF-8?q?=E4=BA=BA=E5=90=8D=EF=BC=8C=E4=BB=BB=E5=8A=A1=E5=90=8D=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task/controller/TaskController.java | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java index c7f3431..97cd107 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java @@ -89,7 +89,8 @@ public class TaskController extends JeecgController { @ApiOperation(value = "任务管理-分页列表查询", notes = "任务管理-分页列表查询") @GetMapping(value = "/list") public Result queryPageList(Task task, - @RequestParam(name = "userName",defaultValue = "") String userName, + @RequestParam(name = "type",required = false) List type, + @RequestParam(name = "userName", defaultValue = "") String userName, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { @@ -100,19 +101,27 @@ public class TaskController extends JeecgController { if (!StringUtils.equals(ADMIN, user.getUsername())) { queryWrapper.like("manager_users", user.getId()); } + if (type != null && type.size() > 0) + queryWrapper.and(qw -> { + for (int i = 0; i < type.size(); i++) { + qw.eq("type_id", type.get(i)); + if (i != type.size() - 1) + qw.or(); + } + }); + List sysUsers = taskService.UserIdByUserName(userName); - if(sysUsers!=null&& sysUsers.size() > 0) - for (int i = 0; i < sysUsers.size(); i++) { - queryWrapper.like("manager_users", sysUsers.get(i).getId()); - if (i != sysUsers.size() - 1) - queryWrapper.or(); - } - if (task != null && StringUtils.isNotBlank(task.getTypeId())) { - queryWrapper.eq("type_id", task.getTypeId()); - } + if (sysUsers != null && sysUsers.size() > 0) + queryWrapper.and(qw -> { + for (int i = 0; i < sysUsers.size(); i++) { + qw.like("manager_users", sysUsers.get(i).getId()); + if (i != sysUsers.size() - 1) + qw.or(); + } + }); if (task != null && StringUtils.isNotBlank(task.getTaskName())) { String tas = task.getTaskName(); - if(tas.startsWith("*")&&tas.endsWith("*")) + if (tas.startsWith("*") && tas.endsWith("*")) tas = tas.substring(1, tas.length() - 1); queryWrapper.like("task_name", tas); }