会议相关,查询案件修改

This commit is contained in:
18792927508
2023-11-14 11:35:26 +08:00
parent 8a7dfec1d6
commit a6731e8595
11 changed files with 102 additions and 56 deletions
@@ -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));
}
}