瀏覽代碼

合并冲突解决

hejinbo 2 年之前
父節點
當前提交
ffc559543c

+ 2
- 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java 查看文件

@@ -250,8 +250,8 @@ public class SysUserController extends BaseController
250 250
      * @return
251 251
      */
252 252
     @Anonymous
253
-    @GetMapping("/generateUserSign")
254
-    public AjaxResult generateUserSign(@RequestParam(required = true) Long userId){
253
+    @GetMapping("/selectUserById")
254
+    public AjaxResult selectUserById(@RequestParam(required = true) Long userId){
255 255
         return AjaxResult.success(userService.selectUserById(userId));
256 256
     }
257 257
 }

+ 11
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java 查看文件

@@ -388,4 +388,15 @@ public class CaseApplicationController extends BaseController {
388 388
         caseApplicationService.destroyRoomBack(body,request);
389 389
         return success();
390 390
     }
391
+    /**
392
+     * 根据案件id查询已预约的会议
393
+     * @param caseId
394
+     * @return
395
+     */
396
+    @Anonymous
397
+    @GetMapping("/reserveConferenceList")
398
+    public AjaxResult reserveConferenceList(  @RequestParam("caseId") Long caseId) {
399
+
400
+        return  success(caseApplicationService.reserveConferenceList(caseId));
401
+    }
391 402
 }

+ 12
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ReservedConference.java 查看文件

@@ -1,7 +1,10 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain;
2 2
 
3
+import com.fasterxml.jackson.annotation.JsonFormat;
3 4
 import lombok.Data;
4 5
 
6
+import java.util.Date;
7
+
5 8
 /**
6 9
  * @author wangqiong
7 10
  * @description 预定会议
@@ -13,7 +16,7 @@ public class ReservedConference {
13 16
     /**
14 17
      * id
15 18
      */
16
-    private String id;
19
+    private Long id;
17 20
     /**
18 21
      * 案件id
19 22
      */
@@ -25,13 +28,18 @@ public class ReservedConference {
25 28
     /**
26 29
      * 预定会议开始时间
27 30
      */
28
-    private String scheduleStartTime;
31
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
32
+    private Date scheduleStartTime;
29 33
     /**
30 34
      * 预定会议结束时间
31 35
      */
32
-    private String scheduleEndTime;
36
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
37
+    private Date scheduleEndTime;
38
+
39
+    public ReservedConference() {
40
+    }
33 41
 
34
-    public ReservedConference( Long caseId, String roomId, String scheduleStartTime, String scheduleEndTime) {
42
+    public ReservedConference(Long caseId, String roomId, Date scheduleStartTime, Date scheduleEndTime) {
35 43
         this.caseId = caseId;
36 44
         this.roomId = roomId;
37 45
         this.scheduleStartTime = scheduleStartTime;

+ 6
- 8
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ReservedConferenceVO.java 查看文件

@@ -1,9 +1,11 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.vo;
2 2
 
3
+import com.fasterxml.jackson.annotation.JsonFormat;
3 4
 import lombok.Data;
4 5
 
5 6
 import javax.validation.constraints.NotEmpty;
6 7
 import javax.validation.constraints.NotNull;
8
+import java.util.Date;
7 9
 
8 10
 /**
9 11
  * @author wangqiong
@@ -22,16 +24,12 @@ public class ReservedConferenceVO {
22 24
      */
23 25
     @NotEmpty(message = "房主id不能为空")
24 26
     private String roomId;
25
-    /**
26
-     * 会议开始时间
27
-     */
28 27
     @NotNull(message = "会议开始时间不能为空")
29
-    private Integer scheduleStartTime;
30
-    /**
31
-     * 会议结束时间
32
-     */
28
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
29
+    private Date scheduleStartTime;
33 30
     @NotNull(message = "会议结束时间不能为空")
34
-    private Integer scheduleEndTime;
31
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
32
+    private Date scheduleEndTime;
35 33
     @NotNull(message = "案件id不能为空")
36 34
     private Long caseId;
37 35
 }

+ 6
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/SendRoomNoMessageVO.java 查看文件

@@ -1,10 +1,12 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.vo;
2 2
 
3
+import com.fasterxml.jackson.annotation.JsonFormat;
3 4
 import lombok.Data;
4 5
 
5 6
 import javax.validation.constraints.NotEmpty;
6 7
 import javax.validation.constraints.NotNull;
7 8
 import java.io.Serializable;
9
+import java.util.Date;
8 10
 
9 11
 /**
10 12
  * @author wangqiong
@@ -18,7 +20,10 @@ public class SendRoomNoMessageVO implements Serializable {
18 20
     private Long id;
19 21
     @NotEmpty(message = "房间号不能为空")
20 22
     private String roomNo;
21
-
23
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
24
+    private Date scheduleStartTime;
25
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
26
+    private Date scheduleEndTime;
22 27
 
23 28
 
24 29
 }

+ 4
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ReservedConferenceMapper.java 查看文件

@@ -1,7 +1,7 @@
1 1
 package com.ruoyi.wisdomarbitrate.mapper;
2 2
 
3 3
 import com.ruoyi.wisdomarbitrate.domain.ReservedConference;
4
-import org.springframework.data.repository.query.Param;
4
+import org.apache.ibatis.annotations.Param;
5 5
 import org.springframework.stereotype.Repository;
6 6
 
7 7
 
@@ -34,4 +34,7 @@ public interface ReservedConferenceMapper {
34 34
      * @param roomId
35 35
      */
36 36
     void deleteByRoomId(@Param("roomId")String roomId);
37
+
38
+
39
+    void batchDeleteByIds(@Param("ids") List<Long> ids);
37 40
 }

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java 查看文件

@@ -103,4 +103,11 @@ public interface ICaseApplicationService {
103 103
      * @return
104 104
      */
105 105
     void destroyRoomBack(String body, HttpServletRequest request);
106
+
107
+    /**
108
+     * 根据案件id查询已预约的会议
109
+     * @param caseId
110
+     * @return
111
+     */
112
+    List<ReservedConference> reserveConferenceList(Long caseId);
106 113
 }

+ 80
- 16
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java 查看文件

@@ -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
 

+ 9
- 9
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ReservedConferenceMapper.xml 查看文件

@@ -3,14 +3,7 @@
3 3
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 4
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 5
 <mapper namespace="com.ruoyi.wisdomarbitrate.mapper.ReservedConferenceMapper">
6
-    <resultMap type="com.ruoyi.wisdomarbitrate.domain.ReservedConference" id="BaseResult">
7
-        <id     property="id"       column="id"      />
8
-        <result property="caseId"     column="case_id"    />
9
-        <result property="roomId"     column="room_id"    />
10
-        <result property="scheduleStartTime"        column="schedule_start_time"        />
11
-        <result property="scheduleEndTime"  column="schedule_end_time"  />
12 6
 
13
-    </resultMap>
14 7
     <insert id="insert">
15 8
         insert into reserved_conference(
16 9
         case_id,
@@ -27,8 +20,15 @@
27 20
     <delete id="deleteByRoomId">
28 21
         delete from reserved_conference where room_id=#{roomId}
29 22
     </delete>
30
-    <select id="selectListByCaseId" resultMap="BaseResult">
31
-        select * from reserved_conference where case_id=#{caseId}
23
+    <delete id="batchDeleteByIds">
24
+        delete from reserved_conference where id in
25
+        <foreach collection="ids" item="item" open="(" separator="," close=")">
26
+            #{item}
27
+        </foreach>
28
+    </delete>
29
+    <select id="selectListByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.ReservedConference">
30
+        select id, case_id caseId,room_id roomId,schedule_start_time scheduleStartTime,schedule_end_time scheduleEndTime
31
+        from reserved_conference where case_id=#{caseId}
32 32
     </select>
33 33
 
34 34