This commit is contained in:
18792927508
2024-01-23 14:06:12 +08:00
parent 986127f7ca
commit 74766cd4ee
6 changed files with 129 additions and 90 deletions
@@ -61,7 +61,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
"</if> "
+
"<if test=\"req.hearDateFlag != null \">" +
" AND a.mediation_method = '1'" +
" AND c.mediation_method = '1'" +
"</if> "
+
"<if test=\"req.startTime != null and req.startTime != ''\">" +
@@ -95,11 +95,11 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
" AND a1.application_organ_id = #{req.applicationOrganId} " +
"</if> "
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
" AND a.respondent_identity_num = #{req.respondentIdentityNum} AND c1.case_flow_id=#{req.caseFlowId}" +
"</if> "
+
"<if test=\"req.hearDateFlag != null \">" +
" AND a.mediation_method = '1'" +
" AND c.mediation_method = '1'" +
"</if> "
+
@@ -133,7 +133,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
"</if> "
+
"<if test=\"req.hearDateFlag != null \">" +
" AND a.mediation_method = '1'" +
" AND c.mediation_method = '1'" +
"</if> "
+
@@ -143,15 +143,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
*/
@Override
public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) {
// admin查询所有案件
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
startPage();
return msCaseApplicationMapper.list(req, null);
}
// 根据用户查询角色
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser sysUser = loginUser.getUser();
List<SysRole> roles = sysUser.getRoles();
// 根据id查询用户
SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId());
List<SysRole> roles = loginUser.getUser().getRoles();
if (CollectionUtil.isEmpty(roles)) {
throw new ServiceException("该用户未指定角色");
}
@@ -170,16 +167,47 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (CollectionUtil.isEmpty(caseFlows)) {
throw new ServiceException("该角色为绑定案件流程");
}
Map<String, MsCaseFlow> flowMap = caseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getButtonAuthFlag, Function.identity()));
// admin查询所有案件
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
MsCaseFlow caseFlow =null;
if(req.getHearDateFlag()!=null){
caseFlow = flowMap.get("caseManagement:list:mediate");
}else {
// 根据按钮权限标识符查询待选择调解员流程id
caseFlow = flowMap.get("caseManagement:list:selectmediator");
}
if(caseFlow!=null) {
req.setCaseFlowId(caseFlow.getId());
}
startPage();
return msCaseApplicationMapper.list(req, null);
}
for (SysRole role : roles) {
if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"申请人")){
if(loginUser.getDeptId()!=null) {
req.setApplicationOrganId(String.valueOf(loginUser.getDeptId()));
if(sysUser.getDeptId()!=null) {
req.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
}
req.setApplicantFlag(1);
break;
}
if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"被申请人")){
// todo 被申请人案件根据被申请人身份证号查询案件列表
req.setRespondentIdentityNum(sysUser.getIdCard());
MsCaseFlow caseFlow =null;
// 查询待调解流程id
if(req.getHearDateFlag()!=null){
caseFlow = flowMap.get("caseManagement:list:mediate");
}else {
// 根据按钮权限标识符查询待选择调解员流程id
caseFlow = flowMap.get("caseManagement:list:selectmediator");
}
if(caseFlow!=null) {
req.setCaseFlowId(caseFlow.getId());
}
break;
}
}
startPage();
@@ -948,7 +976,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
criteria.andIsNull("type");
}
criteria.andEqualTo("caseAppliId", vo.getId());
criteria.andEqualTo("mediatorId", user.getUserId());
// criteria.andEqualTo("mediatorId", user.getUserId());
int count = msCaseMediatorMapper.selectCountByExample(example);
if (count > 0) {
// 申请人已预约,更新主表流程节点
@@ -2100,7 +2128,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId()));
userMapper.insertUser(agentUser);
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
} else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) {
} else if (null == agentUser.getDeptId() ) {
// todo 未关联部门,关联部门
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId()));
userMapper.updateUser(agentUser);
}else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) {
if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) {
throw new ServiceException("该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确");
} else {