Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev
This commit was merged in pull request #108.
This commit is contained in:
@@ -49,6 +49,14 @@ public interface SysRoleMapper
|
|||||||
*/
|
*/
|
||||||
public SysRole selectRoleById(Long roleId);
|
public SysRole selectRoleById(Long roleId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色名称查询角色id
|
||||||
|
* @param roleName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Long selectRoleIdByName(String roleName);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询角色
|
* 根据用户ID查询角色
|
||||||
*
|
*
|
||||||
|
|||||||
+73
-12
@@ -28,7 +28,10 @@ import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
|||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.common.exception.EsignDemoException;
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
|
import com.ruoyi.system.domain.SysUserRole;
|
||||||
|
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||||
import com.ruoyi.system.mapper.SysUserMapper;
|
import com.ruoyi.system.mapper.SysUserMapper;
|
||||||
|
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
|
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
|
||||||
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
||||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||||
@@ -81,6 +84,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SysUserMapper sysUserMapper;
|
private SysUserMapper sysUserMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private SysUserRoleMapper userRoleMapper;
|
||||||
|
@Autowired
|
||||||
|
private SysRoleMapper roleMapper;
|
||||||
|
@Autowired
|
||||||
private SealSignRecordMapper sealSignRecordMapper;
|
private SealSignRecordMapper sealSignRecordMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CaseLogRecordMapper caseLogRecordMapper;
|
private CaseLogRecordMapper caseLogRecordMapper;
|
||||||
@@ -126,11 +133,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
|
caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
|
||||||
caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
|
caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
|
||||||
caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
|
caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
|
||||||
return caseApplicationMapper.selectDeptHeadCaseApplicationList(caseApplication,caseStatusList);
|
caseApplication.setDeptHeadStatus(caseStatusList);
|
||||||
}
|
}
|
||||||
if(role.getRoleName().equals("仲裁员")){
|
if(role.getRoleName().equals("仲裁员")){
|
||||||
caseApplication.setUserId(String.valueOf(userId));
|
caseApplication.setUserId(String.valueOf(userId));
|
||||||
}
|
}
|
||||||
|
if(role.getRoleName().equals("财务")){
|
||||||
|
caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
|
||||||
|
}
|
||||||
if(role.getRoleName().equals("法律顾问")){
|
if(role.getRoleName().equals("法律顾问")){
|
||||||
// 查询角色有关的用户部门
|
// 查询角色有关的用户部门
|
||||||
List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
|
List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
|
||||||
@@ -174,10 +184,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
){
|
){
|
||||||
return caseApplicationMapper.selectAdminCaseToDoCount();
|
return caseApplicationMapper.selectAdminCaseToDoCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查看所有案件
|
|
||||||
if(role.getRoleName().equals("仲裁委")
|
if(role.getRoleName().equals("仲裁委")
|
||||||
||role.getRoleName().equals("部门长")){
|
||role.getRoleName().equals("部门长")){
|
||||||
|
|
||||||
caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
|
caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
|
||||||
caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
|
caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
|
||||||
caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
|
caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
|
||||||
@@ -205,6 +214,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
|
// 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
|
||||||
return caseApplicationMapper.selectTodoCountByRole(caseApplication);
|
return caseApplicationMapper.selectTodoCountByRole(caseApplication);
|
||||||
}
|
}
|
||||||
@@ -264,7 +275,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// 组装申请代理人信息
|
// 组装申请代理人信息
|
||||||
buildAgentInfo(caseAffiliate);
|
String agentInfoFlag = buildAgentInfo(caseAffiliate);
|
||||||
|
if(StrUtil.isNotEmpty(agentInfoFlag)){
|
||||||
|
throw new ServiceException(agentInfoFlag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,7 +366,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
||||||
|
|
||||||
}
|
}
|
||||||
buildAgentInfo(caseAffiliate);
|
String agentInfoFlag = buildAgentInfo(caseAffiliate);
|
||||||
|
if(StrUtil.isNotEmpty(agentInfoFlag)){
|
||||||
|
throw new ServiceException(agentInfoFlag);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,12 +393,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
* 组装申请代理人信息
|
* 组装申请代理人信息
|
||||||
* @param caseAffiliate
|
* @param caseAffiliate
|
||||||
*/
|
*/
|
||||||
private void buildAgentInfo(CaseAffiliate caseAffiliate) {
|
private String buildAgentInfo(CaseAffiliate caseAffiliate) {
|
||||||
if(StrUtil.isNotEmpty(caseAffiliate.getNameAgent())){
|
if (caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getNameAgent())) {
|
||||||
|
// 查询申请人角色id
|
||||||
|
Long roleId = roleMapper.selectRoleIdByName("申请人");
|
||||||
// 组装申请机构代理人信息,用户表新增并且和部门关联
|
// 组装申请机构代理人信息,用户表新增并且和部门关联
|
||||||
// 根据代理人身份证去用户表查询,有修改,么有新增
|
// 根据代理人身份证去用户表查询,有修改,么有新增
|
||||||
SysUser agentUser = sysUserMapper.selectUserByIdCard(caseAffiliate.getIdentityNumAgent());
|
SysUser agentUser = sysUserMapper.selectUserByIdCard(caseAffiliate.getIdentityNumAgent());
|
||||||
if(agentUser==null){
|
if (agentUser == null) {
|
||||||
agentUser = new SysUser();
|
agentUser = new SysUser();
|
||||||
agentUser.setIdCard(caseAffiliate.getIdentityNumAgent());
|
agentUser.setIdCard(caseAffiliate.getIdentityNumAgent());
|
||||||
agentUser.setNickName(caseAffiliate.getNameAgent());
|
agentUser.setNickName(caseAffiliate.getNameAgent());
|
||||||
@@ -390,18 +409,46 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
agentUser.setPassword(SecurityUtils.encryptPassword(Constants.DEFAULT_PASSWORD));
|
agentUser.setPassword(SecurityUtils.encryptPassword(Constants.DEFAULT_PASSWORD));
|
||||||
agentUser.setDeptId(Long.valueOf(caseAffiliate.getApplicationOrganId()));
|
agentUser.setDeptId(Long.valueOf(caseAffiliate.getApplicationOrganId()));
|
||||||
int insertUserRow = sysUserMapper.insertUser(agentUser);
|
int insertUserRow = sysUserMapper.insertUser(agentUser);
|
||||||
if(insertUserRow>0) {
|
// 新增角色为申请人
|
||||||
|
ArrayList<SysUserRole> sysUserRoles = new ArrayList<>();
|
||||||
|
SysUserRole sysUserRole = new SysUserRole();
|
||||||
|
sysUserRole.setUserId(agentUser.getUserId());
|
||||||
|
sysUserRole.setRoleId(roleId);
|
||||||
|
sysUserRoles.add(sysUserRole);
|
||||||
|
if(CollectionUtil.isNotEmpty(sysUserRoles)) {
|
||||||
|
userRoleMapper.batchUserRole(sysUserRoles);
|
||||||
|
}
|
||||||
|
if (insertUserRow > 0) {
|
||||||
caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
|
caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
|
||||||
// 发送短信 todo
|
// 发送短信 todo
|
||||||
}
|
}
|
||||||
}else {
|
} else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) {
|
||||||
|
return "申请机构与申请代理人不匹配";
|
||||||
|
} else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())){
|
||||||
// 同步用户表和案件关联人表的手机号和名称
|
// 同步用户表和案件关联人表的手机号和名称
|
||||||
caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
|
caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
|
||||||
caseAffiliate.setNameAgent(agentUser.getNickName());
|
caseAffiliate.setNameAgent(agentUser.getNickName());
|
||||||
caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
|
caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
|
||||||
|
// 新增角色为申请人
|
||||||
|
if(agentUser.getRoleIds()!=null) {
|
||||||
|
List<Long> longList = Arrays.asList(agentUser.getRoleIds());
|
||||||
|
if(!longList.contains(roleId)) {
|
||||||
|
ArrayList<SysUserRole> sysUserRoles = new ArrayList<>();
|
||||||
|
SysUserRole sysUserRole = new SysUserRole();
|
||||||
|
sysUserRole.setUserId(agentUser.getUserId());
|
||||||
|
sysUserRole.setRoleId(roleId);
|
||||||
|
sysUserRoles.add(sysUserRole);
|
||||||
|
if (CollectionUtil.isNotEmpty(sysUserRoles)) {
|
||||||
|
userRoleMapper.batchUserRole(sysUserRoles);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -529,7 +576,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
// }else {
|
// }else {
|
||||||
// caseApplicationListinsert.add(caseApplication);
|
// caseApplicationListinsert.add(caseApplication);
|
||||||
// }
|
// }
|
||||||
caseApplicationListinsert.add(caseApplication);
|
if(StrUtil.isEmpty(caseApplication.getErrorMsg())) {
|
||||||
|
caseApplicationListinsert.add(caseApplication);
|
||||||
|
}else {
|
||||||
|
// 拼接错误信息
|
||||||
|
failureMsg.append("<br/>").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString());
|
||||||
|
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
// 拼接错误信息
|
// 拼接错误信息
|
||||||
failureMsg.append("<br/>").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString());
|
failureMsg.append("<br/>").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString());
|
||||||
@@ -577,7 +630,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
if(caseAffiliates!=null&&caseAffiliates.size()>0){
|
if(caseAffiliates!=null&&caseAffiliates.size()>0){
|
||||||
for (CaseAffiliate caseAffiliate : caseAffiliates){
|
for (CaseAffiliate caseAffiliate : caseAffiliates){
|
||||||
caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
|
caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
|
||||||
buildAgentInfo(caseAffiliate);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
|
caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
|
||||||
@@ -1444,6 +1496,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
if(StrUtil.isNotEmpty(caseApplication.getName())){
|
if(StrUtil.isNotEmpty(caseApplication.getName())){
|
||||||
setApplicantOrganization(caseAffiliate, caseApplication, deptMap);
|
setApplicantOrganization(caseAffiliate, caseApplication, deptMap);
|
||||||
}
|
}
|
||||||
|
String s = buildAgentInfo(caseAffiliate);
|
||||||
|
if(StrUtil.isNotEmpty(s)){
|
||||||
|
StringBuilder errorMsg = caseApplication.getErrorMsg();
|
||||||
|
if(StrUtil.isEmpty(errorMsg)){
|
||||||
|
errorMsg=new StringBuilder();
|
||||||
|
}
|
||||||
|
errorMsg.append(s);
|
||||||
|
caseApplication.setErrorMsg(errorMsg);
|
||||||
|
}
|
||||||
caseAffiliatesnew.add(caseAffiliate);
|
caseAffiliatesnew.add(caseAffiliate);
|
||||||
|
|
||||||
// 组装被申请人信息
|
// 组装被申请人信息
|
||||||
|
|||||||
@@ -92,8 +92,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectRoleIdByName" resultType="java.lang.Long" >
|
||||||
|
select role_id from sys_role where role_name=#{roleName}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||||
insert into sys_role(
|
insert into sys_role(
|
||||||
<if test="roleId != null and roleId != 0">role_id,</if>
|
<if test="roleId != null and roleId != 0">role_id,</if>
|
||||||
<if test="roleName != null and roleName != ''">role_name,</if>
|
<if test="roleName != null and roleName != ''">role_name,</if>
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
#{caseStatus}
|
#{caseStatus}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<!--申请人-->
|
<!--财务-->
|
||||||
<if test="financeStatus != null and financeStatus != ''">
|
<if test="financeStatus != null and financeStatus != ''">
|
||||||
or( t.case_status =#{financeStatus})
|
or( t.case_status =#{financeStatus})
|
||||||
|
|
||||||
@@ -203,6 +203,18 @@
|
|||||||
and t.case_status in (0,2))
|
and t.case_status in (0,2))
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
<!--部门长-->
|
||||||
|
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
|
||||||
|
or t.case_status in
|
||||||
|
<foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">
|
||||||
|
#{caseStatus}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<!--财务-->
|
||||||
|
<if test="financeStatus != null and financeStatus != ''">
|
||||||
|
or( t.case_status =#{financeStatus})
|
||||||
|
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
) t1
|
) t1
|
||||||
-- <where>
|
-- <where>
|
||||||
|
|||||||
Reference in New Issue
Block a user