会议相关,查询案件修改 #206

Merged
wangqiong123 merged 1 commits from wq into dev 2023-11-14 03:36:03 +00:00
11 changed files with 102 additions and 56 deletions
@@ -377,16 +377,24 @@ public class CaseApplicationController extends BaseController {
}
/**
* 腾讯云销毁房间回调
* @param body
* @param request
* 生成房间号
* @return
*/
@Anonymous
@PostMapping("/destroyRoomBack")
public AjaxResult destroyRoomBack( @RequestBody String body, HttpServletRequest request) {
caseApplicationService.destroyRoomBack(body,request);
return success();
@GetMapping("/createRoomId")
public AjaxResult createRoomId(@RequestParam("caseId") Long caseId) {
return success(caseApplicationService.createRoomId(caseId));
}
/**
* 删除房间号
* @return
*/
@Anonymous
@PostMapping("/deleteRoom")
public AjaxResult deleteRoom(@RequestParam("roomId") String roomId) {
return caseApplicationService.deleteRoom(roomId);
}
/**
* 根据案件id查询已预约的会议
@@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://121.40.189.20:3306/smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
url: jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root
password: YMzc157#
# 从库数据源
@@ -18,7 +18,7 @@ ruoyi:
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8080
port: 9001
port: 8001
servlet:
# 应用的访问路径
context-path: /
@@ -176,6 +176,6 @@ identityAuthentication:
# 腾讯云即时通信相关配置
imConfig:
# sdkAppId
sdkAppId: 1600011167
sdkAppId: 1600012141
# 密钥
secretKey: 17d136d9327576a247f991bdfed3a6d14cebc7d540a52245086829c3a1421a86
secretKey: 6075dc0ad9ae26d4186bfdffc192c649f2826140c84974f2e2b882997fcc8a54
@@ -35,14 +35,19 @@ public class ReservedConference {
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date scheduleEndTime;
/**
* 会议类型,0-创建会议,1-预约会议
*/
private Integer roomType;
public ReservedConference() {
}
public ReservedConference(Long caseId, String roomId, Date scheduleStartTime, Date scheduleEndTime) {
public ReservedConference(Long caseId, String roomId, Date scheduleStartTime, Date scheduleEndTime,Integer roomType) {
this.caseId = caseId;
this.roomId = roomId;
this.scheduleStartTime = scheduleStartTime;
this.scheduleEndTime = scheduleEndTime;
this.roomType = roomType;
}
}
@@ -22,7 +22,6 @@ public class ReservedConferenceVO {
/**
* 房间号id
*/
@NotEmpty(message = "房主id不能为空")
private String roomId;
@NotNull(message = "会议开始时间不能为空")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -79,7 +79,7 @@ public interface CaseApplicationMapper {
/**
* 批量删除案件
* @param caseApplication
* @param ids
* @return
*/
int batchDeletecaseApplication(@Param("ids") List<Long> ids);
@@ -104,4 +104,9 @@ public interface CaseApplicationMapper {
* @return
*/
List<CaseApplication> selectHandledCase(CaseApplication caseApplication);
/**
* 查询最大房间号
* @return
*/
Integer selectMaxRoomId();
}
@@ -33,7 +33,7 @@ public interface ReservedConferenceMapper {
* 根据房间号删除
* @param roomId
*/
void deleteByRoomId(@Param("roomId")String roomId);
Integer deleteByRoomId(@Param("roomId")String roomId);
void batchDeleteByIds(@Param("ids") List<Long> ids);
@@ -6,6 +6,7 @@ import com.ruoyi.wisdomarbitrate.domain.*;
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
@@ -98,11 +99,9 @@ public interface ICaseApplicationService {
/**
* 腾讯云销毁房间回调
* @param body
* @param request
* @return
*/
void destroyRoomBack(String body, HttpServletRequest request);
String createRoomId(Long caseId);
/**
* 根据案件id查询已预约的会议
@@ -110,4 +109,6 @@ public interface ICaseApplicationService {
* @return
*/
List<ReservedConference> reserveConferenceList(Long caseId);
AjaxResult deleteRoom( String roomId);
}
@@ -177,7 +177,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
deptIds.add(sysUser.getDeptId());
caseApplication.setDeptIds(deptIds);
}
if (StrUtil.isEmpty(caseApplication.getNameId()) && role.getRoleName().equals("申请人")) {
if ( role.getRoleName().equals("申请人")) {
// 查询角色有关的用户部门
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
}
@@ -185,10 +185,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
//
caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
}
if (role.getRoleName().equals("申请人")) {
//
caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
}
}
@@ -241,9 +238,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
deptIds.add(sysUser.getDeptId());
caseApplication.setDeptIds(deptIds);
}
if (StrUtil.isEmpty(caseApplication.getNameId()) && role.getRoleName().equals("申请人")) {
if ( role.getRoleName().equals("申请人")) {
// 查询角色有关的用户部门
caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
}
if (role.getRoleName().equals("被申请人")) {
//
@@ -2544,6 +2541,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
if (StrUtil.isEmpty(userSign)) {
return AjaxResult.error("生成userSign失败");
}
// 生成房间号id
String roomId = generateRoomId();
Date startTime = reservedConferenceVO.getScheduleStartTime();
Date endTime = reservedConferenceVO.getScheduleEndTime();
Random rand = new Random();
@@ -2555,7 +2554,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
JSONObject bodyParams = new JSONObject();
JSONObject roomParams = new JSONObject();
bodyParams.put("ownerId", reservedConferenceVO.getOwnerId());
bodyParams.put("roomId", reservedConferenceVO.getRoomId());
bodyParams.put("roomId", roomId);
bodyParams.put("scheduleStartTime", startTime);
bodyParams.put("scheduleEndTime", endTime);
@@ -2577,11 +2576,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
switch ((int) resJson.get("errorCode")) {
case 0:
// todo 不需要绑定,以后删 绑定房间号和案件id
caseApplicationMapper.bindCaseId(reservedConferenceVO.getCaseId(), reservedConferenceVO.getRoomId());
caseApplicationMapper.bindCaseId(reservedConferenceVO.getCaseId(), roomId);
// 新增预约会议表
ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), reservedConferenceVO.getRoomId(),
reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime());
ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), roomId,
reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(),1);
reservedConferenceMapper.insert(conference);
return AjaxResult.success("预约会议成功");
@@ -2600,26 +2599,32 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
}
}
/**
* 销毁房间回调
*
* @param body
* @param request
* 生成房间号
*/
@Override
public void destroyRoomBack(String body, HttpServletRequest request) {
// todo 测试回调
reservedConferenceMapper.insert(new ReservedConference(999888L, body, null, null));
JSONObject jsonObject = (JSONObject) JSON.parse(body);
// 事件类型
Integer eventType = jsonObject.getInteger("EventType");
// 事件信息
String eventInfo = jsonObject.getString("EventInfo");
JSONObject eventInfoJson = (JSONObject) JSON.parse(eventInfo);
// 104 退出房间事件
if (eventType == 104) {
// 删除预定会议表
reservedConferenceMapper.deleteByRoomId(eventInfoJson.getString("RoomId"));
public String createRoomId(Long caseId) {
String roomId = generateRoomId();
// 新增预约会议表
ReservedConference conference = new ReservedConference(caseId, roomId,
null, null,0);
reservedConferenceMapper.insert(conference);
return roomId;
}
/**
* 获取房间号
* @return
*/
public String generateRoomId() {
// 查询最大房间号
Integer maxRoomId = caseApplicationMapper.selectMaxRoomId();
if (null == maxRoomId || maxRoomId >999999) {
return "000001";
} else {
return String.format("%06d", maxRoomId);
}
}
@@ -2654,6 +2659,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
}
return result;
}
/**
* 删除房间号
* @param roomId
* @return
*/
@Override
public AjaxResult deleteRoom(String roomId) {
return AjaxResult.success( reservedConferenceMapper.deleteByRoomId(roomId));
}
}
@@ -88,8 +88,15 @@
order by c.create_time desc,c.case_num desc
</select>
<select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
select t1.* from(
select DISTINCT(t.id),t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
select DISTINCT(t1.id),t1.case_num,t1.case_subject_amount,t1.register_date,t1.arbitrat_method,
t1.arbitratMethodName,t1.case_status,t1.caseStatusName,t1.hear_date,t1.arbitrat_claims,
t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable,
t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.update_by,t1.update_time,
t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type,
t1.filearbitra_url,t1.lock_status
from(
select t.id,t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed ,t.claim_liquid_damag,t.fee_payable ,
t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
@@ -118,7 +125,7 @@
applicantName,
c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status
from case_application c
LEFT JOIN (select * from case_affiliate where application_organ_id is not null ) ca ON ca.case_appli_id = c.id
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
<where>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
@@ -163,7 +170,7 @@
</if>
<!--申请人-->
<if test="nameId != null and nameId != ''">
<if test="applicationOrganId != null and applicationOrganId != ''">
or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
and t.case_status in (0,2,17))
@@ -250,8 +257,8 @@
</foreach> )
</if>
<!--申请人-->
<if test="nameId != null and nameId != ''">
or ( t.application_organ_id = #{nameId} AND t.identity_type=1
<if test="applicationOrganId != null and applicationOrganId != ''">
or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
and t.case_status in (0,2,17))
</if>
@@ -616,6 +623,9 @@ order by c.create_time desc limit 1
from case_application where room_id=#{roomId} limit 1
</select>
<select id="selectMaxRoomId" resultType="java.lang.Integer">
select max(room_id+1) as maxRoomId
from reserved_conference ;
</select>
</mapper>
@@ -9,12 +9,14 @@
case_id,
room_id,
schedule_start_time,
schedule_end_time
schedule_end_time,
room_type
)values(
#{caseId},
#{roomId},
#{scheduleStartTime},
#{scheduleEndTime}
#{scheduleEndTime},
#{roomType}
)
</insert>
<delete id="deleteByRoomId">
@@ -28,7 +30,7 @@
</delete>
<select id="selectListByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.ReservedConference">
select id, case_id caseId,room_id roomId,schedule_start_time scheduleStartTime,schedule_end_time scheduleEndTime
from reserved_conference where case_id=#{caseId}
from reserved_conference where case_id=#{caseId} and room_type=1
</select>