指派AB角BUG修改

master
shijie 4 years ago
parent 4e0f44fdbf
commit d4ef18f4a1
  1. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  2. 4
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java
  3. 2
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java
  4. 4
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java
  5. 16
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java
  6. 3
      dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml

@ -171,8 +171,7 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
public ResponseResult businessApplicationList(@RequestParam(value="page",required=false) Integer page,@RequestParam(value="size",required=false) Integer size,
@RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName){
//获取当前登录用户id
//String userId = getUserId();
String userId ="9";
String userId = getUserId();
//根据角色查询资产部调查列表
String roleIds = RedisUtil.get("dq:userRole:" + userId);

@ -102,8 +102,8 @@ public class DeptController implements DeptControllerApi {
*所有部门及员工
*/
@GetMapping("/trees")
public ResponseResult trees() {
return new ResponseResult<List<DepartmentVO>>().SUCCESS(deptService.listDepartmentAndEmployeeTree());
public ResponseResult trees(@RequestParam(value = "account", required = false) String account) {
return new ResponseResult<List<DepartmentVO>>().SUCCESS(deptService.listDepartmentAndEmployeeTree(account));
}
/**

@ -32,7 +32,7 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
List<EmployeeVO> listEmployeeByDeptId(Long id);
List<UserDeptVO> employeeListByDeptId(Long id);
List<UserDeptVO> employeeListByDeptId(@Param("id")Long id, @Param("account")String account);
List<EmployeeVO> listEmployeeByDeptIdAndEmpId(@Param("id") Long deptId, @Param("name") String name, @Param("empIds") List<Long> empIds);

@ -26,9 +26,9 @@ public interface DeptService extends IService<DeptEntity> {
boolean deleteByIds(Long[] ids);
List<DepartmentVO> listDepartmentAndEmployeeTree();
List<DepartmentVO> listDepartmentAndEmployeeTree(String account);
List<DepartmentVO> listDeptAndEmpTree(String name,List<Long> empIds);
//List<DepartmentVO> listDeptAndEmpTree(String name,List<Long> empIds);
DepartmentVO getDepartmentAndEmployee(Long id);

@ -165,21 +165,21 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements
* @return
*/
@Override
public List<DepartmentVO> listDepartmentAndEmployeeTree() {
return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L);
public List<DepartmentVO> listDepartmentAndEmployeeTree(String account) {
return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L, account);
}
private List<DepartmentVO> getListDepartmentAndEmployeeTree(List<DepartmentVO> list, Long parentId) {
private List<DepartmentVO> getListDepartmentAndEmployeeTree(List<DepartmentVO> list, Long parentId, String account) {
return list.stream()
.filter(dept -> parentId.equals(dept.getParentId())) // 过滤出部门id为所选id的部门信息(也为递归的结果条件,找不到所对应的部门id)
.peek(dept -> {
dept.setChildren(getListDepartmentAndEmployeeTree(list, dept.getId())); // 设置该部门的子部门:递归调用
dept.setChildren(getListDepartmentAndEmployeeTree(list, dept.getId(), account)); // 设置该部门的子部门:递归调用
List<UserDeptVO> empList = employeeDao.employeeListByDeptId(dept.getId());
List<UserDeptVO> empList = employeeDao.employeeListByDeptId(dept.getId(),account);
System.out.println("empList========================" + empList);
dept.setUserDept(employeeDao.employeeListByDeptId(dept.getId()));
dept.setUserDept(employeeDao.employeeListByDeptId(dept.getId(),account));
//dept.setEmployee(employeeDao.listEmployeeByDeptId(dept.getId())); // 设置该部门下面的所有员工
})
@ -190,7 +190,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements
/**
* 根据条件获取所有部门及部门下的员工信息
*/
@Override
/* @Override
public List<DepartmentVO> listDeptAndEmpTree(String name, List<Long> empIds) {
return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L, name, empIds);
@ -205,7 +205,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements
})
.sorted(Comparator.comparingInt(menu -> (menu.getSort() == null ? 0 : menu.getSort()))) // 根据所选排序信息进行排序
.collect(Collectors.toList());
}
}*/
/**
* 获取该部门下子部门及部门下的员工

@ -223,6 +223,9 @@
WHERE
u.del_or_not = 0
AND d.id = #{id}
<if test="account != null">
AND u.account LIKE CONCAT('%',#{account},'%')
</if>
GROUP BY u.id
)alias
where

Loading…
Cancel
Save