任务模块 责任人下拉查询 根据 任务开始时间查询

dev_4newlayout
shiji 1 year ago
parent 024504c965
commit b8fe16f88e
  1. 6
      ant-design-vue-jeecg/src/views/task/TaskList.vue
  2. 37
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java

@ -42,9 +42,11 @@
<j-input placeholder="" v-model="queryParam.taskName"></j-input> <j-input placeholder="" v-model="queryParam.taskName"></j-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="12"> <a-col :md="4" :sm="12">
<a-form-item label="责任人"> <a-form-item label="责任人">
<j-input placeholder="" v-model="queryParam.userName"></j-input> <j-dict-select-tag v-model="queryParam.managerUsers" placeholder="请选责任人"
dict-code="sys_user,realname,id"
style="width: 100%"></j-dict-select-tag>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="12"> <a-col :md="6" :sm="12">

@ -119,8 +119,8 @@ public class TaskController extends JeecgController<Task, ITaskService> {
case 1: {//当前天 case 1: {//当前天
Date startTime = sdf.parse(year + "-" + month + "-" + day + " 00:00:00"); Date startTime = sdf.parse(year + "-" + month + "-" + day + " 00:00:00");
Date endTime = sdf.parse(year + "-" + month + "-" + day + " 23:59:59"); Date endTime = sdf.parse(year + "-" + month + "-" + day + " 23:59:59");
queryWrapper.ge("create_time", startTime); queryWrapper.ge("start_time", startTime);
queryWrapper.le("create_time", endTime); queryWrapper.le("start_time", endTime);
break; break;
} }
case 2: {//当前周 case 2: {//当前周
@ -135,16 +135,16 @@ public class TaskController extends JeecgController<Task, ITaskService> {
int day2 = now1.get(Calendar.DAY_OF_MONTH); int day2 = now1.get(Calendar.DAY_OF_MONTH);
Date startTime = sdf.parse(year1 + "-" + month1 + "-" + day1 + " 00:00:00"); Date startTime = sdf.parse(year1 + "-" + month1 + "-" + day1 + " 00:00:00");
Date endTime = sdf.parse(year2 + "-" + month2 + "-" + day2 + " 23:59:59"); Date endTime = sdf.parse(year2 + "-" + month2 + "-" + day2 + " 23:59:59");
queryWrapper.ge("create_time", startTime); queryWrapper.ge("start_time", startTime);
queryWrapper.le("create_time", endTime); queryWrapper.le("start_time", endTime);
} }
case 3: {//当前月 case 3: {//当前月
int minDay = now.getActualMinimum(Calendar.DAY_OF_MONTH); int minDay = now.getActualMinimum(Calendar.DAY_OF_MONTH);
int lastDay = now.getActualMaximum(Calendar.DAY_OF_MONTH); int lastDay = now.getActualMaximum(Calendar.DAY_OF_MONTH);
Date startTime = sdf.parse(year + "-" + month + "-" + minDay + " 00:00:00"); Date startTime = sdf.parse(year + "-" + month + "-" + minDay + " 00:00:00");
Date endTime = sdf.parse(year + "-" + month + "-" + lastDay + " 23:59:59"); Date endTime = sdf.parse(year + "-" + month + "-" + lastDay + " 23:59:59");
queryWrapper.ge("create_time", startTime); queryWrapper.ge("start_time", startTime);
queryWrapper.le("create_time", endTime); queryWrapper.le("start_time", endTime);
break; break;
} }
// case 4: { // case 4: {
@ -164,16 +164,23 @@ public class TaskController extends JeecgController<Task, ITaskService> {
String projectId = task.getProjectId(); String projectId = task.getProjectId();
queryWrapper.like("project_id", projectId); queryWrapper.like("project_id", projectId);
} }
if (task != null && StringUtils.isNotBlank(task.getTypeId())) {
List<SysUser> sysUsers = taskService.UserIdByUserName(userName); String typeId = task.getTypeId();
if (sysUsers != null && sysUsers.size() > 0) queryWrapper.like("type_id", typeId);
queryWrapper.and(qw -> {
for (int i = 0; i < sysUsers.size(); i++) {
qw.like("manager_users", sysUsers.get(i).getId());
if (i != sysUsers.size() - 1)
qw.or();
} }
});
if (task != null && StringUtils.isNotBlank(task.getManagerUsers())) {
String managerUsers = task.getManagerUsers();
queryWrapper.like("manager_users", managerUsers);
}
// List<SysUser> sysUsers = taskService.UserIdByUserName(userName);
// queryWrapper.and(qw -> {
// for (int i = 0; i < sysUsers.size(); i++) {
// qw.like("manager_users", sysUsers.get(i).getId());
// if (i != sysUsers.size() - 1)
// qw.or();
// }
// });
if (task != null && StringUtils.isNotBlank(task.getTaskName())) { if (task != null && StringUtils.isNotBlank(task.getTaskName())) {
String tas = task.getTaskName(); String tas = task.getTaskName();
if (tas.startsWith("*") && tas.endsWith("*")) if (tas.startsWith("*") && tas.endsWith("*"))

Loading…
Cancel
Save