上海港湾 下级工资单根据层级结构展示
This commit is contained in:
parent
a8a0482221
commit
2fd1ef78f5
|
|
@ -6,6 +6,7 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -112,6 +113,11 @@ public class DataCollectionEmployee {
|
|||
//是否外部人员
|
||||
private boolean extEmp;
|
||||
|
||||
// 直接上级id
|
||||
private Long managerId;
|
||||
|
||||
private List<DataCollectionEmployee> children;
|
||||
|
||||
/**
|
||||
* 扩展数据
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -235,7 +235,8 @@
|
|||
e.subcompanyid1 as subcompanyid,
|
||||
e.departmentid as departmentId,
|
||||
d.DEPARTMENTNAME as departmentName,
|
||||
e.jobtitle as jobtitleId
|
||||
e.jobtitle as jobtitleId,
|
||||
e.managerid as managerid
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
where e.status not in (7)
|
||||
|
|
|
|||
|
|
@ -131,4 +131,6 @@ public interface SalaryEmployeeService {
|
|||
* @return
|
||||
*/
|
||||
List<DataCollectionEmployee> listByManagerId(Long managerId);
|
||||
|
||||
List<DataCollectionEmployee> listEmployeeTreeByManagerId(Long managerId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,4 +224,6 @@ public interface SalarySendService {
|
|||
* @return
|
||||
*/
|
||||
List<DataCollectionEmployee> listJunior(Long uid);
|
||||
|
||||
List<DataCollectionEmployee> listJuniorTree(Long uid);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -424,4 +424,18 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
List<DataCollectionEmployee> employeeList = employBiz.listByManagerId(managerId);
|
||||
return employeeList.stream().filter(emp -> Arrays.stream(emp.getManagerstr().split(",")).collect(Collectors.toList()).contains(managerId.toString())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataCollectionEmployee> listEmployeeTreeByManagerId(Long managerId) {
|
||||
List<DataCollectionEmployee> allEmployees = employBiz.listAll();
|
||||
List<DataCollectionEmployee> collect = allEmployees.stream().filter(employee -> employee.getEmployeeId().equals(managerId))
|
||||
.peek(employee -> employee.setChildren(getChildren(employee, allEmployees))).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
|
||||
List<DataCollectionEmployee> getChildren(DataCollectionEmployee root, List<DataCollectionEmployee> all) {
|
||||
return all.stream().filter(employee -> root.getEmployeeId().equals(employee.getManagerId())).peek(employee -> {
|
||||
employee.setChildren(getChildren(employee, all));
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1736,4 +1736,13 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).listByManagerId(managerId);
|
||||
return employees;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataCollectionEmployee> listJuniorTree(Long managerId) {
|
||||
if (ObjectUtils.isEmpty(managerId)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).listEmployeeTreeByManagerId(managerId);
|
||||
return employees;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryBill.dto.*;
|
||||
import com.engine.salary.entity.salaryBill.param.*;
|
||||
import com.engine.salary.enums.salarybill.SalarySendStatusEnum;
|
||||
|
|
@ -598,6 +599,14 @@ public class SalaryBillController {
|
|||
return new ResponseResult<Long, Map<Long, String>>(user).run(getSalarySendWrapper(user)::myJuniorMap, Long.valueOf(user.getUID()));
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/myJuniorTree")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String myJuniorTree(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, List<DataCollectionEmployee>>(user).run(getSalarySendWrapper(user)::myJuniorTree, Long.valueOf(user.getUID()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的工资单列表
|
||||
*
|
||||
|
|
|
|||
|
|
@ -725,4 +725,8 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
|
|||
List<DataCollectionEmployee> employeeList = getSalarySendService(user).listJunior(managerId);
|
||||
return SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername);
|
||||
}
|
||||
|
||||
public List<DataCollectionEmployee> myJuniorTree(Long managerId) {
|
||||
return getSalarySendService(user).listJuniorTree(managerId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue