|
|
@@ -20,19 +20,26 @@ import com.ruoyi.common.utils.*;
|
|
20
|
20
|
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
|
21
|
21
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
22
|
22
|
import com.ruoyi.system.domain.SysUserRole;
|
|
|
23
|
+import com.ruoyi.system.mapper.SysDeptMapper;
|
|
23
|
24
|
import com.ruoyi.system.mapper.SysRoleMapper;
|
|
24
|
25
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
25
|
26
|
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
|
26
|
27
|
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
|
|
27
|
28
|
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
|
|
28
|
29
|
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
|
29
|
|
-import com.ruoyi.system.mapper.SysDeptMapper;
|
|
30
|
30
|
import com.ruoyi.wisdomarbitrate.domain.*;
|
|
31
|
31
|
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
|
|
32
|
32
|
import com.ruoyi.wisdomarbitrate.mapper.*;
|
|
33
|
33
|
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
|
34
|
34
|
import com.ruoyi.wisdomarbitrate.utils.SignAward;
|
|
35
|
35
|
import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
|
|
|
36
|
+import com.tencentcloudapi.common.Credential;
|
|
|
37
|
+import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
|
|
38
|
+import com.tencentcloudapi.common.profile.ClientProfile;
|
|
|
39
|
+import com.tencentcloudapi.common.profile.HttpProfile;
|
|
|
40
|
+import com.tencentcloudapi.trtc.v20190722.TrtcClient;
|
|
|
41
|
+import com.tencentcloudapi.trtc.v20190722.models.DismissRoomByStrRoomIdRequest;
|
|
|
42
|
+import com.tencentcloudapi.trtc.v20190722.models.DismissRoomByStrRoomIdResponse;
|
|
36
|
43
|
import com.tencentyun.TLSSigAPIv2;
|
|
37
|
44
|
import org.apache.http.HttpEntity;
|
|
38
|
45
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
|
@@ -1898,11 +1905,34 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1898
|
1905
|
String returnResult = "短信发送成功";
|
|
1899
|
1906
|
//todo 需要申请模板,申请人,被申请人发送短信通知
|
|
1900
|
1907
|
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
1901
|
|
- request.setTemplateId("1952136");
|
|
|
1908
|
+ String startFormat="";
|
|
|
1909
|
+ String endFormat="";
|
|
|
1910
|
+ // 创建房间短信通知
|
|
|
1911
|
+ if (messageVO.getScheduleStartTime() == null) {
|
|
|
1912
|
+ request.setTemplateId("1983692");
|
|
|
1913
|
+ } else {
|
|
|
1914
|
+ String format = "yyyy/MM/dd HH:mm:ss"; // 目标格式
|
|
|
1915
|
+ Date startDate =messageVO.getScheduleStartTime();
|
|
|
1916
|
+ Date endDate = messageVO.getScheduleEndTime();
|
|
|
1917
|
+ SimpleDateFormat sdf = new SimpleDateFormat(format);
|
|
|
1918
|
+ startFormat = sdf.format(startDate);
|
|
|
1919
|
+ endFormat = sdf.format(endDate);
|
|
|
1920
|
+ // 预约会议短信模板
|
|
|
1921
|
+ request.setTemplateId("1983711");
|
|
|
1922
|
+ }
|
|
|
1923
|
+
|
|
1902
|
1924
|
for (CaseAffiliate caseAffiliate : caseAffiliates) {
|
|
1903
|
1925
|
request.setPhone(caseAffiliate.getContactTelphone());
|
|
1904
|
1926
|
request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo() + caseAffiliate.getUserId()});
|
|
1905
|
1927
|
// 1952136 普通短信 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请在浏览器打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。
|
|
|
1928
|
+ String userId = (null==caseAffiliate.getUserId()?"" : caseAffiliate.getUserId());
|
|
|
1929
|
+ if(messageVO.getScheduleStartTime()==null) {
|
|
|
1930
|
+ // 1983692 开庭审理创建会议通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。
|
|
|
1931
|
+ request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo() + userId});
|
|
|
1932
|
+ }else {
|
|
|
1933
|
+ // 1983711 开庭审理预约会议短信通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},会议时间为{4},请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。
|
|
|
1934
|
+ request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo() + userId,startFormat+"-"+endFormat});
|
|
|
1935
|
+ }
|
|
1906
|
1936
|
Boolean aBoolean = SmsUtils.sendSms(request);
|
|
1907
|
1937
|
//保存短信发送记录
|
|
1908
|
1938
|
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
|
|
@@ -1910,7 +1940,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1910
|
1940
|
smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
|
|
1911
|
1941
|
smsSendRecord.setPhone(request.getPhone());
|
|
1912
|
1942
|
smsSendRecord.setSendTime(new Date());
|
|
1913
|
|
- String content = "尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo() + caseAffiliate.getUserId() + ",请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。";
|
|
|
1943
|
+ String content = "";
|
|
|
1944
|
+ if(messageVO.getScheduleStartTime()==null) {
|
|
|
1945
|
+ content = "尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo() + userId + ",请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。";
|
|
|
1946
|
+ }else {
|
|
|
1947
|
+ content = "尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo() + userId +"会议时间为"+startFormat+"-"+endFormat+ ",请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。";
|
|
|
1948
|
+
|
|
|
1949
|
+ }
|
|
1914
|
1950
|
smsSendRecord.setSendContent(content);
|
|
1915
|
1951
|
|
|
1916
|
1952
|
String userName;
|
|
|
@@ -2499,8 +2535,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2499
|
2535
|
if (StrUtil.isEmpty(userSign)) {
|
|
2500
|
2536
|
return AjaxResult.error("生成userSign失败");
|
|
2501
|
2537
|
}
|
|
2502
|
|
- Integer scheduleStartTime = reservedConferenceVO.getScheduleStartTime();
|
|
2503
|
|
- Integer scheduleEndTime = reservedConferenceVO.getScheduleEndTime();
|
|
|
2538
|
+ Date startTime = reservedConferenceVO.getScheduleStartTime();
|
|
|
2539
|
+ Date endTime = reservedConferenceVO.getScheduleEndTime();
|
|
2504
|
2540
|
Random rand = new Random();
|
|
2505
|
2541
|
int random = rand.nextInt(214748365);
|
|
2506
|
2542
|
String url = "https://roomkit.trtc.tencent-cloud.com/room_api/v1/roomctl/create?usersig=" + userSign + "&identifier=" + administrator + "&sdkappid=" + sdkAppId + "&random=" + random + "&contenttype=json";
|
|
|
@@ -2511,8 +2547,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2511
|
2547
|
JSONObject roomParams = new JSONObject();
|
|
2512
|
2548
|
bodyParams.put("ownerId", reservedConferenceVO.getOwnerId());
|
|
2513
|
2549
|
bodyParams.put("roomId", reservedConferenceVO.getRoomId());
|
|
2514
|
|
- bodyParams.put("scheduleStartTime", scheduleStartTime);
|
|
2515
|
|
- bodyParams.put("scheduleEndTime", scheduleEndTime);
|
|
|
2550
|
+ bodyParams.put("scheduleStartTime", startTime);
|
|
|
2551
|
+ bodyParams.put("scheduleEndTime", endTime);
|
|
|
2552
|
+
|
|
|
2553
|
+ bodyParams.put("scheduleStartTime",startTime.getTime()/1000 );
|
|
|
2554
|
+ bodyParams.put("scheduleEndTime",endTime.getTime()/1000);
|
|
2516
|
2555
|
roomParams.put("roomType", 1);
|
|
2517
|
2556
|
bodyParams.put("roomInfo", roomParams);
|
|
2518
|
2557
|
StringEntity postingString = new StringEntity(bodyParams.toString());
|
|
|
@@ -2530,15 +2569,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2530
|
2569
|
case 0:
|
|
2531
|
2570
|
// todo 不需要绑定,以后删 绑定房间号和案件id
|
|
2532
|
2571
|
caseApplicationMapper.bindCaseId(reservedConferenceVO.getCaseId(), reservedConferenceVO.getRoomId());
|
|
2533
|
|
- String format = "yyyy-MM-dd HH:mm:ss"; // 目标格式
|
|
2534
|
|
- Date startDate = new Date(scheduleStartTime);
|
|
2535
|
|
- Date endDate = new Date(scheduleEndTime);
|
|
2536
|
|
- SimpleDateFormat sdf = new SimpleDateFormat(format);
|
|
2537
|
|
- String startFormat = sdf.format(startDate);
|
|
2538
|
|
- String endFormat = sdf.format(endDate);
|
|
|
2572
|
+
|
|
2539
|
2573
|
// 新增预约会议表
|
|
2540
|
2574
|
ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), reservedConferenceVO.getRoomId(),
|
|
2541
|
|
- startFormat, endFormat);
|
|
|
2575
|
+ reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime());
|
|
2542
|
2576
|
reservedConferenceMapper.insert(conference);
|
|
2543
|
2577
|
return AjaxResult.success("预约会议成功");
|
|
2544
|
2578
|
|
|
|
@@ -2549,7 +2583,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2549
|
2583
|
case 84005:
|
|
2550
|
2584
|
return AjaxResult.error("房间号已被占用");
|
|
2551
|
2585
|
default:
|
|
2552
|
|
- return AjaxResult.error("预约会议失败");
|
|
|
2586
|
+ return AjaxResult.error(resJson.getString("errorMessage"));
|
|
2553
|
2587
|
}
|
|
2554
|
2588
|
|
|
2555
|
2589
|
} else {
|
|
|
@@ -2565,6 +2599,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2565
|
2599
|
*/
|
|
2566
|
2600
|
@Override
|
|
2567
|
2601
|
public void destroyRoomBack(String body, HttpServletRequest request) {
|
|
|
2602
|
+ // todo 测试回调
|
|
|
2603
|
+ reservedConferenceMapper.insert(new ReservedConference(999888L,body,null,null));
|
|
2568
|
2604
|
JSONObject jsonObject = (JSONObject) JSON.parse(body);
|
|
2569
|
2605
|
// 事件类型
|
|
2570
|
2606
|
Integer eventType = jsonObject.getInteger("EventType");
|
|
|
@@ -2579,7 +2615,35 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2579
|
2615
|
|
|
2580
|
2616
|
}
|
|
2581
|
2617
|
|
|
2582
|
|
-
|
|
|
2618
|
+ /**
|
|
|
2619
|
+ * 根据案件id查询已预约的会议
|
|
|
2620
|
+ * @param caseId
|
|
|
2621
|
+ * @return
|
|
|
2622
|
+ */
|
|
|
2623
|
+ @Override
|
|
|
2624
|
+ @Transactional
|
|
|
2625
|
+ public List<ReservedConference> reserveConferenceList(Long caseId) {
|
|
|
2626
|
+ List<ReservedConference> reservedConferences = reservedConferenceMapper.selectListByCaseId(caseId);
|
|
|
2627
|
+ List<ReservedConference> result = new ArrayList<>();
|
|
|
2628
|
+ // 判断当前时间是否大于结束时间,如果大于,则把该房间删掉
|
|
|
2629
|
+ if (CollectionUtil.isNotEmpty(reservedConferences)) {
|
|
|
2630
|
+ List<Long> ids = new ArrayList<>();
|
|
|
2631
|
+ for (ReservedConference reservedConference : reservedConferences) {
|
|
|
2632
|
+ Date endTime = reservedConference.getScheduleEndTime();
|
|
|
2633
|
+ Date now = new Date();
|
|
|
2634
|
+ if (now.after(endTime)) {
|
|
|
2635
|
+ ids.add(reservedConference.getId());
|
|
|
2636
|
+ } else {
|
|
|
2637
|
+ result.add(reservedConference);
|
|
|
2638
|
+ }
|
|
|
2639
|
+ }
|
|
|
2640
|
+ if (CollectionUtil.isNotEmpty(ids)) {
|
|
|
2641
|
+ // 根据id批量删除
|
|
|
2642
|
+ reservedConferenceMapper.batchDeleteByIds(ids);
|
|
|
2643
|
+ }
|
|
|
2644
|
+ }
|
|
|
2645
|
+ return result;
|
|
|
2646
|
+ }
|
|
2583
|
2647
|
}
|
|
2584
|
2648
|
|
|
2585
|
2649
|
|