根据角色查询案件

This commit is contained in:
18792927508
2023-10-16 20:44:30 +08:00
parent 01a08d670a
commit 9cd49c8109
7 changed files with 150 additions and 71 deletions
@@ -43,7 +43,7 @@ public interface CaseApplicationMapper {
/**
* 查询仲裁员根据案件id
* @param arbitrator
* @param id
* @return
*/
String selectArbitratorList(@Param("id") String id);
@@ -53,4 +53,11 @@ public interface CaseApplicationMapper {
* @param payDTO
*/
void updatePayType(CaseConfirmPayDTO payDTO);
/**
* 查询部门长案件
* @param caseApplication
* @return
*/
List<CaseApplication> selectDeptHeadCaseApplicationList(@Param("caseApplication") CaseApplication caseApplication, @Param("statusList")List<Integer> caseStatusList);
}
@@ -11,6 +11,7 @@ import java.util.List;
public interface ICaseApplicationService {
List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication);
List<CaseApplication> selectCaseApplicationListNew(CaseApplication caseApplication);
int insertcaseApplication(CaseApplication caseApplication);
@@ -99,41 +99,57 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
* @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);
//
// }
public List<CaseApplication> selectCaseApplicationListNew(CaseApplication caseApplication) {
// 获取登录用户
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
Long userId = user.getUserId();
// 查询登录人身份证号
SysUser sysUser = sysUserMapper.selectUserById(userId);
List<SysRole> roles = sysUser.getRoles();
// 没有角色不能查看案件列表
if(CollectionUtil.isEmpty(roles)){
throw new ServiceException("该用户没有角色权限");
}
startPage();
for (SysRole role : roles) {
// 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
if(role.getRoleName().equals("超级管理员")
){
return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
}
if(role.getRoleName().equals("仲裁委")
||role.getRoleName().equals("部门长")){
List<Integer> caseStatusList=new ArrayList<>();
caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
return caseApplicationMapper.selectDeptHeadCaseApplicationList(caseApplication,caseStatusList);
}
if(role.getRoleName().equals("仲裁员")){
caseApplication.setUserId(String.valueOf(userId));
}
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()));
}
if(role.getRoleName().equals("被申请人")){
//
caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
}
}
// 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
return caseApplicationMapper.selectCaseApplicationList(caseApplication);
}
@Override
public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
@@ -108,12 +108,12 @@ public class WeChatUserServiceImpl implements WeChatUserService {
@Override
public AjaxResult registerUser(IdentityAuthentication ientityAuthentication) {
// 校验短信验证码
// if(StrUtil.isEmpty(getCodeCache(ientityAuthentication.getPhone()))){
// return AjaxResult.success("验证码校验失败");
// }
if(StrUtil.isEmpty(getCodeCache(ientityAuthentication.getPhone()))){
return AjaxResult.success("验证码校验失败");
}
SysUser sysUserName=sysUserMapper.selectUserByUserName(ientityAuthentication.getUserName());
if(sysUserName!=null){
return AjaxResult.warn("用户名已存在");
return AjaxResult.warn("账号已存在");
}
// 根据身份证查询系统用户表中是否存在该用户,存在则同步已认证的信息,不存在则新增
SysUser sysUser=sysUserMapper.selectUserByIdCard(ientityAuthentication.getIdentityNo());