Compare commits

...

2 Commits

  1. 7
      ant-design-vue-jeecg/src/views/task/TaskList.vue
  2. 68
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java
  3. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/entity/Task.java

@ -47,6 +47,13 @@
<j-input placeholder="" v-model="queryParam.userName"></j-input> <j-input placeholder="" v-model="queryParam.userName"></j-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="12">
<a-form-item label="日期">
<j-dict-select-tag v-model="queryParam.time" placeholder="请选择日期"
dict-code="time_status"
style="width: 100%"></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">

@ -37,11 +37,9 @@ 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.Arrays; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Optional;
/** /**
* @Description: 任务管理 * @Description: 任务管理
@ -91,9 +89,10 @@ 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) { HttpServletRequest req) throws ParseException {
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);
@ -109,6 +108,62 @@ 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)
@ -127,8 +182,7 @@ 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());

@ -97,6 +97,7 @@ public class Task implements Serializable {
*/ */
@Excel(name = "模块id", width = 15) @Excel(name = "模块id", width = 15)
@ApiModelProperty(value = "模块id") @ApiModelProperty(value = "模块id")
@Dict(dictTable = "modulex", dicText = "module_name",dicCode = "id")
private java.lang.String moduleId; private java.lang.String moduleId;
/** /**
* 功能id * 功能id

Loading…
Cancel
Save