Merge remote-tracking branch 'origin/master'

master
river 4 years ago
commit b39be1312d
  1. 7
      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, public ResponseResult businessApplicationList(@RequestParam(value="page",required=false) Integer page,@RequestParam(value="size",required=false) Integer size,
@RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName){ @RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName){
//获取当前登录用户id //获取当前登录用户id
//String userId = getUserId(); String userId = getUserId();
String userId ="9";
//根据角色查询资产部调查列表 //根据角色查询资产部调查列表
String roleIds = RedisUtil.get("dq:userRole:" + userId); String roleIds = RedisUtil.get("dq:userRole:" + userId);
@ -202,8 +201,8 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
for (BusinessApplicationListResponse response:list) { for (BusinessApplicationListResponse response:list) {
for(LinkedHashMap res : employeeMessage){ for(LinkedHashMap res : employeeMessage){
if(response.getPresenterId().equals(res.get("id"))){//如果提单人id相同情况下,就往对象里面赋值 if(response.getPresenterId().equals(res.get("id"))){//如果提单人id相同情况下,就往对象里面赋值
response.setAccount(JSONObject.toJSONString(res.get("account"))); response.setAccount(JSONObject.toJSONString(res.get("account")).replace("\"",""));
response.setDeptName(JSONObject.toJSONString(res.get("deptName"))); response.setDeptName(JSONObject.toJSONString(res.get("deptName")).replace("\"",""));
} }
} }
} }

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

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

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

Loading…
Cancel
Save