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
@@ -1,18 +1,5 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
@@ -21,6 +8,13 @@ import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 部门信息
@@ -44,6 +38,15 @@ public class SysDeptController extends BaseController
List<SysDept> depts = deptService.selectDeptList(dept);
return success(depts);
}
/**
* 获取部门列表
*/
@GetMapping("/selectList")
public AjaxResult selectList(SysDept dept)
{
List<SysDept> depts = deptService.selectDeptList(dept);
return success(depts);
}
/**
* 查询部门列表(排除节点)
@@ -3,17 +3,18 @@ package com.ruoyi.web.controller.wisdomarbitrate.mscase;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.BookingVO;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseAttachVO;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.*;
import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -31,6 +32,8 @@ import java.util.List;
public class MsCaseApplicationController extends BaseController {
@Resource
private MsCaseApplicationService caseApplicationService;
@Autowired
private VideoConferenceService videoService;
/**
* 分页查询案件列表
@@ -243,4 +246,48 @@ public class MsCaseApplicationController extends BaseController {
return caseApplicationService.confirmMediation(attach);
}
/**
* 获取userSign
* @param userId
* @return
*/
@Anonymous
@GetMapping("/generateUserSign")
public AjaxResult generateUserSign(@RequestParam(required = true) String userId){
if(StrUtil.isEmpty(userId)){
error("参数校验失败");
}
return AjaxResult.success(videoService.generateUserSign(userId));
}
/**
* 生成房间号
* @return
*/
@Anonymous
@GetMapping("/createRoomId")
public AjaxResult createRoomId(@RequestParam("caseId") Long caseId) {
return success(videoService.createRoomId(caseId));
}
/**
* 预约会议
* @param reservedConferenceVO
* @return
*/
@PostMapping("/reservedConference")
public AjaxResult reservedConference(@Validated @RequestBody MsReservedConferenceVO reservedConferenceVO) throws Exception {
return videoService.reservedConference(reservedConferenceVO);
}
/**
* 根据案件id查询已预约的会议
* @param caseId
* @return
*/
@Anonymous
@GetMapping("/reserveConferenceList")
public AjaxResult reserveConferenceList( @RequestParam("caseId") Long caseId) {
return success(videoService.reserveConferenceList(caseId));
}
}
@@ -9,7 +9,6 @@ import com.ruoyi.wisdomarbitrate.domain.vo.mscase.SendRoomNoMessageVO;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.VideoCallBackVO;
import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@@ -35,50 +34,8 @@ public class MsVideoConferenceController extends BaseController {
return videoService.videoList(caseId);
}
/**
* 获取userSign
* @param userId
* @return
*/
@Anonymous
@GetMapping("/generateUserSign")
public AjaxResult generateUserSign(@RequestParam(required = true) String userId){
if(StrUtil.isEmpty(userId)){
error("参数校验失败");
}
return AjaxResult.success(videoService.generateUserSign(userId));
}
/**
* 生成房间号
* @return
*/
@Anonymous
@GetMapping("/createRoomId")
public AjaxResult createRoomId(@RequestParam("caseId") Long caseId) {
return success(videoService.createRoomId(caseId));
}
/**
* 根据案件id查询已预约的会议
* @param caseId
* @return
*/
@Anonymous
@GetMapping("/reserveConferenceList")
public AjaxResult reserveConferenceList( @RequestParam("caseId") Long caseId) {
return success(videoService.reserveConferenceList(caseId));
}
/**
* 预约会议
* @param reservedConferenceVO
* @return
*/
@PostMapping("/reservedConference")
public AjaxResult reservedConference(@Validated @RequestBody MsReservedConferenceVO reservedConferenceVO) throws Exception {
return videoService.reservedConference(reservedConferenceVO);
}
/**
* 从腾讯云下载文件到本地
* @param
@@ -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 {
@@ -274,21 +274,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateUser" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
update ms_sys_user
<set>
dept_id = #{deptId},
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
id_card = #{idCard},
email = #{email},
phonenumber = #{phonenumber},
sex = #{sex},
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
remark = #{remark},
specialty = #{specialty},
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
<if test="email != null ">email = #{email},</if>
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="specialty != null">specialty = #{specialty},</if>
update_time = sysdate()
</set>
where user_id = #{userId}