From d4ef18f4a15df285bddcc38c4447d504bd9bf1d4 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Wed, 2 Dec 2020 16:05:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8C=87=E6=B4=BEAB=E8=A7=92BUG=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DgApplyAmountInfoController.java | 3 +-- .../hrms/controller/DeptController.java | 4 ++-- .../daqing/financial/hrms/dao/EmployeeDao.java | 2 +- .../financial/hrms/service/DeptService.java | 4 ++-- .../hrms/service/impl/DeptServiceImpl.java | 16 ++++++++-------- .../main/resources/mapper/hrms/EmployeeDao.xml | 3 +++ 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java index a21280cd..079a8989 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java @@ -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); diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java index d7e5d127..a467a4e0 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java @@ -102,8 +102,8 @@ public class DeptController implements DeptControllerApi { *所有部门及员工 */ @GetMapping("/trees") - public ResponseResult trees() { - return new ResponseResult>().SUCCESS(deptService.listDepartmentAndEmployeeTree()); + public ResponseResult trees(@RequestParam(value = "account", required = false) String account) { + return new ResponseResult>().SUCCESS(deptService.listDepartmentAndEmployeeTree(account)); } /** diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java index 7f6764fc..b194f832 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java @@ -32,7 +32,7 @@ public interface EmployeeDao extends BaseMapper { List listEmployeeByDeptId(Long id); - List employeeListByDeptId(Long id); + List employeeListByDeptId(@Param("id")Long id, @Param("account")String account); List listEmployeeByDeptIdAndEmpId(@Param("id") Long deptId, @Param("name") String name, @Param("empIds") List empIds); diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java index 4008c287..86ef0979 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java @@ -26,9 +26,9 @@ public interface DeptService extends IService { boolean deleteByIds(Long[] ids); - List listDepartmentAndEmployeeTree(); + List listDepartmentAndEmployeeTree(String account); - List listDeptAndEmpTree(String name,List empIds); + //List listDeptAndEmpTree(String name,List empIds); DepartmentVO getDepartmentAndEmployee(Long id); diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java index 8b053e4c..4b56c64b 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java @@ -165,21 +165,21 @@ public class DeptServiceImpl extends ServiceImpl implements * @return */ @Override - public List listDepartmentAndEmployeeTree() { - return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L); + public List listDepartmentAndEmployeeTree(String account) { + return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L, account); } - private List getListDepartmentAndEmployeeTree(List list, Long parentId) { + private List getListDepartmentAndEmployeeTree(List 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 empList = employeeDao.employeeListByDeptId(dept.getId()); + List 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 implements /** * 根据条件获取所有部门及部门下的员工信息 */ - @Override +/* @Override public List listDeptAndEmpTree(String name, List empIds) { return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L, name, empIds); @@ -205,7 +205,7 @@ public class DeptServiceImpl extends ServiceImpl implements }) .sorted(Comparator.comparingInt(menu -> (menu.getSort() == null ? 0 : menu.getSort()))) // 根据所选排序信息进行排序 .collect(Collectors.toList()); - } + }*/ /** * 获取该部门下子部门及部门下的员工 diff --git a/dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml b/dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml index 1d5eb909..3c71cd9f 100644 --- a/dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml +++ b/dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml @@ -223,6 +223,9 @@ WHERE u.del_or_not = 0 AND d.id = #{id} + + AND u.account LIKE CONCAT('%',#{account},'%') + GROUP BY u.id )alias where From a0f4e37d0ecde966460ed2aab5d3adbc0cc9f28a Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Wed, 2 Dec 2020 17:52:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../guarantee/controller/DgApplyAmountInfoController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java index 079a8989..6fed3bc3 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java @@ -201,8 +201,8 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA for (BusinessApplicationListResponse response:list) { for(LinkedHashMap res : employeeMessage){ if(response.getPresenterId().equals(res.get("id"))){//如果提单人id相同情况下,就往对象里面赋值 - response.setAccount(JSONObject.toJSONString(res.get("account"))); - response.setDeptName(JSONObject.toJSONString(res.get("deptName"))); + response.setAccount(JSONObject.toJSONString(res.get("account")).replace("\"","")); + response.setDeptName(JSONObject.toJSONString(res.get("deptName")).replace("\"","")); } } }