|
|
@ -37,9 +37,11 @@ import org.springframework.web.servlet.ModelAndView; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.text.ParseException; |
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Optional; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @Description: 任务管理 |
|
|
|
* @Description: 任务管理 |
|
|
@ -89,10 +91,9 @@ public class TaskController extends JeecgController<Task, ITaskService> { |
|
|
|
public Result<?> queryPageList(Task task, |
|
|
|
public Result<?> queryPageList(Task task, |
|
|
|
@RequestParam(name = "type",required = false) List<String> type, |
|
|
|
@RequestParam(name = "type",required = false) List<String> type, |
|
|
|
@RequestParam(name = "userName", defaultValue = "") String userName, |
|
|
|
@RequestParam(name = "userName", defaultValue = "") String userName, |
|
|
|
@RequestParam(name = "time", required = false) Integer time, |
|
|
|
|
|
|
|
@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) throws ParseException { |
|
|
|
HttpServletRequest req) { |
|
|
|
QueryWrapper<Task> queryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<Task> queryWrapper = new QueryWrapper<>(); |
|
|
|
Page<Task> page = new Page<Task>(pageNo, pageSize); |
|
|
|
Page<Task> page = new Page<Task>(pageNo, pageSize); |
|
|
|
|
|
|
|
|
|
|
@ -108,62 +109,6 @@ public class TaskController extends JeecgController<Task, ITaskService> { |
|
|
|
qw.or(); |
|
|
|
qw.or(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
// projectId
|
|
|
|
|
|
|
|
Calendar now = Calendar.getInstance(); |
|
|
|
|
|
|
|
int year = now.get(Calendar.YEAR); |
|
|
|
|
|
|
|
int month = now.get(Calendar.MONTH) + 1; |
|
|
|
|
|
|
|
int day = now.get(Calendar.DAY_OF_MONTH); |
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
if (time != null) { |
|
|
|
|
|
|
|
switch (time) { |
|
|
|
|
|
|
|
case 1: {//当前天
|
|
|
|
|
|
|
|
Date startTime = sdf.parse(year + "-" + month + "-" + day + " 00:00:00"); |
|
|
|
|
|
|
|
Date endTime = sdf.parse(year + "-" + month + "-" + day + " 23:59:59"); |
|
|
|
|
|
|
|
queryWrapper.ge("create_time", startTime); |
|
|
|
|
|
|
|
queryWrapper.le("create_time", endTime); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case 2: {//当前周
|
|
|
|
|
|
|
|
Calendar now1 = Calendar.getInstance(); |
|
|
|
|
|
|
|
now1.set(Calendar.DAY_OF_WEEK, 2); |
|
|
|
|
|
|
|
int year1 = now1.get(Calendar.YEAR); |
|
|
|
|
|
|
|
int month1 = now1.get(Calendar.MONTH) + 1; |
|
|
|
|
|
|
|
int day1 = now1.get(Calendar.DAY_OF_MONTH); |
|
|
|
|
|
|
|
now1.set(Calendar.DATE, now1.get(Calendar.DATE) + 6); |
|
|
|
|
|
|
|
int year2 = now1.get(Calendar.YEAR); |
|
|
|
|
|
|
|
int month2 = now1.get(Calendar.MONTH) + 1; |
|
|
|
|
|
|
|
int day2 = now1.get(Calendar.DAY_OF_MONTH); |
|
|
|
|
|
|
|
Date startTime = sdf.parse(year1 + "-" + month1 + "-" + day1 + " 00:00:00"); |
|
|
|
|
|
|
|
Date endTime = sdf.parse(year2 + "-" + month2 + "-" + day2 + " 23:59:59"); |
|
|
|
|
|
|
|
queryWrapper.ge("create_time", startTime); |
|
|
|
|
|
|
|
queryWrapper.le("create_time", endTime); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case 3: {//当前月
|
|
|
|
|
|
|
|
int minDay = now.getActualMinimum(Calendar.DAY_OF_MONTH); |
|
|
|
|
|
|
|
int lastDay = now.getActualMaximum(Calendar.DAY_OF_MONTH); |
|
|
|
|
|
|
|
Date startTime = sdf.parse(year + "-" + month + "-" + minDay + " 00:00:00"); |
|
|
|
|
|
|
|
Date endTime = sdf.parse(year + "-" + month + "-" + lastDay + " 23:59:59"); |
|
|
|
|
|
|
|
queryWrapper.ge("create_time", startTime); |
|
|
|
|
|
|
|
queryWrapper.le("create_time", endTime); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// case 4: {
|
|
|
|
|
|
|
|
// Date startTime = sdf.parse(year + "-" + month + "-" + day + " 00:00:00");
|
|
|
|
|
|
|
|
// Date endTime = sdf.parse(year + "-" + month + "-" + day + " 23:59:59");
|
|
|
|
|
|
|
|
// queryWrapper.ge("create_time", startTime);
|
|
|
|
|
|
|
|
// queryWrapper.le("create_time", endTime);
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (task != null && StringUtils.isNotBlank(task.getModuleId())) { |
|
|
|
|
|
|
|
String moduleId = task.getModuleId(); |
|
|
|
|
|
|
|
queryWrapper.like("module_id", moduleId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (task != null && StringUtils.isNotBlank(task.getProjectId())) { |
|
|
|
|
|
|
|
String projectId = task.getProjectId(); |
|
|
|
|
|
|
|
queryWrapper.like("project_id", projectId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SysUser> sysUsers = taskService.UserIdByUserName(userName); |
|
|
|
List<SysUser> sysUsers = taskService.UserIdByUserName(userName); |
|
|
|
if (sysUsers != null && sysUsers.size() > 0) |
|
|
|
if (sysUsers != null && sysUsers.size() > 0) |
|
|
@ -182,7 +127,8 @@ public class TaskController extends JeecgController<Task, ITaskService> { |
|
|
|
} |
|
|
|
} |
|
|
|
if (task != null && task.getWorkStatus() != null && (task.getWorkStatus() == 0 || task.getWorkStatus() == 1)) { |
|
|
|
if (task != null && task.getWorkStatus() != null && (task.getWorkStatus() == 0 || task.getWorkStatus() == 1)) { |
|
|
|
queryWrapper.in("work_status", 0, 1); |
|
|
|
queryWrapper.in("work_status", 0, 1); |
|
|
|
} else if (task != null && task.getWorkStatus() != null && (task.getWorkStatus() == 2 || task.getWorkStatus() == 9)) { |
|
|
|
} |
|
|
|
|
|
|
|
else if (task != null && task.getWorkStatus() != null && (task.getWorkStatus() == 2 || task.getWorkStatus() == 9)) { |
|
|
|
queryWrapper.in("work_status", 2, 9); |
|
|
|
queryWrapper.in("work_status", 2, 9); |
|
|
|
} else if (task != null && task.getWorkStatus() != null){ |
|
|
|
} else if (task != null && task.getWorkStatus() != null){ |
|
|
|
queryWrapper.eq("work_status", task.getWorkStatus()); |
|
|
|
queryWrapper.eq("work_status", task.getWorkStatus()); |
|
|
|