|
|
@ -128,18 +128,89 @@ public class TaskController extends JeecgController<Task, ITaskService> { |
|
|
|
e.setUpperTaskName(taskUpper.getTaskName()); |
|
|
|
e.setUpperTaskName(taskUpper.getTaskName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (e.getTaskFile()!=null&& !e.getTaskFile().equals("")){ |
|
|
|
if (e.getTaskFile() != null && !e.getTaskFile().equals("")) { |
|
|
|
e.setContentType("file"); |
|
|
|
e.setContentType("file"); |
|
|
|
}else if(e.getTaskPic()!=null&& !e.getTaskPic().equals("")){ |
|
|
|
} else if (e.getTaskPic() != null && !e.getTaskPic().equals("")) { |
|
|
|
e.setContentType("image"); |
|
|
|
e.setContentType("image"); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
e.setContentType("text"); |
|
|
|
e.setContentType("text"); |
|
|
|
} |
|
|
|
} |
|
|
|
String managerUsers = e.getManagerUsers(); |
|
|
|
String managerUsers = e.getManagerUsers(); |
|
|
|
if (managerUsers!=null&&!managerUsers.equals("")) { |
|
|
|
if (managerUsers != null && !managerUsers.equals("")) { |
|
|
|
SysUser byId = iSysUserService.getById(managerUsers); |
|
|
|
String[] managerUsers1 = managerUsers.split(","); |
|
|
|
if (byId!=null) |
|
|
|
StringBuilder avatars = new StringBuilder(); |
|
|
|
e.setHeadpic(byId.getAvatar()); |
|
|
|
for (String managerUser : managerUsers1) { |
|
|
|
|
|
|
|
SysUser byId = iSysUserService.getById(managerUser); |
|
|
|
|
|
|
|
if (byId != null) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
avatars.append(byId.getAvatar()).append(","); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
avatars = new StringBuilder(avatars.substring(0, avatars.length() - 1)); |
|
|
|
|
|
|
|
e.setHeadpic(avatars.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AutoLog(value = "任务管理-分页列表查询") |
|
|
|
|
|
|
|
@ApiOperation(value = "任务管理-分页列表查询", notes = "任务管理-分页列表查询") |
|
|
|
|
|
|
|
@GetMapping(value = "/list1") |
|
|
|
|
|
|
|
public Result<?> queryPageList1(Task task, |
|
|
|
|
|
|
|
@RequestParam(name = "userId", defaultValue = "1") String userId, |
|
|
|
|
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
|
|
|
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
|
|
|
QueryWrapper<Task> queryWrapper = QueryGenerator.initQueryWrapper(task, req.getParameterMap()); |
|
|
|
|
|
|
|
Page<Task> page = new Page<Task>(pageNo, pageSize); |
|
|
|
|
|
|
|
queryWrapper.like("manager_users", userId); |
|
|
|
|
|
|
|
queryWrapper.like("work_status", 3); |
|
|
|
|
|
|
|
queryWrapper.orderByDesc("create_time"); |
|
|
|
|
|
|
|
IPage<Task> pageList = taskService.page(page, queryWrapper); |
|
|
|
|
|
|
|
pageList.getRecords().stream().forEach(e -> { |
|
|
|
|
|
|
|
String startDate = DateUtils.date2Str(e.getStartTime(), new SimpleDateFormat(FORMAT)); |
|
|
|
|
|
|
|
String endDate = DateUtils.date2Str(e.getExpectedEndTime(), new SimpleDateFormat(FORMAT)); |
|
|
|
|
|
|
|
String startEndTime = startDate + "-" + endDate; |
|
|
|
|
|
|
|
e.setStartEndTime(startEndTime); |
|
|
|
|
|
|
|
Projectx projectx = iProjectxService.getById(e.getProjectId()); |
|
|
|
|
|
|
|
e.setUnion(projectx.getProjectName()); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(e.getModuleId())) { |
|
|
|
|
|
|
|
Modulex modulex = iModulexService.getById(e.getModuleId()); |
|
|
|
|
|
|
|
e.setUnion(e.getUnion() + "-" + modulex.getModuleName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(e.getFunctionId())) { |
|
|
|
|
|
|
|
Functionx functionx = iFunctionxService.getById(e.getFunctionId()); |
|
|
|
|
|
|
|
e.setUnion(e.getUnion() + "-" + functionx.getFunctionName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(e.getRuleId())) { |
|
|
|
|
|
|
|
Rulex rulex = iRulexService.getById(e.getRuleId()); |
|
|
|
|
|
|
|
e.setUnion(e.getUnion() + "-" + rulex.getRuleCode()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(e.getUpperId())) { |
|
|
|
|
|
|
|
Task taskUpper = taskService.getById(e.getUpperId()); |
|
|
|
|
|
|
|
if (ObjectUtils.isNotEmpty(taskUpper)) { |
|
|
|
|
|
|
|
e.setUpperTaskName(taskUpper.getTaskName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (e.getTaskFile() != null && !e.getTaskFile().equals("")) { |
|
|
|
|
|
|
|
e.setContentType("file"); |
|
|
|
|
|
|
|
} else if (e.getTaskPic() != null && !e.getTaskPic().equals("")) { |
|
|
|
|
|
|
|
e.setContentType("image"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
e.setContentType("text"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String managerUsers = e.getManagerUsers(); |
|
|
|
|
|
|
|
if (managerUsers != null && !managerUsers.equals("")) { |
|
|
|
|
|
|
|
String[] managerUsers1 = managerUsers.split(","); |
|
|
|
|
|
|
|
StringBuilder avatars = new StringBuilder(); |
|
|
|
|
|
|
|
for (String managerUser : managerUsers1) { |
|
|
|
|
|
|
|
SysUser byId = iSysUserService.getById(managerUser); |
|
|
|
|
|
|
|
if (byId != null) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
avatars.append(byId.getAvatar()).append(","); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
avatars = new StringBuilder(avatars.substring(0, avatars.length() - 1)); |
|
|
|
|
|
|
|
e.setHeadpic(avatars.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
@ -240,18 +311,25 @@ public class TaskController extends JeecgController<Task, ITaskService> { |
|
|
|
task.setUpperTaskName(taskUpper.getTaskName()); |
|
|
|
task.setUpperTaskName(taskUpper.getTaskName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (task.getTaskFile()!=null&& !task.getTaskFile().equals("")){ |
|
|
|
if (task.getTaskFile() != null && !task.getTaskFile().equals("")) { |
|
|
|
task.setContentType("file"); |
|
|
|
task.setContentType("file"); |
|
|
|
}else if(task.getTaskPic()!=null&& !task.getTaskPic().equals("")){ |
|
|
|
} else if (task.getTaskPic() != null && !task.getTaskPic().equals("")) { |
|
|
|
task.setContentType("image"); |
|
|
|
task.setContentType("image"); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
task.setContentType("text"); |
|
|
|
task.setContentType("text"); |
|
|
|
} |
|
|
|
} |
|
|
|
String managerUsers = task.getManagerUsers(); |
|
|
|
String managerUsers = task.getManagerUsers(); |
|
|
|
if (managerUsers!=null&&!managerUsers.equals("")) { |
|
|
|
if (managerUsers != null && !managerUsers.equals("")) { |
|
|
|
SysUser byId = iSysUserService.getById(managerUsers); |
|
|
|
String[] managerUsers1 = managerUsers.split(","); |
|
|
|
if (byId!=null) |
|
|
|
String avatars = ""; |
|
|
|
task.setHeadpic(byId.getAvatar()); |
|
|
|
for (String managerUser : managerUsers1) { |
|
|
|
|
|
|
|
SysUser byId = iSysUserService.getById(managerUser); |
|
|
|
|
|
|
|
if (byId != null) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
avatars += byId.getAvatar() + ","; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
avatars = avatars.substring(0, avatars.length() - 1); |
|
|
|
|
|
|
|
task.setHeadpic(avatars); |
|
|
|
} |
|
|
|
} |
|
|
|
return Result.OK(task); |
|
|
|
return Result.OK(task); |
|
|
|
} |
|
|
|
} |
|
|
|