Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Mediation-Backend into qtz
This commit is contained in:
+52
-1
@@ -1,11 +1,13 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate.mscase;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||
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.service.mscase.MsCaseApplicationService;
|
||||
@@ -33,7 +35,7 @@ public class MsCaseApplicationController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo page(MsCaseApplicationReq req)
|
||||
{
|
||||
startPage();
|
||||
//startPage();
|
||||
List<MsCaseApplicationVO> list = caseApplicationService.list(req);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@@ -150,5 +152,54 @@ public class MsCaseApplicationController extends BaseController {
|
||||
public AjaxResult listMediator( ) {
|
||||
return caseApplicationService.listMediator();
|
||||
}
|
||||
/**
|
||||
* 保存预约
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/updateBooking")
|
||||
public AjaxResult updateBooking(@RequestBody BookingVO vo ) {
|
||||
if(vo.getId()==null || CollectionUtil.isEmpty(vo.getHerDates())|| CollectionUtil.isEmpty(vo.getUserList())){
|
||||
return error("参数校验失败");
|
||||
}
|
||||
return caseApplicationService.updateBooking(vo);
|
||||
}
|
||||
/**
|
||||
* 核实调解员
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/verifyMediator")
|
||||
public AjaxResult verifyMediator(@RequestBody BookingVO vo ) {
|
||||
if((vo.getId() == null && StrUtil.isEmpty(vo.getBatchNumber()))
|
||||
|| vo.getCaseFlowId()==null
|
||||
|| CollectionUtil.isEmpty(vo.getUserList())){
|
||||
return error("参数校验失败");
|
||||
}
|
||||
return caseApplicationService.verifyMediator(vo);
|
||||
}
|
||||
/**
|
||||
* 确认调解时间
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/confirmDate")
|
||||
public AjaxResult confirmDate(@RequestBody BookingVO vo ) {
|
||||
if((vo.getId() == null && StrUtil.isEmpty(vo.getBatchNumber()))
|
||||
|| vo.getCaseFlowId()==null
|
||||
|| CollectionUtil.isEmpty(vo.getHerDates())){
|
||||
return error("参数校验失败");
|
||||
}
|
||||
return caseApplicationService.verifyMediator(vo);
|
||||
}
|
||||
/**
|
||||
* 查询预约信息
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectReservation")
|
||||
public AjaxResult selectReservation(@RequestParam("id") Long id ) {
|
||||
return caseApplicationService.selectReservation(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate.mscase;
|
||||
|
||||
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.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 视频会议控制层
|
||||
* @Author wangqiong
|
||||
* @Date 2024/01/8
|
||||
* @Version V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/video")
|
||||
public class MsVideoConferenceController extends BaseController {
|
||||
@Autowired
|
||||
private VideoConferenceService videoService;
|
||||
/**
|
||||
* 根据案件ID查询视频
|
||||
* @param caseId 案件id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/videoList")
|
||||
public AjaxResult videoList(@RequestParam("caseId") Long 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
|
||||
* @return
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/videoRollBack")
|
||||
public AjaxResult videoRollBack( @RequestBody VideoCallBackVO vo) {
|
||||
if(StrUtil.isNotEmpty(vo.getFileId()) && StrUtil.isNotEmpty(vo.getVideoUrl()) && StrUtil.isNotEmpty(vo.getRoomId())) {
|
||||
videoService.videoRollBack(vo.getFileId(), vo.getVideoUrl(), vo.getRoomId());
|
||||
}
|
||||
return success();
|
||||
}
|
||||
/**
|
||||
* 根据房间号绑定案件ID
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/bindCaseId")
|
||||
public AjaxResult bindCaseId(@Valid @RequestBody SendRoomNoMessageVO vo) {
|
||||
|
||||
return videoService.bindCaseId(vo.getId(),vo.getRoomNo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启腾讯云录制
|
||||
* @param vo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/openCloudRecording")
|
||||
private AjaxResult openCloudRecording( @RequestBody MsReservedConferenceVO vo) {
|
||||
if(vo.getCaseId()==null || vo.getRoomId()==null){
|
||||
return AjaxResult.error("参数错误");
|
||||
}
|
||||
return videoService.openCloudRecording(vo.getCaseId(),vo.getRoomId());
|
||||
}
|
||||
/**
|
||||
* 关闭腾讯云录制
|
||||
* @param taskId 任务ID
|
||||
* @return
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/closeDeleteCloudRecording")
|
||||
public AjaxResult closeDeleteCloudRecording(@RequestParam("taskId") String taskId){
|
||||
return videoService.closeDeleteCloudRecording(taskId);
|
||||
}
|
||||
/**
|
||||
* 解散房间
|
||||
* @param reservedConferenceVO
|
||||
* @return
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/dissolveRoom")
|
||||
public AjaxResult dissolveRoom( @RequestBody MsReservedConferenceVO reservedConferenceVO) {
|
||||
if( reservedConferenceVO.getRoomId()==null){
|
||||
return error("参数校验失败");
|
||||
}
|
||||
|
||||
return videoService.dissolveRoom(reservedConferenceVO.getRoomId());
|
||||
}
|
||||
/**
|
||||
* 根据userId查询该用户是否是秘书
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Anonymous
|
||||
@GetMapping("secretaryRoleByUserId")
|
||||
public AjaxResult secretaryRoleByUserId( @RequestParam(value = "userId",required = true) Long userId) {
|
||||
|
||||
return videoService.secretaryRoleByUserId(userId);
|
||||
}
|
||||
/**
|
||||
* 根据html字符串转pdf并和案件关联
|
||||
* @param reservedConferenceVO
|
||||
* @return
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("htmlToPDF")
|
||||
public AjaxResult secretaryRoleByUserId( @RequestBody MsReservedConferenceVO reservedConferenceVO) {
|
||||
if( reservedConferenceVO.getCaseId()==null || StrUtil.isEmpty(reservedConferenceVO.getHtmlContent())){
|
||||
return success();
|
||||
}
|
||||
|
||||
return videoService.htmlToPDF(reservedConferenceVO);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -14,6 +14,7 @@ public enum AnnexTypeEnum implements EnumsInterface {
|
||||
APPLICATION_EVIDENCE(2, "申请人证据"),
|
||||
MEDIATION_APPLICATION(3, "调解申请书"),
|
||||
PAYMENT_RECEIPT(4, "缴费单"),
|
||||
MEETING_VIDEO(5, "会议视频"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@ public class MsCaseApplication {
|
||||
* 批次
|
||||
*/
|
||||
@Column(name = "batch_number")
|
||||
private String batchNumber;
|
||||
private String batchNumber=null;
|
||||
|
||||
/**
|
||||
* 模板id
|
||||
@@ -71,7 +71,7 @@ public class MsCaseApplication {
|
||||
* 开庭日期
|
||||
*/
|
||||
@Column(name = "hear_date")
|
||||
private Date hearDate;
|
||||
private String hearDate;
|
||||
|
||||
/**
|
||||
* 调解应缴费用
|
||||
@@ -83,7 +83,7 @@ public class MsCaseApplication {
|
||||
* 调解员id
|
||||
*/
|
||||
@Column(name = "mediator_id")
|
||||
private Long mediatorId;
|
||||
private String mediatorId;
|
||||
|
||||
/**
|
||||
* 调解员名称
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname BookingVO
|
||||
* @Description 保存预约
|
||||
* @Version 1.0.0
|
||||
* @Date 2024/1/16 16:40
|
||||
* @Created wangqiong
|
||||
*/
|
||||
@Data
|
||||
public class BookingVO {
|
||||
/**
|
||||
* 调解员列表
|
||||
*/
|
||||
private List<SysUser> userList;
|
||||
/**
|
||||
* 调解员列表
|
||||
*/
|
||||
private List<MediatorVO> mediatorList;
|
||||
/**
|
||||
* 开庭日期集合
|
||||
*/
|
||||
private List<String> herDates;
|
||||
/**
|
||||
* 案件id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 案件id
|
||||
*/
|
||||
private Integer caseFlowId;
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String batchNumber;
|
||||
}
|
||||
+18
@@ -41,6 +41,24 @@ public class MsCaseApplicationReq {
|
||||
* 结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 是否同意,0-否,1-是
|
||||
*/
|
||||
private Integer yesOrNo;
|
||||
/**
|
||||
* 调解员id
|
||||
*/
|
||||
|
||||
private String mediatorId;
|
||||
|
||||
/**
|
||||
* 调解员名称
|
||||
*/
|
||||
|
||||
private String mediatorName;
|
||||
|
||||
}
|
||||
+4
@@ -53,5 +53,9 @@ public class MsCaseApplicationVO extends MsCaseApplication {
|
||||
* 自定义字段
|
||||
*/
|
||||
private List<MsColumnValueVO> columnValueList;
|
||||
/**
|
||||
* 待办状态,0-待办,1-已办
|
||||
*/
|
||||
private Integer pendingStatus;
|
||||
|
||||
}
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author wangqiong
|
||||
* @description 发送房间号短信入参类
|
||||
* @date 2023-10-10 15:20
|
||||
*/
|
||||
@Data
|
||||
public class SendRoomNoMessageVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@NotNull(message = "案件id不能为空")
|
||||
private Long id;
|
||||
@NotEmpty(message = "房间号不能为空")
|
||||
private String roomNo;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date scheduleStartTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date scheduleEndTime;
|
||||
|
||||
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Classname VideoCallBackVO
|
||||
* @Description 视频回调VO
|
||||
* @Version 1.0.0
|
||||
* @Date 2024/1/18 15:02
|
||||
* @Created wangqiong
|
||||
*/
|
||||
@Data
|
||||
public class VideoCallBackVO {
|
||||
/**
|
||||
* 附件id
|
||||
*/
|
||||
private String fileId;
|
||||
/**
|
||||
* 视频地址
|
||||
*/
|
||||
private String videoUrl;
|
||||
/**
|
||||
* 房间号
|
||||
*/
|
||||
private String roomId;
|
||||
}
|
||||
+22
-13
@@ -1,7 +1,6 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper.mscase;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MediatorVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -35,7 +34,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
|
||||
* @param caseStatusNames
|
||||
* @return
|
||||
*/
|
||||
@Select("<script> select t.* from (select c.id,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
|
||||
@Select("<script> select t.* from (select c.id,0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
|
||||
"a.application_organ_name applicationOrganName,a.respondent_name respondentName,c.mediator_name mediatorName," +
|
||||
"c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_application c " +
|
||||
"join ms_case_affiliate a on c.id=a.case_appli_id <where> " +
|
||||
@@ -62,17 +61,19 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
|
||||
"<if test=\"req.endTime != null and req.endTime != ''\">" +
|
||||
"and c.create_time <= #{req.endTime}</if>" +
|
||||
" </where> " +
|
||||
"union select c.id id,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
|
||||
"union select c.id id,1 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
|
||||
"a.application_organ_name applicationOrganName,a.respondent_name respondentName,c.mediator_name mediatorName," +
|
||||
"c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_log_record r " +
|
||||
"join ms_case_application c on r.case_appli_id=c.id and r.case_status_name!=c.case_status_name " +
|
||||
"join ms_case_affiliate a on c.id=a.case_appli_id <where> r.create_by=#{req.userName} and c.id not in (" +
|
||||
"select c1.id from ms_case_application c1 JOIN ms_case_affiliate a1 ON a1.case_appli_id = c1.id" +
|
||||
"select c1.id from ms_case_application c1 JOIN ms_case_affiliate a1 ON a1.case_appli_id = c1.id"
|
||||
+
|
||||
"<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and c.case_status_name in" +
|
||||
"<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" +
|
||||
"#{caseStatus}" +
|
||||
"</foreach>" +
|
||||
"</if> " +
|
||||
"</if> "
|
||||
+
|
||||
"<if test=\"req.batchNumber != null and req.batchNumber != ''\">" +
|
||||
" AND c1.batch_number = #{req.batchNumber} " +
|
||||
"</if> " +
|
||||
@@ -90,12 +91,14 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
|
||||
"<if test=\"req.endTime != null and req.endTime != ''\">" +
|
||||
"and c1.create_time <= #{req.endTime}</if>" +
|
||||
" </where> " +
|
||||
" ) " +
|
||||
"<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and c.case_status_name in" +
|
||||
"<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" +
|
||||
"#{caseStatus}" +
|
||||
"</foreach>" +
|
||||
"</if> " +
|
||||
" ) "
|
||||
// +
|
||||
// "<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and c.case_status_name in" +
|
||||
// "<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" +
|
||||
// "#{caseStatus}" +
|
||||
// "</foreach>" +
|
||||
// "</if> "
|
||||
+
|
||||
"<if test=\"req.batchNumber != null and req.batchNumber != ''\">" +
|
||||
" AND c.batch_number = #{req.batchNumber} " +
|
||||
"</if> " +
|
||||
@@ -120,6 +123,12 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
|
||||
* 查询调解员列表
|
||||
* @return
|
||||
*/
|
||||
@Select("select a.id id,a.mediator_name mediatorName,a.mediator_phone mediatorPhone,a.mediator_email mediatorEmail,a.mediator_address mediatorAddress,a.mediator_id mediatorId,a.mediator_type mediatorType,a.mediator_status mediatorStatus,a.mediator_remark mediatorRemark,a.create_time createTime from ms_case_mediator a")
|
||||
List<MediatorVO> listMediator();
|
||||
List<MsCaseApplication> listMediator( @Param("userIds") List<Long> userIds,@Param("recordCaeIdList") List<Long> recordCaeIdList);
|
||||
|
||||
/**
|
||||
* 查询最大房间号
|
||||
* @return
|
||||
*/
|
||||
@Select("select max(room_id) maxRoomId from ms_reserved_conference")
|
||||
Long selectMaxRoomId();
|
||||
}
|
||||
+2
-3
@@ -11,11 +11,10 @@ import java.util.List;
|
||||
public interface MsCaseLogRecordMapper extends Mapper<MsCaseLogRecord> {
|
||||
/**
|
||||
* 查询调解员已办数量
|
||||
* @param collect
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
@Select("select create_by createBy,GROUP_CONCAT(DISTINCT case_appli_id) caseAppliId from ms_case_log_record where create_by in('hhl','gyj') group by create_by,case_appli_id")
|
||||
List<MsCaseLogRecord> selectCompleteByCreateBy(List<Long> collect);
|
||||
List<MsCaseLogRecord> selectCompleteByCreateBy(@Param("list") List<String> list);
|
||||
|
||||
@Select("<script> select cl.case_node caseNode ,cl.case_node_time caseNodeTime ,cl.notes ,cl.id ,cl.case_appli_id caseAppliId," +
|
||||
" cl.create_by createBy,cl.create_nick_name createNickName,cl.create_time createTime, " +
|
||||
|
||||
+22
@@ -4,6 +4,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||
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 org.springframework.web.multipart.MultipartFile;
|
||||
@@ -118,4 +119,25 @@ public interface MsCaseApplicationService {
|
||||
* @return
|
||||
*/
|
||||
AjaxResult listMediator();
|
||||
/**
|
||||
* 保存预约
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
AjaxResult updateBooking(BookingVO vo);
|
||||
|
||||
/**
|
||||
* 核实调解员
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult verifyMediator(BookingVO vo);
|
||||
|
||||
/**
|
||||
* 查询预约信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
AjaxResult selectReservation(Long id);
|
||||
|
||||
}
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.mscase;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.ReservedConference;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 视频录制
|
||||
*/
|
||||
public interface VideoConferenceService {
|
||||
|
||||
|
||||
void videoRollBack(String fileId,String videoUrl,String roomId) ;
|
||||
|
||||
AjaxResult bindCaseId(Long caseId, String roomId);
|
||||
|
||||
AjaxResult videoList(Long caseId);
|
||||
|
||||
/**
|
||||
* 开启腾讯云录制
|
||||
* @param roomId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult openCloudRecording(long caseId,long roomId);
|
||||
|
||||
/**
|
||||
* 退出录制
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
|
||||
AjaxResult closeDeleteCloudRecording(String taskId);
|
||||
|
||||
/**
|
||||
* 解散房间
|
||||
* @param roomId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult dissolveRoom( Long roomId);
|
||||
/**
|
||||
* 根据userId查询该用户是否是秘书
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult secretaryRoleByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据html字符串转pdf并和案件关联
|
||||
* @param reservedConferenceVO
|
||||
* @return
|
||||
*/
|
||||
AjaxResult htmlToPDF(MsReservedConferenceVO reservedConferenceVO);
|
||||
|
||||
/**
|
||||
* 获取userSign
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
String generateUserSign(String userId);
|
||||
|
||||
/**
|
||||
* 生成房间号
|
||||
* @param caseId
|
||||
* @return
|
||||
*/
|
||||
|
||||
String createRoomId(Long caseId);
|
||||
/**
|
||||
* 根据案件id查询已预约的会议
|
||||
* @param caseId
|
||||
* @return
|
||||
*/
|
||||
List<ReservedConference> reserveConferenceList(Long caseId);
|
||||
/**
|
||||
* 预约会议
|
||||
* @param reservedConferenceVO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
AjaxResult reservedConference( MsReservedConferenceVO reservedConferenceVO) throws Exception;
|
||||
}
|
||||
+171
-10
@@ -27,10 +27,7 @@ import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseLogRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MediatorVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsColumnValueVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.*;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.*;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.template.FatchRuleMapper;
|
||||
@@ -61,6 +58,7 @@ import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.ruoyi.common.utils.BookMarkUtil.getBookmarkByDocx;
|
||||
import static com.ruoyi.common.utils.PageUtils.startPage;
|
||||
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
||||
|
||||
/**
|
||||
@@ -124,6 +122,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) {
|
||||
// admin查询所有案件
|
||||
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
|
||||
startPage();
|
||||
return msCaseApplicationMapper.list(req, null);
|
||||
}
|
||||
// 根据用户查询角色
|
||||
@@ -140,12 +139,14 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
if (CollectionUtil.isEmpty(caseFlowRoleRelatedList)) {
|
||||
throw new ServiceException("该角色为绑定案件流程");
|
||||
}
|
||||
|
||||
Example flowExample = new Example(MsCaseFlow.class);
|
||||
flowExample.createCriteria().andIn("id", caseFlowRoleRelatedList.stream().map(MsCaseFlowRoleRelated::getFlowId).collect(Collectors.toList()));
|
||||
List<MsCaseFlow> caseFlows = caseFlowMapper.selectByExample(flowExample);
|
||||
if (CollectionUtil.isEmpty(caseFlows)) {
|
||||
throw new ServiceException("该角色为绑定案件流程");
|
||||
}
|
||||
startPage();
|
||||
// 查询案件列表
|
||||
List<MsCaseApplicationVO> caseApplicationList = msCaseApplicationMapper.list(req, caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList()));
|
||||
return caseApplicationList;
|
||||
@@ -699,20 +700,178 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
List<MediatorVO> mediatorVOS = new ArrayList<MediatorVO>();
|
||||
// 查出所有调解员
|
||||
List<SysUser> users = userMapper.selectUserByRole("调解员");
|
||||
if(CollectionUtil.isEmpty(users)){
|
||||
if (CollectionUtil.isEmpty(users)) {
|
||||
return AjaxResult.error("暂无调解员");
|
||||
}
|
||||
List<Long> userIds = users.stream().map(SysUser::getUserId).collect(Collectors.toList());
|
||||
// 查询调解员已办数量
|
||||
List<MsCaseLogRecord> recordList=caseLogRecordMapper.selectCompleteByCreateBy(users.stream().map(SysUser::getUserId).collect(Collectors.toList()));
|
||||
if(CollectionUtil.isNotEmpty(recordList)){
|
||||
Map<String, List<MsCaseLogRecord>> recordMap =null;
|
||||
List<MsCaseLogRecord> recordList = caseLogRecordMapper.selectCompleteByCreateBy(users.stream().map(SysUser::getUserName).collect(Collectors.toList()));
|
||||
List<Long> recordCaeIdList = null;
|
||||
if (CollectionUtil.isNotEmpty(recordList)) {
|
||||
// 组装成id对应的list
|
||||
recordList.stream().collect(Collectors.groupingBy(MsCaseLogRecord::getCaseAppliId, Collectors.toList()));
|
||||
recordMap = recordList.stream().collect(Collectors.groupingBy(MsCaseLogRecord::getCreateBy, Collectors.toList()));
|
||||
recordCaeIdList = recordList.stream().map(MsCaseLogRecord::getCaseAppliId).collect(Collectors.toList());
|
||||
}
|
||||
// 查询待办数量
|
||||
Map<String, List<MsCaseApplication>> caseMap=null;
|
||||
List<MsCaseApplication> caseApplicationList = msCaseApplicationMapper.listMediator(userIds, recordCaeIdList);
|
||||
if (CollectionUtil.isNotEmpty(caseApplicationList)) {
|
||||
caseMap = caseApplicationList.stream().collect(Collectors.groupingBy(MsCaseApplication::getMediatorId, Collectors.toList()));
|
||||
|
||||
mediatorVOS= msCaseApplicationMapper.listMediator();
|
||||
}
|
||||
for (SysUser user : users) {
|
||||
MediatorVO mediatorVO = new MediatorVO();
|
||||
mediatorVO.setMediatorId(user.getUserId());
|
||||
mediatorVO.setMediatorName(user.getNickName());
|
||||
mediatorVO.setSpecialty(user.getSpecialty());
|
||||
if(recordMap!=null &&recordMap.containsKey(String.valueOf(user.getUserName()))) {
|
||||
mediatorVO.setCompleteAmount(recordMap.get(String.valueOf(user.getUserName())).size());
|
||||
}
|
||||
if(caseMap!=null&&caseMap.containsKey(String.valueOf(user.getUserId()))) {
|
||||
mediatorVO.setTodoAmount(caseMap.get(String.valueOf(user.getUserId())).size());
|
||||
}
|
||||
mediatorVOS.add(mediatorVO);
|
||||
}
|
||||
return AjaxResult.success(mediatorVOS);
|
||||
}
|
||||
@Transactional
|
||||
@Override
|
||||
public AjaxResult updateBooking(BookingVO vo) {
|
||||
MsCaseApplication application = new MsCaseApplication();
|
||||
application.setId(vo.getId());
|
||||
setMediatorAndDate(application,vo);
|
||||
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
nextFlow(vo.getId(),vo.getCaseFlowId(),null);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置调解员调解时间
|
||||
* @param application
|
||||
* @param vo
|
||||
*/
|
||||
private void setMediatorAndDate(MsCaseApplication application, BookingVO vo) {
|
||||
if(CollectionUtil.isNotEmpty(vo.getUserList())) {
|
||||
List<SysUser> userList = vo.getUserList();
|
||||
List<Long> userIds = userList.stream().map(SysUser::getUserId).collect(Collectors.toList());
|
||||
List<String> userNames = userList.stream().map(SysUser::getUserName).collect(Collectors.toList());
|
||||
String mediatorIds = StrUtil.join(",", userIds);
|
||||
String mediatorNames = StrUtil.join(",", userNames);
|
||||
application.setMediatorId(mediatorIds);
|
||||
application.setMediatorName(mediatorNames);
|
||||
}
|
||||
if(CollectionUtil.isNotEmpty( vo.getHerDates())) {
|
||||
String herDates = StrUtil.join(",", vo.getHerDates());
|
||||
application.setHearDate(herDates);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 核实调解员
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult verifyMediator(BookingVO vo) {
|
||||
if(StrUtil.isNotEmpty(vo.getBatchNumber())){
|
||||
// 批量
|
||||
List<MsCaseApplication> list = listByBatchNumber(vo.getBatchNumber(), vo.getCaseFlowId());
|
||||
if(CollectionUtil.isEmpty(list)){
|
||||
return AjaxResult.error("该批次号下未找到案件");
|
||||
}
|
||||
for (MsCaseApplication application : list) {
|
||||
verifyMediator(application,vo);
|
||||
}
|
||||
}else {
|
||||
MsCaseApplication application = new MsCaseApplication();
|
||||
application.setId(vo.getId());
|
||||
verifyMediator(application,vo);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询预约信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult selectReservation(Long id) {
|
||||
|
||||
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
|
||||
if(caseApplication == null){
|
||||
return AjaxResult.error("该案件不存在");
|
||||
}
|
||||
BookingVO result = new BookingVO();
|
||||
// 调解员是一个的处理
|
||||
if( StrUtil.isNotEmpty(caseApplication.getMediatorId()) && StrUtil.isNotEmpty(caseApplication.getMediatorName())){
|
||||
// 查询用户
|
||||
SysUser user = userMapper.selectUserById(Long.valueOf(caseApplication.getMediatorId()));
|
||||
if(user==null){
|
||||
return AjaxResult.error("调解员已被删除");
|
||||
}
|
||||
// 查询调解员已办数量
|
||||
Map<String, List<MsCaseLogRecord>> recordMap =null;
|
||||
List<String> mediatorNames = new ArrayList<>();
|
||||
mediatorNames.add(user.getUserName());
|
||||
List<MsCaseLogRecord> recordList = caseLogRecordMapper.selectCompleteByCreateBy(mediatorNames);
|
||||
List<Long> recordCaeIdList = null;
|
||||
if (CollectionUtil.isNotEmpty(recordList)) {
|
||||
// 组装成id对应的list
|
||||
recordMap = recordList.stream().collect(Collectors.groupingBy(MsCaseLogRecord::getCreateBy, Collectors.toList()));
|
||||
recordCaeIdList = recordList.stream().map(MsCaseLogRecord::getCaseAppliId).collect(Collectors.toList());
|
||||
}
|
||||
// 查询待办数量
|
||||
List<Long> mediatorIds = new ArrayList<>();
|
||||
mediatorIds.add(user.getUserId());
|
||||
Map<String, List<MsCaseApplication>> caseMap=null;
|
||||
List<MsCaseApplication> caseApplicationList = msCaseApplicationMapper.listMediator(mediatorIds, recordCaeIdList);
|
||||
if (CollectionUtil.isNotEmpty(caseApplicationList)) {
|
||||
caseMap = caseApplicationList.stream().collect(Collectors.groupingBy(MsCaseApplication::getMediatorId, Collectors.toList()));
|
||||
|
||||
}
|
||||
MediatorVO mediatorVO = new MediatorVO();
|
||||
mediatorVO.setMediatorId(user.getUserId());
|
||||
mediatorVO.setMediatorName(user.getNickName());
|
||||
mediatorVO.setSpecialty(user.getSpecialty());
|
||||
if(recordMap!=null &&recordMap.containsKey(String.valueOf(user.getUserName()))) {
|
||||
mediatorVO.setCompleteAmount(recordMap.get(String.valueOf(user.getUserName())).size());
|
||||
}
|
||||
if(caseMap!=null&&caseMap.containsKey(String.valueOf(user.getUserId()))) {
|
||||
mediatorVO.setTodoAmount(caseMap.get(String.valueOf(user.getUserId())).size());
|
||||
}
|
||||
List<MediatorVO> mediatorVOS = new ArrayList<>();
|
||||
mediatorVOS.add(mediatorVO);
|
||||
result.setMediatorList(mediatorVOS);
|
||||
}
|
||||
if(StrUtil.isNotEmpty(caseApplication.getHearDate())){
|
||||
List<String> herdates = new ArrayList<>();
|
||||
herdates.add(caseApplication.getHearDate());
|
||||
result.setHerDates(herdates);
|
||||
}
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 核实调解员
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
private void verifyMediator(MsCaseApplication application,BookingVO vo) {
|
||||
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(vo.getCaseFlowId());
|
||||
if (nextFlow == null) {
|
||||
throw new ServiceException("未找到下一个流程节点");
|
||||
}
|
||||
setMediatorAndDate(application,vo);
|
||||
application.setCaseFlowId(nextFlow.getNodeId());
|
||||
application.setCaseStatusName(nextFlow.getCaseStatusName());
|
||||
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
// 新增日志
|
||||
CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "");
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -724,6 +883,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
private void accept(MsCaseApplication application, MsCaseApplication req, Map<Long, MsCaseAffiliate> affiliateMap) {
|
||||
application.setUpdateBy(SecurityUtils.getUsername());
|
||||
application.setUpdateTime(new Date());
|
||||
application.setBatchNumber(null);
|
||||
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
MsCaseFlow caseFlow = nextFlow(application.getId(), req.getCaseFlowId(),req.getLockStatus());
|
||||
// 给申请人被申请人发送短信
|
||||
@@ -776,6 +936,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
throw new ServiceException("未找到下一个流程节点");
|
||||
}
|
||||
MsCaseApplication application = new MsCaseApplication();
|
||||
application.setBatchNumber(null);
|
||||
application.setId(caseId);
|
||||
// 更改案件流程id和案件状态
|
||||
application.setCaseFlowId(nextFlow.getId());
|
||||
|
||||
+2
@@ -301,6 +301,8 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
// 新增日志
|
||||
CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"确认已缴费");
|
||||
// todo 发送短信
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+457
@@ -0,0 +1,457 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.mscase.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.enums.AnnexTypeEnum;
|
||||
import com.ruoyi.common.utils.PdfUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlowRoleRelated;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.ReservedConference;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.ReservedConferenceMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService;
|
||||
import com.tencentcloudapi.common.Credential;
|
||||
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||
import com.tencentcloudapi.common.profile.ClientProfile;
|
||||
import com.tencentcloudapi.common.profile.HttpProfile;
|
||||
import com.tencentcloudapi.trtc.v20190722.TrtcClient;
|
||||
import com.tencentcloudapi.trtc.v20190722.models.*;
|
||||
import com.tencentyun.TLSSigAPIv2;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Base64;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
||||
import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile;
|
||||
import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName;
|
||||
|
||||
/**
|
||||
* @author wangqiong
|
||||
* @description 视频录制
|
||||
* @date 2023-10-26 11:45
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class VideoConferenceServiceImpl implements VideoConferenceService {
|
||||
// 腾讯云即时通信sdkAppId
|
||||
@Value("${imConfig.sdkAppId}")
|
||||
private long sdkAppId;
|
||||
// 腾讯云即时通信密钥
|
||||
@Value("${imConfig.sdkSecretKey}")
|
||||
private String sdkSecretKey;
|
||||
// 腾讯云个人账户secretId
|
||||
@Value("${imConfig.secretId}")
|
||||
private String secretId;
|
||||
// 腾讯云个人账户密钥
|
||||
@Value("${imConfig.secretKey}")
|
||||
private String secretKey;
|
||||
@Autowired
|
||||
private MsCaseApplicationMapper caseApplicationMapper;
|
||||
@Autowired
|
||||
private MsCaseAttachMapper caseAttachMapper;
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
@Autowired
|
||||
private ReservedConferenceMapper reservedConferenceMapper;
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
/**
|
||||
视频回调
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void videoRollBack(String fileId,String videoUrl,String roomId) {
|
||||
try {
|
||||
downloadImage(fileId,videoUrl,roomId);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 获取userSign,默认过期时间10小时
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String generateUserSign(String userId) {
|
||||
TLSSigAPIv2 tlsSigAPIv2 = new TLSSigAPIv2(sdkAppId, sdkSecretKey);
|
||||
return tlsSigAPIv2.genUserSig(userId, 60 * 60 * 10);
|
||||
}
|
||||
/**
|
||||
* 预约会议
|
||||
*
|
||||
* @param reservedConferenceVO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public AjaxResult reservedConference(MsReservedConferenceVO reservedConferenceVO) {
|
||||
|
||||
// 新增预约会议表
|
||||
ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), SecurityUtils.getUserId(), reservedConferenceVO.getRoomId(),
|
||||
reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime());
|
||||
reservedConferenceMapper.insert(conference);
|
||||
return success("预约会议成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据案件id查询已预约的会议
|
||||
*
|
||||
* @param caseId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public List<ReservedConference> reserveConferenceList(Long caseId) {
|
||||
List<ReservedConference> reservedConferences = reservedConferenceMapper.selectListByCaseId(caseId);
|
||||
if (CollectionUtil.isEmpty(reservedConferences)) {
|
||||
return reservedConferences;
|
||||
}
|
||||
Map<Long, String> userIdMap = null;
|
||||
List<Long> userIds = reservedConferences.stream().map(ReservedConference::getUserId).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(userIds)) {
|
||||
// 根据userids查询用户名
|
||||
List<SysUser> userList = sysUserMapper.selectUserListByIds(userIds);
|
||||
if (CollectionUtil.isNotEmpty(userList)) {
|
||||
userIdMap = userList.stream().collect(Collectors.toMap(SysUser::getUserId, SysUser::getUserName));
|
||||
}
|
||||
}
|
||||
for (ReservedConference reservedConference : reservedConferences) {
|
||||
if (null != reservedConference.getUserId() && null != userIdMap) {
|
||||
reservedConference.setUserName(userIdMap.get(reservedConference.getUserId()));
|
||||
}
|
||||
Date startTime = reservedConference.getScheduleStartTime();
|
||||
if (null == startTime) {
|
||||
continue;
|
||||
}
|
||||
// 5分钟之内
|
||||
long beforeMinutes = startTime.getTime() - 1000 * 60 * 5;
|
||||
if (System.currentTimeMillis() < beforeMinutes) {
|
||||
reservedConference.setIsBeforeFiveMinutes(true);
|
||||
} else {
|
||||
reservedConference.setIsBeforeFiveMinutes(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return reservedConferences;
|
||||
}
|
||||
/**
|
||||
* 生成房间号
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public String createRoomId(Long caseId) {
|
||||
long roomId = generateRoomId();
|
||||
// 绑定案件与房间号
|
||||
bindCaseId(caseId, String.valueOf(roomId));
|
||||
return String.valueOf(roomId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取房间号
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Long generateRoomId() {
|
||||
// 查询最大房间号
|
||||
Long maxRoomId = caseApplicationMapper.selectMaxRoomId();
|
||||
|
||||
if (null == maxRoomId || maxRoomId > 4294967294L/2) {
|
||||
return 4294967294L/2+1;
|
||||
} else {
|
||||
return maxRoomId + 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult bindCaseId(Long caseId, String roomId) {
|
||||
MsCaseApplication caseApplication = new MsCaseApplication();
|
||||
caseApplication.setId(caseId);
|
||||
caseApplication.setRoomId(roomId);
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(caseApplication);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据案件id查询会议视频
|
||||
* @param caseId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult videoList(Long caseId) {
|
||||
MsCaseApplicationVO caseApplication = new MsCaseApplicationVO();
|
||||
caseApplication.setId(caseId);
|
||||
caseApplication.setAnnexType(AnnexTypeEnum.MEETING_VIDEO.getCode());
|
||||
List<MsCaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication);
|
||||
if(CollectionUtil.isEmpty(caseAttachList)){
|
||||
return success();
|
||||
}
|
||||
return success(caseAttachList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启腾讯云录制
|
||||
* @param roomId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult openCloudRecording(long caseId,long roomId) {
|
||||
try {
|
||||
String userId="recorder_"+roomId;
|
||||
|
||||
Credential cred = new Credential(secretId, secretKey);
|
||||
|
||||
// 实例化一个http选项,可选的,没有特殊需求可以跳过
|
||||
HttpProfile httpProfile = new HttpProfile();
|
||||
httpProfile.setEndpoint("trtc.tencentcloudapi.com");
|
||||
// 实例化一个client选项,可选的,没有特殊需求可以跳过
|
||||
ClientProfile clientProfile = new ClientProfile();
|
||||
clientProfile.setHttpProfile(httpProfile);
|
||||
// 实例化要请求产品的client对象,clientProfile是可选的
|
||||
TrtcClient client = new TrtcClient(cred, "ap-beijing", clientProfile);
|
||||
|
||||
// 实例化一个请求对象,每个接口都会对应一个request对象
|
||||
CreateCloudRecordingRequest req = new CreateCloudRecordingRequest();
|
||||
req.setSdkAppId(sdkAppId); // SdkAppId – TRTC的[SdkAppId](https://cloud.tencent.com/document/product/647/46351#sdkappid),和录制的房间所对应的SdkAppId相同
|
||||
req.setRoomId(String.valueOf(roomId)); // RoomId – TRTC的[RoomId](https://cloud.tencent.com/document/product/647/46351#roomid),录制的TRTC房间所对应的RoomId
|
||||
req.setRoomIdType(1L);
|
||||
/**
|
||||
* 录制机器人用于进入TRTC房间拉流的[UserId](https://cloud.tencent.com/document/product/647/46351#userid),
|
||||
* 注意这个UserId不能与其他TRTC房间内的主播或者其他录制任务等已经使用的UserId重复,建议可以把房间ID作为userId的标识的一部分,
|
||||
* 即录制机器人进入房间的userid应保证独立且唯一
|
||||
*/
|
||||
req.setUserId(userId);
|
||||
|
||||
TLSSigAPIv2 api = new TLSSigAPIv2(sdkAppId, sdkSecretKey);
|
||||
String userSign = api.genUserSig(userId, 60 * 60 * 10);
|
||||
req.setUserSig(userSign); // 录制机器人用于进入TRTC房间拉流的用户签名,当前 UserId 对应的验证签名,相当于登录密码
|
||||
RecordParams recordParams = new RecordParams();
|
||||
// 混流录制
|
||||
recordParams.setMaxIdleTime(60L*5); // 5分钟内房间里面没有主播,自动停止录制
|
||||
recordParams.setStreamType(0L); // 0:录制音频+视频流(默认); 1:仅录制音频流; 2:仅录制视频流
|
||||
recordParams.setRecordMode(2L); // 1:单流录制,分别录制房间的订阅UserId的音频和视频,将录制文件上传至云存储; 2:混流录制,将房间内订阅UserId的音视频混录成一个音视频文件,将录制文件上传至云存储;
|
||||
recordParams.setOutputFormat(0L); // 0:(默认)输出文件为hls格式。1:输出文件格式为hls+mp4。2:输出文件格式为hls+aac
|
||||
MixLayoutParams mixLayoutParams = new MixLayoutParams();
|
||||
// 布局模式: 1:悬浮布局;2:屏幕分享布局;3:九宫格布局(默认);4:自定义布局;
|
||||
mixLayoutParams.setMixLayoutMode(3L);
|
||||
req.setMixLayoutParams(mixLayoutParams);
|
||||
|
||||
StorageParams storageParams1 = new StorageParams();
|
||||
CloudVod cloudVod = new CloudVod();
|
||||
TencentVod tencentVod = new TencentVod();
|
||||
tencentVod.setSubAppId(1304001529L);
|
||||
// 录制的文件永久保存
|
||||
tencentVod.setExpireTime(0L);
|
||||
// 录制文件名拼接前缀
|
||||
tencentVod.setUserDefineRecordId(caseId+"");
|
||||
cloudVod.setTencentVod(tencentVod); // 腾讯云点播相关参数。
|
||||
storageParams1.setCloudVod(cloudVod); // 必填】腾讯云云点播的账号信息,目前仅支持存储至腾讯云点播VOD。
|
||||
req.setRecordParams(recordParams); // 云端录制控制参数
|
||||
req.setStorageParams(storageParams1); // 云端录制文件上传到云存储的参数(目前只支持使用腾讯云点播作为存储)
|
||||
// 返回的resp是一个CreateCloudRecordingResponse的实例,与请求对象对应
|
||||
CreateCloudRecordingResponse resp = client.CreateCloudRecording(req);
|
||||
|
||||
return success((JSONObject) JSON.toJSON(resp));
|
||||
} catch (TencentCloudSDKException e) {
|
||||
return AjaxResult.error(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult closeDeleteCloudRecording(String taskId) {
|
||||
|
||||
try {
|
||||
if (taskId != null) {
|
||||
taskId = taskId.replaceAll(" ", "+");
|
||||
}
|
||||
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密
|
||||
// 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305
|
||||
// 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
|
||||
Credential cred = new Credential(secretId, secretKey);
|
||||
// 实例化一个http选项,可选的,没有特殊需求可以跳过
|
||||
HttpProfile httpProfile = new HttpProfile();
|
||||
httpProfile.setEndpoint("trtc.tencentcloudapi.com");
|
||||
// 实例化一个client选项,可选的,没有特殊需求可以跳过
|
||||
ClientProfile clientProfile = new ClientProfile();
|
||||
clientProfile.setHttpProfile(httpProfile);
|
||||
// 实例化要请求产品的client对象,clientProfile是可选的
|
||||
TrtcClient client = new TrtcClient(cred, "ap-beijing", clientProfile);
|
||||
// 实例化一个请求对象,每个接口都会对应一个request对象
|
||||
DeleteCloudRecordingRequest req = new DeleteCloudRecordingRequest();
|
||||
req.setSdkAppId(sdkAppId); // SdkAppId – TRTC的SDKAppId,和录制的房间所对应的SDKAppId相同
|
||||
req.setTaskId(taskId); // TaskId – 录制任务的唯一Id,在启动录制成功后会返回
|
||||
// 返回的resp是一个DeleteCloudRecordingResponse的实例,与请求对象对应
|
||||
DeleteCloudRecordingResponse resp = client.DeleteCloudRecording(req);
|
||||
// 输出json格式的字符串回包
|
||||
return success((JSONObject) JSON.toJSON(resp));
|
||||
} catch (TencentCloudSDKException e) {
|
||||
return AjaxResult.error(e.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 解散房间
|
||||
* @param roomId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult dissolveRoom( Long roomId) {
|
||||
Credential cred = new Credential(secretId, secretKey);
|
||||
// 实例化一个http选项,可选的,没有特殊需求可以跳过
|
||||
HttpProfile httpProfile = new HttpProfile();
|
||||
httpProfile.setEndpoint("trtc.tencentcloudapi.com");
|
||||
// 实例化一个client选项,可选的,没有特殊需求可以跳过
|
||||
ClientProfile clientProfile = new ClientProfile();
|
||||
clientProfile.setHttpProfile(httpProfile);
|
||||
// 实例化要请求产品的client对象,clientProfile是可选的
|
||||
TrtcClient client = new TrtcClient(cred, "ap-beijing", clientProfile);
|
||||
DismissRoomRequest req = new DismissRoomRequest();
|
||||
req.setSdkAppId(sdkAppId);
|
||||
req.setRoomId(roomId);
|
||||
try {
|
||||
DismissRoomResponse resp = client.DismissRoom(req);
|
||||
return success((JSONObject) JSON.toJSON(resp));
|
||||
} catch (TencentCloudSDKException e) {
|
||||
return AjaxResult.error("解散房间失败");
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 根据userId查询该用户是否是秘书
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult secretaryRoleByUserId(Long userId) {
|
||||
List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
boolean isSecretaryRole=false;
|
||||
if(CollectionUtil.isNotEmpty(roles)){
|
||||
for (SysRole role : roles) {
|
||||
if("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName())){
|
||||
isSecretaryRole=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
jsonObject.put("isSecretaryRole",isSecretaryRole);
|
||||
return success(jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据html字符串转pdf并和案件关联
|
||||
* @param reservedConferenceVO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult htmlToPDF(MsReservedConferenceVO reservedConferenceVO) {
|
||||
String currentFileName = System.currentTimeMillis() + ".pdf";
|
||||
String fileName = null;
|
||||
try {
|
||||
fileName = getPathFileName(RuoYiConfig.getHtml2PDFPath(), currentFileName);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
String htmlContent = "<html><head> <title>庭审笔录</title></head><body style=\"font-size:12.0pt; font-family:SimSun;\"><h1 align=\"center\">庭审笔录</h1>" +reservedConferenceVO.getHtmlContent()+"</body></html>";
|
||||
// html转pdf并上传到服务器
|
||||
boolean convertFlag = PdfUtils.htmlStringConvertToPDF(RuoYiConfig.getHtml2PDFPath() +"/"+ currentFileName, htmlContent);
|
||||
|
||||
// 绑定案件
|
||||
if(convertFlag){
|
||||
MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(reservedConferenceVO.getCaseId())
|
||||
.annexName(fileName)
|
||||
.annexPath(RuoYiConfig.getHtml2PDFPath())
|
||||
.annexType(7)
|
||||
.build();
|
||||
caseAttachMapper.save(caseAttach);
|
||||
return AjaxResult.success();
|
||||
}else {
|
||||
return AjaxResult.error("pdf转换失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 将视频下载到本地
|
||||
* @param fileUrl 视频路径
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
public String downloadImage(String fileId,String fileUrl,String roomId) throws IOException {
|
||||
String staticAndMksDir = null;
|
||||
if (fileUrl != null) {
|
||||
//下载时文件名称
|
||||
String fileName = fileUrl.substring(fileUrl.lastIndexOf("/"));
|
||||
fileName = fileName.replace("/", "");
|
||||
fileName=fileId+fileName;
|
||||
String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), fileName).getAbsolutePath();
|
||||
staticAndMksDir = Paths.get(absPath).toFile().toString();
|
||||
long downloadFile = HttpUtil.downloadFile(fileUrl, staticAndMksDir);
|
||||
if(downloadFile>0) {
|
||||
Example example = new Example(MsCaseFlowRoleRelated.class);
|
||||
example.createCriteria().andEqualTo("romId", roomId);
|
||||
MsCaseApplication caseApplication = caseApplicationMapper.selectOneByExample(example);
|
||||
if(caseApplication != null) {
|
||||
String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName);
|
||||
// 存入数据库
|
||||
MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(caseApplication.getId())
|
||||
.annexName(fileName)
|
||||
.annexPath(annexName)
|
||||
.annexType(AnnexTypeEnum.MEETING_VIDEO.getCode())
|
||||
.build();
|
||||
caseAttachMapper.save(caseAttach);
|
||||
return annexName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
|
||||
}
|
||||
/**
|
||||
* @param key 回调秘钥
|
||||
* @param body 入参
|
||||
* @return 签名 Sign 计算公式中 key 为计算签名 Sign 用的加密密钥。
|
||||
* @throws Exception
|
||||
*/
|
||||
private static String getResultSign(String key, String body) throws Exception {
|
||||
Mac hmacSha256 = Mac.getInstance("HmacSHA256");
|
||||
SecretKeySpec secret_key = new SecretKeySpec(key.getBytes(), "HmacSHA256");
|
||||
hmacSha256.init(secret_key);
|
||||
return Base64.getEncoder().encodeToString(hmacSha256.doFinal(body.getBytes()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -134,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_id = #{userId}
|
||||
where u.user_id = #{userId} and u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectUserByDeptId" parameterType="Long" resultMap="SysUserResult">
|
||||
@@ -320,7 +320,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectUserByRole" resultType="com.ruoyi.common.core.domain.entity.SysUser">
|
||||
select u.user_id,u.user_name,u.nick_name,u.specialty from ms_sys_user u
|
||||
select u.user_id userId,u.user_name userName,u.nick_name nickName,u.specialty from ms_sys_user u
|
||||
join ms_sys_user_role ur on ur.user_id =u.user_id
|
||||
join ms_sys_role r on ur.role_id = r.role_id and r.role_name='调解员'
|
||||
where r.del_flag = '0' and r.status='0' and u.del_flag = '0' and u.status='0'
|
||||
|
||||
+16
@@ -37,4 +37,20 @@
|
||||
<result column="adjudica_counter_reason" jdbcType="LONGVARCHAR" property="adjudicaCounterReason" />
|
||||
<result column="mediation_agreement" jdbcType="LONGVARCHAR" property="mediationAgreement" />
|
||||
</resultMap>
|
||||
|
||||
<select id="listMediator" resultMap="BaseResultMap">
|
||||
select mediator_id ,id from ms_case_application <where>
|
||||
<if test = 'userIds!=null and userIds.size()>0'>
|
||||
and mediator_id in
|
||||
<foreach item='item' index='index' collection='userIds' open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test = 'recordCaeIdList!=null and recordCaeIdList.size()>0'> and id not in
|
||||
<foreach item='id' index='index' collection='recordCaeIdList' open='(' separator=',' close=')'>
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
+8
-2
@@ -12,8 +12,14 @@
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="create_nick_name" jdbcType="VARCHAR" property="createNickName" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="notes" jdbcType="LONGVARCHAR" property="notes" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCompleteByCreateBy" resultMap="BaseResultMap">
|
||||
select create_by,GROUP_CONCAT(DISTINCT case_appli_id) case_appli_id from ms_case_log_record
|
||||
where create_by in <foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
group by create_by,case_appli_id
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user