Commit 9952d89d authored by hongguangwu's avatar hongguangwu

档案相关权限-优化

parent 3d747b5d
...@@ -83,7 +83,7 @@ public class TEmployeeInfoController { ...@@ -83,7 +83,7 @@ public class TEmployeeInfoController {
} }
menuUtil.setAuthSql(user, tEmployeeInfo); menuUtil.setAuthSql(user, tEmployeeInfo);
if (Common.isNotNull(tEmployeeInfo.getAuthSql()) && tEmployeeInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) { if (Common.isNotNull(tEmployeeInfo.getAuthSql()) && tEmployeeInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tEmployeeInfo.setAuthSql(tEmployeeInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "b.id")); tEmployeeInfo.setAuthSql(tEmployeeInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "b.DEPT_ID "));
} }
return R.ok(tEmployeeInfoService.getPage(page, tEmployeeInfo)); return R.ok(tEmployeeInfoService.getPage(page, tEmployeeInfo));
} }
......
...@@ -303,7 +303,7 @@ public class UserController { ...@@ -303,7 +303,7 @@ public class UserController {
@Inner @Inner
@PostMapping(value = {"/inner/getUserIdByDeptIds"}) @PostMapping(value = {"/inner/getUserIdByDeptIds"})
public String getUserIdByDeptIds(@RequestBody String deptIds) { public String getUserIdByDeptIds(@RequestBody String deptIds) {
StringBuilder userIds = new StringBuilder("0"); StringBuilder userIds = new StringBuilder("'0'");
if (Common.isNotNull(deptIds)) { if (Common.isNotNull(deptIds)) {
List<SysUser> sysUsers = userService.list(Wrappers.<SysUser>query().lambda().in(SysUser::getDeptId, deptIds)); List<SysUser> sysUsers = userService.list(Wrappers.<SysUser>query().lambda().in(SysUser::getDeptId, deptIds));
if (Common.isNotEmpty(sysUsers)){ if (Common.isNotEmpty(sysUsers)){
......
...@@ -108,13 +108,13 @@ public class SysDataAuthServiceImpl extends ServiceImpl<SysDataAuthMapper, SysDa ...@@ -108,13 +108,13 @@ public class SysDataAuthServiceImpl extends ServiceImpl<SysDataAuthMapper, SysDa
// 处理权限部门 // 处理权限部门
if (sysDataAuth.getIsDeptAuth() == 1 || sysDataAuth.getIsDeptAuth() == 2) { if (sysDataAuth.getIsDeptAuth() == 1 || sysDataAuth.getIsDeptAuth() == 2) {
if (sysDataAuth.getIsDeptAuth() == 2) { if (sysDataAuth.getIsDeptAuth() == 2) {
sql.append(" or a.create_user in (start'0' "); sql.append(" or a.CREATE_BY in (start'0' ");
for (SysDataAuthDeptRel dept : authDeptList) { for (SysDataAuthDeptRel dept : authDeptList) {
sql.append(", '").append(dept.getDeptId()).append("'"); sql.append(", '").append(dept.getDeptId()).append("'");
} }
sql.append("end)"); sql.append("end)");
} else { } else {
sql.append(" or a.create_user in (#deptId) "); sql.append(" or a.CREATE_BY in (#deptId) ");
} }
for (SysDataAuthMenuRel menu : menuDeptList) { for (SysDataAuthMenuRel menu : menuDeptList) {
authSqlMap.put(linkId + CommonConstants.DOWN_LINE_STRING + menu.getMenuId(), sql.toString()); authSqlMap.put(linkId + CommonConstants.DOWN_LINE_STRING + menu.getMenuId(), sql.toString());
...@@ -314,7 +314,7 @@ public class SysDataAuthServiceImpl extends ServiceImpl<SysDataAuthMapper, SysDa ...@@ -314,7 +314,7 @@ public class SysDataAuthServiceImpl extends ServiceImpl<SysDataAuthMapper, SysDa
if (menuDeptList == null || menuDeptList.isEmpty()) { if (menuDeptList == null || menuDeptList.isEmpty()) {
return R.failed("请选择部门关联的菜单!"); return R.failed("请选择部门关联的菜单!");
} else if (sysDataAuth.getIsDeptAuth() == 2) { } else if (sysDataAuth.getIsDeptAuth() == 2) {
sql.append(" or a.create_user in (start'0' "); sql.append(" or a.CREATE_BY in (start'0' ");
for (SysDataAuthDeptRel dept : authDeptList) { for (SysDataAuthDeptRel dept : authDeptList) {
sql.append(", '").append(dept.getDeptId()).append("'"); sql.append(", '").append(dept.getDeptId()).append("'");
dept.setSysDataAuthId(mainId); dept.setSysDataAuthId(mainId);
...@@ -322,7 +322,7 @@ public class SysDataAuthServiceImpl extends ServiceImpl<SysDataAuthMapper, SysDa ...@@ -322,7 +322,7 @@ public class SysDataAuthServiceImpl extends ServiceImpl<SysDataAuthMapper, SysDa
sql.append("end)"); sql.append("end)");
authDeptRelService.saveOrUpdateBatch(authDeptList); authDeptRelService.saveOrUpdateBatch(authDeptList);
} else { } else {
sql.append(" or a.create_user in (#deptId) "); sql.append(" or a.CREATE_BY in (#deptId) ");
} }
for (SysDataAuthMenuRel menu : menuDeptList) { for (SysDataAuthMenuRel menu : menuDeptList) {
authSqlMap.put(linkId + CommonConstants.DOWN_LINE_STRING + menu.getMenuId(), sql.toString()); authSqlMap.put(linkId + CommonConstants.DOWN_LINE_STRING + menu.getMenuId(), sql.toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment