Compare commits

..

No commits in common. '0328d44c4377d1d2c55c83b1d1eb929860d7f132' and 'a94ad47825c6dc2fc7b42e910256406bd5fab8c8' have entirely different histories.

  1. 31
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java

@ -89,8 +89,7 @@ public class TaskController extends JeecgController<Task, ITaskService> {
@ApiOperation(value = "任务管理-分页列表查询", notes = "任务管理-分页列表查询") @ApiOperation(value = "任务管理-分页列表查询", notes = "任务管理-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<?> queryPageList(Task task, public Result<?> queryPageList(Task task,
@RequestParam(name = "type",required = false) List<String> type, @RequestParam(name = "userName",defaultValue = "") String userName,
@RequestParam(name = "userName", defaultValue = "") String userName,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
@ -101,27 +100,19 @@ public class TaskController extends JeecgController<Task, ITaskService> {
if (!StringUtils.equals(ADMIN, user.getUsername())) { if (!StringUtils.equals(ADMIN, user.getUsername())) {
queryWrapper.like("manager_users", user.getId()); 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<SysUser> sysUsers = taskService.UserIdByUserName(userName); List<SysUser> sysUsers = taskService.UserIdByUserName(userName);
if (sysUsers != null && sysUsers.size() > 0) if(sysUsers!=null&& sysUsers.size() > 0)
queryWrapper.and(qw -> { for (int i = 0; i < sysUsers.size(); i++) {
for (int i = 0; i < sysUsers.size(); i++) { queryWrapper.like("manager_users", sysUsers.get(i).getId());
qw.like("manager_users", sysUsers.get(i).getId()); if (i != sysUsers.size() - 1)
if (i != sysUsers.size() - 1) queryWrapper.or();
qw.or(); }
} if (task != null && StringUtils.isNotBlank(task.getTypeId())) {
}); queryWrapper.eq("type_id", task.getTypeId());
}
if (task != null && StringUtils.isNotBlank(task.getTaskName())) { if (task != null && StringUtils.isNotBlank(task.getTaskName())) {
String tas = task.getTaskName(); String tas = task.getTaskName();
if (tas.startsWith("*") && tas.endsWith("*")) if(tas.startsWith("*")&&tas.endsWith("*"))
tas = tas.substring(1, tas.length() - 1); tas = tas.substring(1, tas.length() - 1);
queryWrapper.like("task_name", tas); queryWrapper.like("task_name", tas);
} }

Loading…
Cancel
Save