Compare commits

..

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

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

@ -128,89 +128,18 @@ public class TaskController extends JeecgController<Task, ITaskService> {
e.setUpperTaskName(taskUpper.getTaskName());
}
}
if (e.getTaskFile() != null && !e.getTaskFile().equals("")) {
if (e.getTaskFile()!=null&& !e.getTaskFile().equals("")){
e.setContentType("file");
} else if (e.getTaskPic() != null && !e.getTaskPic().equals("")) {
}else if(e.getTaskPic()!=null&& !e.getTaskPic().equals("")){
e.setContentType("image");
} else {
}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());
}
});
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());
if (managerUsers!=null&&!managerUsers.equals("")) {
SysUser byId = iSysUserService.getById(managerUsers);
if (byId!=null)
e.setHeadpic(byId.getAvatar());
}
});
@ -311,25 +240,18 @@ public class TaskController extends JeecgController<Task, ITaskService> {
task.setUpperTaskName(taskUpper.getTaskName());
}
}
if (task.getTaskFile() != null && !task.getTaskFile().equals("")) {
if (task.getTaskFile()!=null&& !task.getTaskFile().equals("")){
task.setContentType("file");
} else if (task.getTaskPic() != null && !task.getTaskPic().equals("")) {
}else if(task.getTaskPic()!=null&& !task.getTaskPic().equals("")){
task.setContentType("image");
} else {
}else{
task.setContentType("text");
}
String managerUsers = task.getManagerUsers();
if (managerUsers != null && !managerUsers.equals("")) {
String[] managerUsers1 = managerUsers.split(",");
String avatars = "";
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);
if (managerUsers!=null&&!managerUsers.equals("")) {
SysUser byId = iSysUserService.getById(managerUsers);
if (byId!=null)
task.setHeadpic(byId.getAvatar());
}
return Result.OK(task);
}

Loading…
Cancel
Save