会议相关,查询案件修改

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