待办数量查询

This commit is contained in:
18792927508
2023-10-17 11:47:11 +08:00
parent 7778d2b721
commit b54af26e42
7 changed files with 357 additions and 13 deletions
@@ -6,12 +6,13 @@ import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
import java.util.List;
public interface ICaseApplicationService {
List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication);
List<CaseApplication> selectCaseApplicationListNew(CaseApplication caseApplication);
List<CaseApplication> selectCaseApplicationListByRole(CaseApplication caseApplication);
int insertcaseApplication(CaseApplication caseApplication);
@@ -53,4 +54,10 @@ public interface ICaseApplicationService {
AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecord);
CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException;
/**
* 查询待办数量
* @return
*/
ToDoCount selectToDoCount();
}
@@ -29,6 +29,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.system.mapper.SysDeptMapper;
@@ -99,7 +100,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
* @return
*/
// @Override
public List<CaseApplication> selectCaseApplicationListNew(CaseApplication caseApplication) {
public List<CaseApplication> selectCaseApplicationListByRole(CaseApplication caseApplication) {
// 获取登录用户
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
@@ -151,6 +152,59 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
}
@Override
public ToDoCount selectToDoCount() {
// 获取登录用户
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("该用户没有角色权限");
}
CaseApplication caseApplication = new CaseApplication();
for (SysRole role : roles) {
// 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
if(role.getRoleName().equals("超级管理员")
){
return caseApplicationMapper.selectAdminCaseToDoCount();
}
// 查看所有案件
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.selectDeptHeadCaseToDoCount(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.selectTodoCountByRole(caseApplication);
}
@Override
public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
@@ -1272,6 +1326,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
return caseApplication;
}
@Override
@Transactional
public int pendTralSure(CaseApplication caseApplication) {
@@ -81,7 +81,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
*/
public static void setCodeCache(String key, String code)
{
SpringUtils.getBean(RedisCache.class).setCacheObject(getVerifyCodeCacheKey(key), code, 5,TimeUnit.MILLISECONDS);
SpringUtils.getBean(RedisCache.class).setCacheObject(getVerifyCodeCacheKey(key), code, 5,TimeUnit.MINUTES);
}
@@ -107,9 +107,12 @@ public class WeChatUserServiceImpl implements WeChatUserService {
@Transactional
@Override
public AjaxResult registerUser(IdentityAuthentication ientityAuthentication) {
String codeCache = getCodeCache(ientityAuthentication.getPhone());
// 校验短信验证码
if(StrUtil.isEmpty(getCodeCache(ientityAuthentication.getPhone()))){
return AjaxResult.success("验证码校验失败");
if(StrUtil.isEmpty(codeCache)){
return AjaxResult.warn("验证码校验失败");
}else if(!codeCache.equals(ientityAuthentication.getVerifyCode())){
return AjaxResult.warn("验证码校验失败");
}
SysUser sysUserName=sysUserMapper.selectUserByUserName(ientityAuthentication.getUserName());
if(sysUserName!=null){
@@ -140,7 +143,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
int row = sysUserMapper.insertUser(sysUser);
if(row<1) {
return AjaxResult.error("注册失败");
return AjaxResult.warn("注册失败");
}
}