xuhy
2025-07-03 9364cf6824389a3264dc2cdb2bc3b5857ce76ad5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/TaskUtil.java
@@ -171,10 +171,10 @@
            List<String> proIds = projectDepts.stream().map(TProjectDept::getId).collect(Collectors.toList());
            // 拿到抽取的项目部下的所有保洁员
            List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class)
                    .in(TProjectDept::getId, proIds));
//            List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class)
//                    .in(TProjectDept::getId, proIds));
            // 获取片区id
            List<String> areaIds = tProjectDeptList.stream().map(TProjectDept::getId).collect(Collectors.toList());
            List<String> areaIds = projectDepts.stream().map(TProjectDept::getId).collect(Collectors.toList());
            if(CollectionUtils.isEmpty(areaIds)){
                return;
            }
@@ -184,7 +184,7 @@
                    .in(TCleaner::getProjectId, areaIds));
            int cleanerSums = num1 * Integer.parseInt(count + "");
            // 获取每天需要抽取的保洁员数,向上取整
            if (cleanerSums <cycle){
            if (cleanerSums < cycle){
                cleanerSums = cycle;
            }
            int dayCleanerCount = cleanerSums / cycle;
@@ -297,7 +297,7 @@
            templateCount.setTemplateId(detail.getId());
            templateCount.setTaskCount(tLocationList.size()* cycle);
            templateCount.setUserId(sysUser.getUserId());
            templateCountService.saveOrUpdate(templateCount);
            templateCountService.save(templateCount);
            taskCleanService.saveBatch(tasks);
            template.setTaskCount(tasks.size());