|
@@ -4128,6 +4128,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
if(checkStatus!=null&&checkStatus==0&&StringUtils.isEmpty(userId)){
|
|
if(checkStatus!=null&&checkStatus==0&&StringUtils.isEmpty(userId)){
|
|
userId=user.getId();
|
|
userId=user.getId();
|
|
}
|
|
}
|
|
|
|
+ boolean canViewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部人员工时工价");
|
|
|
|
+ List<Department> allDeptList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, user.getCompanyId()));
|
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()).eq("manager_id", user.getId()));
|
|
|
|
+ List<DepartmentOtherManager> departmentOtherManagers = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("company_id", user.getCompanyId()).eq("other_manager_id", user.getId()));
|
|
|
|
+ List<Integer> deptIds = departmentList.stream().map(Department::getDepartmentId).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherDeptIds = departmentOtherManagers.stream().map(DepartmentOtherManager::getDepartmentId).distinct().collect(Collectors.toList());
|
|
|
|
+ deptIds.addAll(otherDeptIds);
|
|
List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetail(date,userId,user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
|
|
List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetail(date,userId,user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
|
|
HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
HashMap map=new HashMap();
|
|
HashMap map=new HashMap();
|
|
@@ -4135,6 +4142,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
map.put("totalWorkingTime",mapList.stream().mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("working_time")))).sum());
|
|
map.put("totalWorkingTime",mapList.stream().mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("working_time")))).sum());
|
|
map.put("totalCost",mapList.stream().mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("cost")))).sum());
|
|
map.put("totalCost",mapList.stream().mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("cost")))).sum());
|
|
if(checkStatus!=null && detailStatus==null){
|
|
if(checkStatus!=null && detailStatus==null){
|
|
|
|
+ mapList=reportMapper.getPersonWorkHoursWagesDetail(date,user.getId(),user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
|
|
DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
DateTimeFormatter dtf1=DateTimeFormatter.ofPattern("yyyyMMdd");
|
|
DateTimeFormatter dtf1=DateTimeFormatter.ofPattern("yyyyMMdd");
|
|
List<LocalDate> allDateList = getDays(LocalDate.parse(startDate, dtf), LocalDate.parse(endDate, dtf));
|
|
List<LocalDate> allDateList = getDays(LocalDate.parse(startDate, dtf), LocalDate.parse(endDate, dtf));
|
|
@@ -4150,13 +4158,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
Map<Object, List<Map<String, Object>>> listMap = mapList.stream().collect(Collectors.groupingBy(m -> m.get("createDate")));
|
|
Map<Object, List<Map<String, Object>>> listMap = mapList.stream().collect(Collectors.groupingBy(m -> m.get("createDate")));
|
|
List<Map<String,Object>> resultList=new ArrayList<>();
|
|
List<Map<String,Object>> resultList=new ArrayList<>();
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
|
|
- List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()).eq("manager_id", user.getId()));
|
|
|
|
- List<DepartmentOtherManager> departmentOtherManagers = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("company_id", user.getCompanyId()).eq("other_manager_id", user.getId()));
|
|
|
|
- List<Integer> deptIds = departmentList.stream().map(Department::getDepartmentId).distinct().collect(Collectors.toList());
|
|
|
|
- List<Integer> otherDeptIds = departmentOtherManagers.stream().map(DepartmentOtherManager::getDepartmentId).distinct().collect(Collectors.toList());
|
|
|
|
- deptIds.addAll(otherDeptIds);
|
|
|
|
List<Integer> targetDeptIds = deptIds.stream().distinct().collect(Collectors.toList());
|
|
List<Integer> targetDeptIds = deptIds.stream().distinct().collect(Collectors.toList());
|
|
- boolean canViewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部人员工时工价");
|
|
|
|
for (String s : stringList) {
|
|
for (String s : stringList) {
|
|
Map<String,Object> item=new HashMap();
|
|
Map<String,Object> item=new HashMap();
|
|
List<Map<String, Object>> list = listMap.get(s);
|
|
List<Map<String, Object>> list = listMap.get(s);
|
|
@@ -4219,6 +4221,18 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
return httpRespMsg;
|
|
return httpRespMsg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private List<Integer> getBranchDepartment(Integer departmentId, List<Department> departmentList) {
|
|
|
|
+ List<Integer> list = new ArrayList<>();
|
|
|
|
+ list.add(departmentId);
|
|
|
|
+ //搜到子部门进行添加
|
|
|
|
+ for (Department department : departmentList) {
|
|
|
|
+ if (departmentId.equals(department.getSuperiorId())) {
|
|
|
|
+ list.addAll(getBranchDepartment(department.getDepartmentId(), departmentList));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg exportPersonWorkHoursWorkTime(String deptId, String userId, String startDate, String endDate) {
|
|
public HttpRespMsg exportPersonWorkHoursWorkTime(String deptId, String userId, String startDate, String endDate) {
|
|
HttpRespMsg respMsg = getPersonWorkHoursWagesList(deptId, userId, startDate, endDate, -1, -1);
|
|
HttpRespMsg respMsg = getPersonWorkHoursWagesList(deptId, userId, startDate, endDate, -1, -1);
|