| | |
| | | } |
| | | } |
| | | // 超级管理员 查询所有任务列表 |
| | | List<TTask> taskList = new ArrayList<>(); |
| | | List<TTask> taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | .in(TTask::getPatrolInspector, userId)); |
| | | if(CollectionUtils.isEmpty(query.getProjectId())){ |
| | | // 查询点位类型 |
| | | if(StringUtils.isNotEmpty(query.getLocationTypeId())){ |
| | | // 查询点位 |
| | | List<TLocation> locationList = locationService.list(Wrappers.lambdaQuery(TLocation.class) |
| | | .in(TLocation::getLocationType, query.getLocationTypeId())); |
| | | if(!CollectionUtils.isEmpty(locationList)){ |
| | | List<String> locationIds = locationList.stream().map(TLocation::getId).collect(Collectors.toList()); |
| | | taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | .in(TTask::getLocationId, locationIds) |
| | | .between(TTask::getImplementTime, startTime, endTime)); |
| | | } |
| | | } |
| | | // if(StringUtils.isNotEmpty(query.getLocationTypeId())){ |
| | | // // 查询点位 |
| | | // List<TLocation> locationList = locationService.list(Wrappers.lambdaQuery(TLocation.class) |
| | | // .in(TLocation::getLocationType, query.getLocationTypeId())); |
| | | // if(!CollectionUtils.isEmpty(locationList)){ |
| | | // List<String> locationIds = locationList.stream().map(TLocation::getId).collect(Collectors.toList()); |
| | | // taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | // .in(TTask::getLocationId, locationIds) |
| | | // .between(TTask::getImplementTime, startTime, endTime)); |
| | | // } |
| | | // } |
| | | // 查询所有项目部的任务列表 |
| | | List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class) |
| | | .eq(TProjectDept::getStatus, 1)); |
| | |
| | | } |
| | | } |
| | | // 超级管理员 查询所有的任务列表 |
| | | List<TTask> taskList = new ArrayList<>(); |
| | | List<TTask> taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | .in(TTask::getPatrolInspector, userId)); |
| | | if(CollectionUtils.isEmpty(query.getProjectId())){ |
| | | // 查询点位类型 |
| | | if(StringUtils.isNotEmpty(query.getLocationTypeId())){ |
| | | // 查询点位 |
| | | List<TLocation> locationList = locationService.list(Wrappers.lambdaQuery(TLocation.class) |
| | | .in(TLocation::getLocationType, query.getLocationTypeId())); |
| | | if(!CollectionUtils.isEmpty(locationList)){ |
| | | List<String> locationIds = locationList.stream().map(TLocation::getId).collect(Collectors.toList()); |
| | | taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | .in(TTask::getLocationId, locationIds)); |
| | | } |
| | | } |
| | | // // 查询点位类型 |
| | | // if(StringUtils.isEmpty(query.getLocationTypeId())){ |
| | | // // 查询点位 |
| | | // List<TLocation> locationList = locationService.list(Wrappers.lambdaQuery(TLocation.class) |
| | | // .in(TLocation::getLocationType, query.getLocationTypeId())); |
| | | // if(!CollectionUtils.isEmpty(locationList)){ |
| | | // List<String> locationIds = locationList.stream().map(TLocation::getId).collect(Collectors.toList()); |
| | | // taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | // .in(TTask::getLocationId, locationIds)); |
| | | // } |
| | | // } |
| | | // 查询所有项目部的任务列表 |
| | | List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class) |
| | | .eq(TProjectDept::getStatus, 1)); |
| | |
| | | } |
| | | } |
| | | // 超级管理员 查询所有的任务列表 |
| | | List<TTask> taskList = new ArrayList<>(); |
| | | List<TTask> taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | .in(TTask::getPatrolInspector, userId)); |
| | | if(CollectionUtils.isEmpty(query.getProjectId())){ |
| | | // 查询点位类型 |
| | | if(StringUtils.isNotEmpty(query.getLocationTypeId())){ |
| | | // 查询点位 |
| | | List<TLocation> locationList = locationService.list(Wrappers.lambdaQuery(TLocation.class) |
| | | .in(TLocation::getLocationType, query.getLocationTypeId())); |
| | | if(!CollectionUtils.isEmpty(locationList)){ |
| | | List<String> locationIds = locationList.stream().map(TLocation::getId).collect(Collectors.toList()); |
| | | taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | .in(TTask::getLocationId, locationIds)); |
| | | } |
| | | } |
| | | // if(StringUtils.isNotEmpty(query.getLocationTypeId())){ |
| | | // // 查询点位 |
| | | // List<TLocation> locationList = locationService.list(Wrappers.lambdaQuery(TLocation.class) |
| | | // .in(TLocation::getLocationType, query.getLocationTypeId())); |
| | | // if(!CollectionUtils.isEmpty(locationList)){ |
| | | // List<String> locationIds = locationList.stream().map(TLocation::getId).collect(Collectors.toList()); |
| | | // taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | // .in(TTask::getLocationId, locationIds)); |
| | | // } |
| | | // } |
| | | // 查询所有项目部的任务列表 |
| | | List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class) |
| | | .eq(TProjectDept::getStatus, 1)); |
| | |
| | | sysUsers = sysUserService.selectListByDeptId(deptId); |
| | | } |
| | | // 超级管理员 查询所有的任务列表 |
| | | List<TTask> taskList = new ArrayList<>(); |
| | | List<TTask> taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | .in(TTask::getPatrolInspector, userId)); |
| | | if(CollectionUtils.isEmpty(query.getProjectId())){ |
| | | // 查询点位类型 |
| | | if(StringUtils.isNotEmpty(query.getLocationTypeId())){ |
| | | // 查询点位 |
| | | List<TLocation> locationList = locationService.list(Wrappers.lambdaQuery(TLocation.class) |
| | | .in(TLocation::getLocationType, query.getLocationTypeId())); |
| | | if(!CollectionUtils.isEmpty(locationList)){ |
| | | List<String> locationIds = locationList.stream().map(TLocation::getId).collect(Collectors.toList()); |
| | | taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | .in(TTask::getLocationId, locationIds) |
| | | .between(TTask::getImplementTime, startTime, endTime)); |
| | | } |
| | | } |
| | | // if(StringUtils.isNotEmpty(query.getLocationTypeId())){ |
| | | // // 查询点位 |
| | | // List<TLocation> locationList = locationService.list(Wrappers.lambdaQuery(TLocation.class) |
| | | // .in(TLocation::getLocationType, query.getLocationTypeId())); |
| | | // if(!CollectionUtils.isEmpty(locationList)){ |
| | | // List<String> locationIds = locationList.stream().map(TLocation::getId).collect(Collectors.toList()); |
| | | // taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | // .in(TTask::getLocationId, locationIds) |
| | | // .between(TTask::getImplementTime, startTime, endTime)); |
| | | // } |
| | | // } |
| | | // 查询所有项目部的任务列表 |
| | | List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class) |
| | | .eq(TProjectDept::getStatus, 1) |
| | |
| | | map.put("totalLocationNum", locationList.size()); |
| | | } |
| | | // 超级管理员 查询所有的任务列表 |
| | | List<TTask> taskList = new ArrayList<>(); |
| | | List<TTask> taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | .in(TTask::getPatrolInspector, userId)); |
| | | if(CollectionUtils.isEmpty(query.getProjectId())){ |
| | | // 查询点位类型 |
| | | if(StringUtils.isNotEmpty(query.getLocationTypeId())){ |
| | | // 查询点位 |
| | | List<TLocation> locationList = locationService.list(Wrappers.lambdaQuery(TLocation.class) |
| | | .in(TLocation::getLocationType, query.getLocationTypeId())); |
| | | if(!CollectionUtils.isEmpty(locationList)){ |
| | | List<String> locationIds = locationList.stream().map(TLocation::getId).collect(Collectors.toList()); |
| | | taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | .in(TTask::getLocationId, locationIds) |
| | | .between(TTask::getImplementTime, startTime, endTime)); |
| | | } |
| | | } |
| | | // if(StringUtils.isNotEmpty(query.getLocationTypeId())){ |
| | | // // 查询点位 |
| | | // List<TLocation> locationList = locationService.list(Wrappers.lambdaQuery(TLocation.class) |
| | | // .in(TLocation::getLocationType, query.getLocationTypeId())); |
| | | // if(!CollectionUtils.isEmpty(locationList)){ |
| | | // List<String> locationIds = locationList.stream().map(TLocation::getId).collect(Collectors.toList()); |
| | | // taskList = taskCleanService.list(Wrappers.lambdaQuery(TTask.class) |
| | | // .in(TTask::getLocationId, locationIds) |
| | | // .between(TTask::getImplementTime, startTime, endTime)); |
| | | // } |
| | | // } |
| | | // 查询所有项目部的任务列表 |
| | | List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class) |
| | | .eq(TProjectDept::getStatus, 1)); |
| | |
| | | .in(TTask::getLocationId, locationIds)); |
| | | |
| | | // 查询片区负责人 |
| | | // List<SysUser> users = sysUserService.selectUserByNickName("片区负责人"); |
| | | List<SysUser> users = sysUserService.selectUserByNickName("片区负责人"); |
| | | |
| | | for (TLocation tLocation : locationList) { |
| | | // if(!CollectionUtils.isEmpty(users)){ |
| | | // |
| | | // } |
| | | long count = tasks.stream().filter(task -> task.getLocationId().equals(tLocation.getId())).count(); |
| | | tLocation.setTaskNum(count); |
| | | if(!CollectionUtils.isEmpty(users)){ |
| | | List<Long> userIds = users.stream().map(SysUser::getUserId).collect(Collectors.toList()); |
| | | List<TTask> taskList = taskCleanService.lambdaQuery().notIn(TTask::getPatrolInspector, userIds).list(); |
| | | if(!CollectionUtils.isEmpty(taskList)){ |
| | | List<String> collect = taskList.stream().map(TTask::getId).collect(Collectors.toList()); |
| | | long count = taskList.stream().filter(task -> task.getLocationId().equals(tLocation.getId()) |
| | | && collect.contains(task.getId())).count(); |
| | | tLocation.setTaskNum(count); |
| | | }else { |
| | | long count = tasks.stream().filter(task -> task.getLocationId().equals(tLocation.getId())).count(); |
| | | tLocation.setTaskNum(count); |
| | | } |
| | | }else { |
| | | long count = tasks.stream().filter(task -> task.getLocationId().equals(tLocation.getId())).count(); |
| | | tLocation.setTaskNum(count); |
| | | } |
| | | } |
| | | return R.ok(locationList); |
| | | } |