yusm 4 semanas atrás
pai
commit
8b335e0038

+ 13 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -110,6 +110,9 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
         List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
         deptId = deptId == null ? -1 : deptId;
         List<Integer> deptIds = departmentService.getDeptIncludeSubDeptIds(deptId, allDeptList);
+        if (deptId == -1) {
+            deptIds=null;
+        }
         List<Finance> financeList = financeMapper.selectListByDept(companyId, yearMonth,deptIds);
         TimeType timeType = timeTypeMapper.selectById(companyId);
         //当前月是否有项目日报数据
@@ -787,6 +790,9 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
             deptId = deptId == null ? -1 : deptId;
             List<Integer> deptIds = departmentService.getDeptIncludeSubDeptIds(deptId, allDeptList);
+            if (deptId == -1) {
+                deptIds=null;
+            }
             List<Map<String, Object>> projectTimeList = reportMapper.getRealProjectTimeNew(yearMonth,startDate, endDate, companyId,deptIds);
             //如果定义了可分摊项目的过滤,按照数据处理一下
             CostProjectSetting setting = costProjectSettingMapper.selectOne(new QueryWrapper<CostProjectSetting>().eq("company_id", companyId));
@@ -2019,6 +2025,9 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
             deptId = deptId == null ? -1 : deptId;
             List<Integer> deptIds = departmentService.getDeptIncludeSubDeptIds(deptId, allDeptList);
+            if (deptId == -1) {
+                deptIds=null;
+            }
             List<Map<String, Object>> projectTimeList = reportMapper.getRealProjectTimeNew(yearMonth,startDate, endDate, companyId,deptIds);
             //如果定义了可分摊项目的过滤,按照数据处理一下
             CostProjectSetting setting = costProjectSettingMapper.selectOne(new QueryWrapper<CostProjectSetting>().eq("company_id", companyId));
@@ -2232,7 +2241,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             resultMap.put("noProjectItem", noProjectItem);
             resultMap.put("totalMoneyCost", totalMoneyCost);
             if (missingFinanceUserIds.size() > 0) {
-                List<Map<String, Object>> userList = userMapper.getSimpleNameList(new QueryWrapper<User>().in("id", missingFinanceUserIds).eq("department_id",deptId));
+                List<Map<String, Object>> userList = userMapper.getSimpleNameList(new QueryWrapper<User>().in("id", missingFinanceUserIds).in(deptId!=-1,"department_id",deptIds));
                 resultMap.put("missingFinanceUserList", userList);
             } else {
                 resultMap.put("missingFinanceUserList", new ArrayList<>());
@@ -2357,6 +2366,9 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
             deptId = deptId == null ? -1 : deptId;
             List<Integer> deptIds = departmentService.getDeptIncludeSubDeptIds(deptId, allDeptList);
+            if (deptId==-1){
+                deptIds=null;
+            }
             List<Finance> finances = financeMapper.selectListByDept(companyId, yearMonth,deptIds);
             for (Finance f : finances) {
                 User user = userList.stream().filter(ul -> ul.getId().equals(f.getUserId())).findFirst().get();