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