|
|
@@ -33,6 +33,13 @@ 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;
|
|
|
@@ -1878,12 +1885,32 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1878
|
1885
|
String returnResult = "短信发送成功";
|
|
1879
|
1886
|
//todo 需要申请模板,申请人,被申请人发送短信通知
|
|
1880
|
1887
|
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
1881
|
|
- request.setTemplateId("1952136");
|
|
|
1888
|
+ String startFormat="";
|
|
|
1889
|
+ String endFormat="";
|
|
|
1890
|
+ // 创建房间短信通知
|
|
|
1891
|
+ if (messageVO.getScheduleStartTime() == null) {
|
|
|
1892
|
+ request.setTemplateId("1983692");
|
|
|
1893
|
+ } else {
|
|
|
1894
|
+ String format = "yyyy/MM/dd HH:mm:ss"; // 目标格式
|
|
|
1895
|
+ Date startDate =messageVO.getScheduleStartTime();
|
|
|
1896
|
+ Date endDate = messageVO.getScheduleEndTime();
|
|
|
1897
|
+ SimpleDateFormat sdf = new SimpleDateFormat(format);
|
|
|
1898
|
+ startFormat = sdf.format(startDate);
|
|
|
1899
|
+ endFormat = sdf.format(endDate);
|
|
|
1900
|
+ // 预约会议短信模板
|
|
|
1901
|
+ request.setTemplateId("1983711");
|
|
|
1902
|
+ }
|
|
|
1903
|
+
|
|
1882
|
1904
|
for (CaseAffiliate caseAffiliate : caseAffiliates) {
|
|
1883
|
1905
|
request.setPhone(caseAffiliate.getContactTelphone());
|
|
1884
|
1906
|
String userId = (null==caseAffiliate.getUserId()?"" : caseAffiliate.getUserId());
|
|
1885
|
|
- request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()+userId});
|
|
1886
|
|
- // 1952136 普通短信 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请在浏览器打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。
|
|
|
1907
|
+ if(messageVO.getScheduleStartTime()==null) {
|
|
|
1908
|
+ // 1983692 开庭审理创建会议通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。
|
|
|
1909
|
+ request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo() + userId});
|
|
|
1910
|
+ }else {
|
|
|
1911
|
+ // 1983711 开庭审理预约会议短信通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},会议时间为{4},请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。
|
|
|
1912
|
+ request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo() + userId,startFormat+"-"+endFormat});
|
|
|
1913
|
+ }
|
|
1887
|
1914
|
Boolean aBoolean = SmsUtils.sendSms(request);
|
|
1888
|
1915
|
//保存短信发送记录
|
|
1889
|
1916
|
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
|
|
@@ -1891,7 +1918,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1891
|
1918
|
smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
|
|
1892
|
1919
|
smsSendRecord.setPhone(request.getPhone());
|
|
1893
|
1920
|
smsSendRecord.setSendTime(new Date());
|
|
1894
|
|
- String content = "尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo()+userId + ",https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。";
|
|
|
1921
|
+ String content="";
|
|
|
1922
|
+ if(messageVO.getScheduleStartTime()==null) {
|
|
|
1923
|
+ content = "尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo() + userId + ",请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。";
|
|
|
1924
|
+ }else {
|
|
|
1925
|
+ content = "尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo() + userId +"会议时间为"+startFormat+"-"+endFormat+ ",请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。";
|
|
|
1926
|
+
|
|
|
1927
|
+ }
|
|
1895
|
1928
|
smsSendRecord.setSendContent(content);
|
|
1896
|
1929
|
|
|
1897
|
1930
|
String userName;
|
|
|
@@ -2477,8 +2510,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2477
|
2510
|
if (StrUtil.isEmpty(userSign)) {
|
|
2478
|
2511
|
return AjaxResult.error("生成userSign失败");
|
|
2479
|
2512
|
}
|
|
2480
|
|
- Integer scheduleStartTime = reservedConferenceVO.getScheduleStartTime();
|
|
2481
|
|
- Integer scheduleEndTime = reservedConferenceVO.getScheduleEndTime();
|
|
|
2513
|
+ Date startTime = reservedConferenceVO.getScheduleStartTime();
|
|
|
2514
|
+ Date endTime = reservedConferenceVO.getScheduleEndTime();
|
|
2482
|
2515
|
Random rand = new Random();
|
|
2483
|
2516
|
int random = rand.nextInt(214748365);
|
|
2484
|
2517
|
String url="https://roomkit.trtc.tencent-cloud.com/room_api/v1/roomctl/create?usersig=" + userSign + "&identifier=" + administrator + "&sdkappid=" + sdkAppId + "&random=" +random + "&contenttype=json";
|
|
|
@@ -2489,8 +2522,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2489
|
2522
|
JSONObject roomParams = new JSONObject();
|
|
2490
|
2523
|
bodyParams.put("ownerId", reservedConferenceVO.getOwnerId());
|
|
2491
|
2524
|
bodyParams.put("roomId", reservedConferenceVO.getRoomId());
|
|
2492
|
|
- bodyParams.put("scheduleStartTime", scheduleStartTime);
|
|
2493
|
|
- bodyParams.put("scheduleEndTime",scheduleEndTime);
|
|
|
2525
|
+ bodyParams.put("scheduleStartTime",startTime.getTime()/1000 );
|
|
|
2526
|
+ bodyParams.put("scheduleEndTime",endTime.getTime()/1000);
|
|
2494
|
2527
|
roomParams.put("roomType", 1);
|
|
2495
|
2528
|
bodyParams.put("roomInfo", roomParams);
|
|
2496
|
2529
|
StringEntity postingString = new StringEntity(bodyParams.toString());
|
|
|
@@ -2508,15 +2541,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2508
|
2541
|
case 0:
|
|
2509
|
2542
|
// todo 不需要绑定,以后删 绑定房间号和案件id
|
|
2510
|
2543
|
caseApplicationMapper.bindCaseId(reservedConferenceVO.getCaseId(), reservedConferenceVO.getRoomId());
|
|
2511
|
|
- String format = "yyyy-MM-dd HH:mm:ss"; // 目标格式
|
|
2512
|
|
- Date startDate = new Date(scheduleStartTime);
|
|
2513
|
|
- Date endDate = new Date(scheduleEndTime);
|
|
2514
|
|
- SimpleDateFormat sdf = new SimpleDateFormat(format);
|
|
2515
|
|
- String startFormat = sdf.format(startDate);
|
|
2516
|
|
- String endFormat = sdf.format(endDate);
|
|
|
2544
|
+
|
|
2517
|
2545
|
// 新增预约会议表
|
|
2518
|
2546
|
ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), reservedConferenceVO.getRoomId(),
|
|
2519
|
|
- startFormat, endFormat);
|
|
|
2547
|
+ reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime());
|
|
2520
|
2548
|
reservedConferenceMapper.insert(conference);
|
|
2521
|
2549
|
return AjaxResult.success("预约会议成功");
|
|
2522
|
2550
|
|
|
|
@@ -2527,7 +2555,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2527
|
2555
|
case 84005:
|
|
2528
|
2556
|
return AjaxResult.error("房间号已被占用");
|
|
2529
|
2557
|
default:
|
|
2530
|
|
- return AjaxResult.error("预约会议失败");
|
|
|
2558
|
+ return AjaxResult.error(resJson.getString("errorMessage"));
|
|
2531
|
2559
|
}
|
|
2532
|
2560
|
|
|
2533
|
2561
|
} else {
|
|
|
@@ -2542,6 +2570,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2542
|
2570
|
*/
|
|
2543
|
2571
|
@Override
|
|
2544
|
2572
|
public void destroyRoomBack(String body, HttpServletRequest request) {
|
|
|
2573
|
+ // todo 测试回调
|
|
|
2574
|
+ reservedConferenceMapper.insert(new ReservedConference(999888L,body,null,null));
|
|
2545
|
2575
|
JSONObject jsonObject = (JSONObject) JSON.parse(body);
|
|
2546
|
2576
|
// 事件类型
|
|
2547
|
2577
|
Integer eventType = jsonObject.getInteger("EventType");
|
|
|
@@ -2562,12 +2592,29 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2562
|
2592
|
* @return
|
|
2563
|
2593
|
*/
|
|
2564
|
2594
|
@Override
|
|
|
2595
|
+ @Transactional
|
|
2565
|
2596
|
public List<ReservedConference> reserveConferenceList(Long caseId) {
|
|
2566
|
|
-
|
|
2567
|
|
- return reservedConferenceMapper.selectListByCaseId(caseId);
|
|
|
2597
|
+ List<ReservedConference> reservedConferences = reservedConferenceMapper.selectListByCaseId(caseId);
|
|
|
2598
|
+ List<ReservedConference> result = new ArrayList<>();
|
|
|
2599
|
+ // 判断当前时间是否大于结束时间,如果大于,则把该房间删掉
|
|
|
2600
|
+ if (CollectionUtil.isNotEmpty(reservedConferences)) {
|
|
|
2601
|
+ List<Long> ids = new ArrayList<>();
|
|
|
2602
|
+ for (ReservedConference reservedConference : reservedConferences) {
|
|
|
2603
|
+ Date endTime = reservedConference.getScheduleEndTime();
|
|
|
2604
|
+ Date now = new Date();
|
|
|
2605
|
+ if (now.after(endTime)) {
|
|
|
2606
|
+ ids.add(reservedConference.getId());
|
|
|
2607
|
+ } else {
|
|
|
2608
|
+ result.add(reservedConference);
|
|
|
2609
|
+ }
|
|
|
2610
|
+ }
|
|
|
2611
|
+ if (CollectionUtil.isNotEmpty(ids)) {
|
|
|
2612
|
+ // 根据id批量删除
|
|
|
2613
|
+ reservedConferenceMapper.batchDeleteByIds(ids);
|
|
|
2614
|
+ }
|
|
|
2615
|
+ }
|
|
|
2616
|
+ return result;
|
|
2568
|
2617
|
}
|
|
2569
|
|
-
|
|
2570
|
|
-
|
|
2571
|
2618
|
}
|
|
2572
|
2619
|
|
|
2573
|
2620
|
|