Compare commits

..

No commits in common. 'ba66848cce7f62f79d579974c4819c1710c0bdce' and 'ab1732c5cfe515482d5543a6285fd18858dc1cfb' have entirely different histories.

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

@ -137,80 +137,9 @@ public class TaskController extends JeecgController<Task, ITaskService> {
} }
String managerUsers = e.getManagerUsers(); String managerUsers = e.getManagerUsers();
if (managerUsers!=null&&!managerUsers.equals("")) { if (managerUsers!=null&&!managerUsers.equals("")) {
String[] managerUsers1 = managerUsers.split(","); SysUser byId = iSysUserService.getById(managerUsers);
StringBuilder avatars = new StringBuilder();
for (String managerUser : managerUsers1) {
SysUser byId = iSysUserService.getById(managerUser);
if (byId!=null) if (byId!=null)
e.setHeadpic(byId.getAvatar());
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());
} }
}); });
@ -320,16 +249,9 @@ public class TaskController extends JeecgController<Task, ITaskService> {
} }
String managerUsers = task.getManagerUsers(); String managerUsers = task.getManagerUsers();
if (managerUsers!=null&&!managerUsers.equals("")) { if (managerUsers!=null&&!managerUsers.equals("")) {
String[] managerUsers1 = managerUsers.split(","); SysUser byId = iSysUserService.getById(managerUsers);
String avatars = "";
for (String managerUser : managerUsers1) {
SysUser byId = iSysUserService.getById(managerUser);
if (byId!=null) if (byId!=null)
task.setHeadpic(byId.getAvatar());
avatars += byId.getAvatar() + ",";
}
avatars = avatars.substring(0, avatars.length() - 1);
task.setHeadpic(avatars);
} }
return Result.OK(task); return Result.OK(task);
} }

Loading…
Cancel
Save