不区分权限案件查询

This commit is contained in:
18792927508
2023-10-15 22:28:44 +08:00
parent 969a4f09f8
commit 41660a5056
2 changed files with 45 additions and 38 deletions
@@ -97,39 +97,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
* @param caseApplication
* @return
*/
// @Override
// public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
// // 获取登录用户
// LoginUser loginUser = getLoginUser();
// SysUser user = loginUser.getUser();
// Long userId = user.getUserId();
// Long deptId = user.getDeptId();
// List<SysRole> roles = user.getRoles();
// // 查询登录人身份证号
// SysUser sysUser = sysUserMapper.selectUserById(userId);
// caseApplication.setIdCard(sysUser.getIdCard());
// caseApplication.setUserId(String.valueOf(userId));
// startPage();
// for (SysRole role : roles) {
// // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
// if(role.getRoleName().equals("超级管理员")
// ||role.getRoleName().equals("仲裁委")
// ||role.getRoleName().equals("部门长")){
// return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
// }
// if(role.getRoleName().equals("法律顾问")){
// // 查询角色有关的用户部门
// List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
// caseApplication.setDeptIds(deptIds);
// }
// if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){
// // 查询角色有关的用户部门
// caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
// }
// }
//
//
// // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
// return caseApplicationMapper.selectCaseApplicationList(caseApplication);
//
// }
@Override
public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
// 获取登录用户
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
Long userId = user.getUserId();
Long deptId = user.getDeptId();
List<SysRole> roles = user.getRoles();
// 查询登录人身份证号
SysUser sysUser = sysUserMapper.selectUserById(userId);
caseApplication.setIdCard(sysUser.getIdCard());
caseApplication.setUserId(String.valueOf(userId));
startPage();
for (SysRole role : roles) {
// 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
if(role.getRoleName().equals("超级管理员")
||role.getRoleName().equals("仲裁委")
||role.getRoleName().equals("部门长")){
return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
}
if(role.getRoleName().equals("法律顾问")){
// 查询角色有关的用户部门
List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
caseApplication.setDeptIds(deptIds);
}
}
// 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
return caseApplicationMapper.selectCaseApplicationList(caseApplication);
return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
}
@Override
@Transactional
public int insertcaseApplication(CaseApplication caseApplication) {