|
|
@@ -177,7 +177,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
177
|
177
|
deptIds.add(sysUser.getDeptId());
|
|
178
|
178
|
caseApplication.setDeptIds(deptIds);
|
|
179
|
179
|
}
|
|
180
|
|
- if (StrUtil.isEmpty(caseApplication.getNameId()) && role.getRoleName().equals("申请人")) {
|
|
|
180
|
+ if ( role.getRoleName().equals("申请人")) {
|
|
181
|
181
|
// 查询角色有关的用户部门
|
|
182
|
182
|
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
|
183
|
183
|
}
|
|
|
@@ -185,10 +185,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
185
|
185
|
//
|
|
186
|
186
|
caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
|
|
187
|
187
|
}
|
|
188
|
|
- if (role.getRoleName().equals("申请人")) {
|
|
189
|
|
- //
|
|
190
|
|
- caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
|
|
191
|
|
- }
|
|
|
188
|
+
|
|
192
|
189
|
}
|
|
193
|
190
|
|
|
194
|
191
|
|
|
|
@@ -241,9 +238,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
241
|
238
|
deptIds.add(sysUser.getDeptId());
|
|
242
|
239
|
caseApplication.setDeptIds(deptIds);
|
|
243
|
240
|
}
|
|
244
|
|
- if (StrUtil.isEmpty(caseApplication.getNameId()) && role.getRoleName().equals("申请人")) {
|
|
|
241
|
+ if ( role.getRoleName().equals("申请人")) {
|
|
245
|
242
|
// 查询角色有关的用户部门
|
|
246
|
|
- caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
|
|
|
243
|
+ caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
|
247
|
244
|
}
|
|
248
|
245
|
if (role.getRoleName().equals("被申请人")) {
|
|
249
|
246
|
//
|
|
|
@@ -2544,6 +2541,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2544
|
2541
|
if (StrUtil.isEmpty(userSign)) {
|
|
2545
|
2542
|
return AjaxResult.error("生成userSign失败");
|
|
2546
|
2543
|
}
|
|
|
2544
|
+ // 生成房间号id
|
|
|
2545
|
+ String roomId = generateRoomId();
|
|
2547
|
2546
|
Date startTime = reservedConferenceVO.getScheduleStartTime();
|
|
2548
|
2547
|
Date endTime = reservedConferenceVO.getScheduleEndTime();
|
|
2549
|
2548
|
Random rand = new Random();
|
|
|
@@ -2555,7 +2554,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2555
|
2554
|
JSONObject bodyParams = new JSONObject();
|
|
2556
|
2555
|
JSONObject roomParams = new JSONObject();
|
|
2557
|
2556
|
bodyParams.put("ownerId", reservedConferenceVO.getOwnerId());
|
|
2558
|
|
- bodyParams.put("roomId", reservedConferenceVO.getRoomId());
|
|
|
2557
|
+ bodyParams.put("roomId", roomId);
|
|
2559
|
2558
|
bodyParams.put("scheduleStartTime", startTime);
|
|
2560
|
2559
|
bodyParams.put("scheduleEndTime", endTime);
|
|
2561
|
2560
|
|
|
|
@@ -2577,11 +2576,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2577
|
2576
|
switch ((int) resJson.get("errorCode")) {
|
|
2578
|
2577
|
case 0:
|
|
2579
|
2578
|
// todo 不需要绑定,以后删 绑定房间号和案件id
|
|
2580
|
|
- caseApplicationMapper.bindCaseId(reservedConferenceVO.getCaseId(), reservedConferenceVO.getRoomId());
|
|
|
2579
|
+ caseApplicationMapper.bindCaseId(reservedConferenceVO.getCaseId(), roomId);
|
|
2581
|
2580
|
|
|
2582
|
2581
|
// 新增预约会议表
|
|
2583
|
|
- ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), reservedConferenceVO.getRoomId(),
|
|
2584
|
|
- reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime());
|
|
|
2582
|
+ ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), roomId,
|
|
|
2583
|
+ reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(),1);
|
|
2585
|
2584
|
reservedConferenceMapper.insert(conference);
|
|
2586
|
2585
|
return AjaxResult.success("预约会议成功");
|
|
2587
|
2586
|
|
|
|
@@ -2600,26 +2599,32 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2600
|
2599
|
}
|
|
2601
|
2600
|
}
|
|
2602
|
2601
|
|
|
|
2602
|
+
|
|
2603
|
2603
|
/**
|
|
2604
|
|
- * 销毁房间回调
|
|
2605
|
|
- *
|
|
2606
|
|
- * @param body
|
|
2607
|
|
- * @param request
|
|
|
2604
|
+ * 生成房间号
|
|
2608
|
2605
|
*/
|
|
2609
|
2606
|
@Override
|
|
2610
|
|
- public void destroyRoomBack(String body, HttpServletRequest request) {
|
|
2611
|
|
- // todo 测试回调
|
|
2612
|
|
- reservedConferenceMapper.insert(new ReservedConference(999888L, body, null, null));
|
|
2613
|
|
- JSONObject jsonObject = (JSONObject) JSON.parse(body);
|
|
2614
|
|
- // 事件类型
|
|
2615
|
|
- Integer eventType = jsonObject.getInteger("EventType");
|
|
2616
|
|
- // 事件信息
|
|
2617
|
|
- String eventInfo = jsonObject.getString("EventInfo");
|
|
2618
|
|
- JSONObject eventInfoJson = (JSONObject) JSON.parse(eventInfo);
|
|
2619
|
|
- // 104 退出房间事件
|
|
2620
|
|
- if (eventType == 104) {
|
|
2621
|
|
- // 删除预定会议表
|
|
2622
|
|
- reservedConferenceMapper.deleteByRoomId(eventInfoJson.getString("RoomId"));
|
|
|
2607
|
+ public String createRoomId(Long caseId) {
|
|
|
2608
|
+ String roomId = generateRoomId();
|
|
|
2609
|
+ // 新增预约会议表
|
|
|
2610
|
+ ReservedConference conference = new ReservedConference(caseId, roomId,
|
|
|
2611
|
+ null, null,0);
|
|
|
2612
|
+ reservedConferenceMapper.insert(conference);
|
|
|
2613
|
+ return roomId;
|
|
|
2614
|
+ }
|
|
|
2615
|
+
|
|
|
2616
|
+ /**
|
|
|
2617
|
+ * 获取房间号
|
|
|
2618
|
+ * @return
|
|
|
2619
|
+ */
|
|
|
2620
|
+ public String generateRoomId() {
|
|
|
2621
|
+ // 查询最大房间号
|
|
|
2622
|
+ Integer maxRoomId = caseApplicationMapper.selectMaxRoomId();
|
|
|
2623
|
+
|
|
|
2624
|
+ if (null == maxRoomId || maxRoomId >999999) {
|
|
|
2625
|
+ return "000001";
|
|
|
2626
|
+ } else {
|
|
|
2627
|
+ return String.format("%06d", maxRoomId);
|
|
2623
|
2628
|
}
|
|
2624
|
2629
|
|
|
2625
|
2630
|
}
|
|
|
@@ -2654,6 +2659,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2654
|
2659
|
}
|
|
2655
|
2660
|
return result;
|
|
2656
|
2661
|
}
|
|
|
2662
|
+
|
|
|
2663
|
+ /**
|
|
|
2664
|
+ * 删除房间号
|
|
|
2665
|
+ * @param roomId
|
|
|
2666
|
+ * @return
|
|
|
2667
|
+ */
|
|
|
2668
|
+ @Override
|
|
|
2669
|
+ public AjaxResult deleteRoom(String roomId) {
|
|
|
2670
|
+
|
|
|
2671
|
+ return AjaxResult.success( reservedConferenceMapper.deleteByRoomId(roomId));
|
|
|
2672
|
+ }
|
|
2657
|
2673
|
}
|
|
2658
|
2674
|
|
|
2659
|
2675
|
|