This commit is contained in:
qitz
2024-01-24 10:19:10 +08:00
8 changed files with 139 additions and 91 deletions
@@ -1,18 +1,5 @@
package com.ruoyi.web.controller.system; 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.annotation.Log;
import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController; 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.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService; 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); List<SysDept> depts = deptService.selectDeptList(dept);
return success(depts); 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.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication; import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach; import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.BookingVO; import com.ruoyi.wisdomarbitrate.domain.vo.mscase.*;
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.service.mscase.MsCaseApplicationService; 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.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -31,6 +32,8 @@ import java.util.List;
public class MsCaseApplicationController extends BaseController { public class MsCaseApplicationController extends BaseController {
@Resource @Resource
private MsCaseApplicationService caseApplicationService; private MsCaseApplicationService caseApplicationService;
@Autowired
private VideoConferenceService videoService;
/** /**
* 分页查询案件列表 * 分页查询案件列表
@@ -243,4 +246,48 @@ public class MsCaseApplicationController extends BaseController {
return caseApplicationService.confirmMediation(attach); 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.domain.vo.mscase.VideoCallBackVO;
import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService; import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
@@ -35,50 +34,8 @@ public class MsVideoConferenceController extends BaseController {
return videoService.videoList(caseId); 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 * @param
@@ -76,5 +76,9 @@ public class MsCaseApplicationReq {
* 是否在线开庭,空-书面 * 是否在线开庭,空-书面
*/ */
private Integer hearDateFlag ; private Integer hearDateFlag ;
/**
* 是否小程序,1-是
*/
private Integer miniProgressFlag ;
} }
@@ -61,7 +61,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
"</if> " "</if> "
+ +
"<if test=\"req.hearDateFlag != null \">" + "<if test=\"req.hearDateFlag != null \">" +
" AND a.mediation_method = '1'" + " AND c.mediation_method = '1'" +
"</if> " "</if> "
+ +
"<if test=\"req.startTime != null and req.startTime != ''\">" + "<if test=\"req.startTime != null and req.startTime != ''\">" +
@@ -99,7 +99,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
"</if> " "</if> "
+ +
"<if test=\"req.hearDateFlag != null \">" + "<if test=\"req.hearDateFlag != null \">" +
" AND a.mediation_method = '1'" + " AND c.mediation_method = '1'" +
"</if> " "</if> "
+ +
@@ -133,7 +133,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
"</if> " "</if> "
+ +
"<if test=\"req.hearDateFlag != null \">" + "<if test=\"req.hearDateFlag != null \">" +
" AND a.mediation_method = '1'" + " AND c.mediation_method = '1'" +
"</if> " "</if> "
+ +
@@ -1,10 +1,19 @@
package com.ruoyi.wisdomarbitrate.mapper.mscase; package com.ruoyi.wisdomarbitrate.mapper.mscase;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseMediator; import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseMediator;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.Mapper;
/** /**
* 案件预约表 * 案件预约表
*/ */
public interface MsCaseMediatorMapper extends Mapper<MsCaseMediator> { public interface MsCaseMediatorMapper extends Mapper<MsCaseMediator> {
/**
* 查询最新一条申请人的预约信息
* @param id
* @return
*/
@Select("SELECT id,case_appli_id caseAppliId,mediator_id mediatorId, mediator_name mediatorName,hear_date hearDate from ms_case_mediator where case_appli_id=#{id} and type is null order by id desc limit 1")
MsCaseMediator selectLastApplicant(@Param("id") Long id);
} }
@@ -145,13 +145,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) { public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) {
// admin查询所有案件 // admin查询所有案件
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) { if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
if(req.getHearDateFlag()!=null){
// todo 暂时写死
req.setCaseFlowId(9);
}
startPage(); startPage();
return msCaseApplicationMapper.list(req, null); return msCaseApplicationMapper.list(req, null);
} }
// 根据用户查询角色 // 根据用户查询角色
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser sysUser = loginUser.getUser(); // 根据id查询用户
List<SysRole> roles = sysUser.getRoles(); SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId());
List<SysRole> roles = loginUser.getUser().getRoles();
if (CollectionUtil.isEmpty(roles)) { if (CollectionUtil.isEmpty(roles)) {
throw new ServiceException("该用户未指定角色"); throw new ServiceException("该用户未指定角色");
} }
@@ -170,21 +177,42 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (CollectionUtil.isEmpty(caseFlows)) { if (CollectionUtil.isEmpty(caseFlows)) {
throw new ServiceException("该角色为绑定案件流程"); throw new ServiceException("该角色为绑定案件流程");
} }
Map<String, MsCaseFlow> flowMap = caseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getButtonAuthFlag, Function.identity()));
List<String> caseStatusNames = caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList());
for (SysRole role : roles) { for (SysRole role : roles) {
if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"申请人")){ if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"申请人")){
if(loginUser.getDeptId()!=null) { if(sysUser.getDeptId()!=null) {
req.setApplicationOrganId(String.valueOf(loginUser.getDeptId())); req.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
} }
req.setApplicantFlag(1); req.setApplicantFlag(1);
break;
} }
if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"被申请人")){ if(StrUtil.isNotEmpty(role.getRoleName())&&StrUtil.equals(role.getRoleName(),"被申请人")){
caseStatusNames=new ArrayList<>();
// todo 被申请人案件根据被申请人身份证号查询案件列表 // todo 被申请人案件根据被申请人身份证号查询案件列表
req.setRespondentIdentityNum(sysUser.getIdCard()); req.setRespondentIdentityNum(sysUser.getIdCard());
MsCaseFlow caseFlow =null;
// todo 查询待调解流程id被申请人暂时写死
if(req.getMiniProgressFlag()!=null) {
if (req.getHearDateFlag() != null) {
// caseFlow = flowMap.get("caseManagement:list:mediate");
caseStatusNames.add("待调解");
} else {
// 待选择调解员
caseStatusNames.add("待选择调解员");
}
}else {
// PC端
caseStatusNames.add("待被申请人签收");
}
break;
} }
} }
startPage(); startPage();
// 查询案件列表 // 查询案件列表
List<MsCaseApplicationVO> caseApplicationList = msCaseApplicationMapper.list(req, caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList())); List<MsCaseApplicationVO> caseApplicationList = msCaseApplicationMapper.list(req, caseStatusNames);
return caseApplicationList; return caseApplicationList;
} }
@@ -571,7 +599,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if(templateManage==null||StrUtil.isEmpty(templateManage.getTemOrigPath())){ if(templateManage==null||StrUtil.isEmpty(templateManage.getTemOrigPath())){
throw new ServiceException("未找到模板"); throw new ServiceException("未找到模板");
} }
String templatePath = "/home/ruoyi/" + templateManage.getTemOrigPath(); String templatePath = "/home/ruoyi" + templateManage.getTemOrigPath();
templatePath=templatePath.replace("/profile","/uploadPath"); templatePath=templatePath.replace("/profile","/uploadPath");
try { try {
@@ -948,7 +976,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
criteria.andIsNull("type"); criteria.andIsNull("type");
} }
criteria.andEqualTo("caseAppliId", vo.getId()); criteria.andEqualTo("caseAppliId", vo.getId());
criteria.andEqualTo("mediatorId", user.getUserId()); // criteria.andEqualTo("mediatorId", user.getUserId());
int count = msCaseMediatorMapper.selectCountByExample(example); int count = msCaseMediatorMapper.selectCountByExample(example);
if (count > 0) { if (count > 0) {
// 申请人已预约,更新主表流程节点 // 申请人已预约,更新主表流程节点
@@ -1029,12 +1057,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id); // MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
// todo 返回申请人预约信息,预约信息查预约表 // todo 返回申请人预约信息,预约信息查预约表
Example example = new Example(MsCaseMediator.class);
Example.Criteria criteria = example.createCriteria();
criteria.andIsNull("type");
criteria.andEqualTo("caseAppliId", id);
// criteria.andEqualTo("mediatorId", SecurityUtils.getUserId()); // criteria.andEqualTo("mediatorId", SecurityUtils.getUserId());
MsCaseMediator msCaseMediator = msCaseMediatorMapper.selectOneByExample(example); MsCaseMediator msCaseMediator = msCaseMediatorMapper.selectLastApplicant(id);
if(msCaseMediator==null){ if(msCaseMediator==null){
return AjaxResult.success(result); return AjaxResult.success(result);
} }
@@ -2100,7 +2124,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId())); agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId()));
userMapper.insertUser(agentUser); userMapper.insertUser(agentUser);
userRoleMapper.insertUserRole(agentUser.getUserId(), roleId); 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())) { if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) {
throw new ServiceException("该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确"); throw new ServiceException("该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确");
} else { } 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 id="updateUser" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
update ms_sys_user update ms_sys_user
<set> <set>
dept_id = #{deptId}, <if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if> <if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if> <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
id_card = #{idCard}, <if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
email = #{email}, <if test="email != null ">email = #{email},</if>
phonenumber = #{phonenumber}, <if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
sex = #{sex}, <if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if> <if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="password != null and password != ''">password = #{password},</if> <if test="password != null and password != ''">password = #{password},</if>
<if test="status != null and status != ''">status = #{status},</if> <if test="status != null and status != ''">status = #{status},</if>
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if> <if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
<if test="loginDate != null">login_date = #{loginDate},</if> <if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
remark = #{remark}, <if test="remark != null">remark = #{remark},</if>
specialty = #{specialty}, <if test="specialty != null">specialty = #{specialty},</if>
update_time = sysdate() update_time = sysdate()
</set> </set>
where user_id = #{userId} where user_id = #{userId}