根据角色查询案件
This commit is contained in:
+1
@@ -38,6 +38,7 @@ public class CaseApplicationController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CaseApplication caseApplication) {
|
||||
startPage();
|
||||
// List<CaseApplication> list = caseApplicationService.selectCaseApplicationListNew(caseApplication);
|
||||
List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
+3
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
||||
@@ -21,6 +22,7 @@ public class IdentityAuthenticationController extends BaseController {
|
||||
/**
|
||||
* 获取EIDtoken
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/selectIdentityAuthenticaEIDtoken")
|
||||
public AjaxResult selectIdentityAuthenticaEIDtoken() {
|
||||
JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthenticaEIDtoken();
|
||||
@@ -30,6 +32,7 @@ public class IdentityAuthenticationController extends BaseController {
|
||||
/**
|
||||
* 小程序人脸核身后查询身份认证结果
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/selectIdentityAuthenticaRespon")
|
||||
public AjaxResult selectIdentityAuthenticaRespon(@Validated @RequestBody IdentityAuthentication ientityAuthentication) {
|
||||
AjaxResult checkResult = identityAuthenticationService.selectIdentityAuthenticaRespon(ientityAuthentication);
|
||||
|
||||
+8
-1
@@ -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);
|
||||
}
|
||||
|
||||
+1
@@ -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);
|
||||
|
||||
+51
-35
@@ -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);
|
||||
|
||||
+4
-4
@@ -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());
|
||||
|
||||
@@ -38,28 +38,30 @@
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
|
||||
select t1.* from(
|
||||
select t1.* from(
|
||||
select t.* from(
|
||||
select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
|
||||
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
|
||||
ELSE '无审理方式'
|
||||
END arbitratMethodName,
|
||||
ELSE '无审理方式'
|
||||
END arbitratMethodName,
|
||||
c.case_status ,
|
||||
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
|
||||
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
|
||||
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
|
||||
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
|
||||
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
|
||||
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
|
||||
ELSE '无案件状态'
|
||||
END caseStatusName,
|
||||
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
|
||||
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
|
||||
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
|
||||
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
|
||||
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
|
||||
ELSE '无案件状态'
|
||||
END caseStatusName,
|
||||
c.hear_date ,c.arbitrat_claims ,
|
||||
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
|
||||
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
|
||||
,c.fee_payable ,
|
||||
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
|
||||
c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as applicantName,
|
||||
c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as
|
||||
applicantName,
|
||||
c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url
|
||||
from case_application c
|
||||
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
|
||||
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
|
||||
<where>
|
||||
<if test="caseStatus != null">
|
||||
AND c.case_status = #{caseStatus}
|
||||
@@ -77,29 +79,34 @@ select t1.* from(
|
||||
) t
|
||||
<where>
|
||||
|
||||
<!--被申请人-->
|
||||
<if test="idCard != null and idCard != ''">
|
||||
or (t.identity_num=#{idCard} AND t.identity_type=2)
|
||||
</if>
|
||||
<!--仲裁员-->
|
||||
<if test="userId != null and userId != ''">
|
||||
or instr (t.arbitrator_id,#{userId})>0
|
||||
</if>
|
||||
<!--法律顾问-->
|
||||
<if test="deptIds != null and deptIds.size() > 0">
|
||||
or t.name
|
||||
in
|
||||
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--被申请人-->
|
||||
<if test="idCard != null and idCard != ''">
|
||||
or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
|
||||
</if>
|
||||
<!--仲裁员-->
|
||||
<if test="userId != null and userId != ''">
|
||||
or ( t.identity_type=1 and
|
||||
t.case_status in (7,8,9,12,13,14)
|
||||
and
|
||||
instr (t.arbitrator_id,#{userId})>0)
|
||||
</if>
|
||||
<!--法律顾问-->
|
||||
<if test="deptIds != null and deptIds.size() > 0">
|
||||
or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
|
||||
and t.application_organ_id in
|
||||
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach> )
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</where>
|
||||
) t1
|
||||
<where>
|
||||
<!--申请人-->
|
||||
<if test="nameId != null and nameId != ''">
|
||||
and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1 )
|
||||
and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1
|
||||
and t1.case_status in (0,2)
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by t1.create_time desc,t1.case_num desc
|
||||
@@ -143,6 +150,50 @@ select t1.* from(
|
||||
</where>
|
||||
order by c.create_time desc,c.case_num desc
|
||||
</select>
|
||||
<select id="selectDeptHeadCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
|
||||
select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
|
||||
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
|
||||
ELSE '无审理方式'
|
||||
END arbitratMethodName,
|
||||
c.case_status ,
|
||||
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
|
||||
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
|
||||
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
|
||||
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
|
||||
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
|
||||
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
|
||||
ELSE '无案件状态'
|
||||
END caseStatusName,
|
||||
c.hear_date ,c.arbitrat_claims ,
|
||||
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
|
||||
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
|
||||
c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url
|
||||
from case_application c
|
||||
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
|
||||
<where>
|
||||
c.case_status in
|
||||
<foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
|
||||
#{caseStatus}
|
||||
</foreach>
|
||||
<if test="caseApplication.caseStatus != null">
|
||||
AND c.case_status = #{caseApplication.caseStatus}
|
||||
</if>
|
||||
<if test="caseApplication.caseNum != null and caseApplication.caseNum != ''">
|
||||
AND c.case_num = #{caseApplication.caseNum}
|
||||
</if>
|
||||
<if test="caseApplication.nameId != null and caseApplication.nameId != ''">
|
||||
AND ca.application_organ_id=#{caseApplication.nameId} AND ca.identity_type=1
|
||||
</if>
|
||||
<if test="caseApplication.caseStatusList != null and caseApplication.caseStatusList.size() > 0">
|
||||
and c.case_status in
|
||||
<foreach item="caseStatus" collection="caseApplication.caseStatusList" open="(" separator="," close=")">
|
||||
#{caseStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
order by c.create_time desc,c.case_num desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">
|
||||
select count(1) from case_application c
|
||||
|
||||
Reference in New Issue
Block a user