소스 검색

Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

wangqiong123 2 년 전
부모
커밋
0a7bf5b54d

+ 15
- 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java 파일 보기

@@ -377,16 +377,24 @@ public class CaseApplicationController extends BaseController {
377 377
     }
378 378
 
379 379
     /**
380
-     * 腾讯云销毁房间回调
381
-     * @param body
382
-     * @param request
380
+     * 生成房间号
383 381
      * @return
384 382
      */
385 383
     @Anonymous
386
-    @PostMapping("/destroyRoomBack")
387
-    public AjaxResult destroyRoomBack(  @RequestBody String body, HttpServletRequest request) {
388
-        caseApplicationService.destroyRoomBack(body,request);
389
-        return success();
384
+    @GetMapping("/createRoomId")
385
+    public AjaxResult createRoomId(@RequestParam("caseId") Long caseId) {
386
+
387
+        return  success(caseApplicationService.createRoomId(caseId));
388
+    }
389
+    /**
390
+     * 删除房间号
391
+     * @return
392
+     */
393
+    @Anonymous
394
+    @PostMapping("/deleteRoom")
395
+    public AjaxResult deleteRoom(@RequestParam("roomId") String roomId) {
396
+
397
+        return  caseApplicationService.deleteRoom(roomId);
390 398
     }
391 399
     /**
392 400
      * 根据案件id查询已预约的会议

+ 1
- 1
ruoyi-admin/src/main/resources/application-druid.yml 파일 보기

@@ -6,7 +6,7 @@ spring:
6 6
         druid:
7 7
             # 主库数据源
8 8
             master:
9
-                url: jdbc:mysql://121.40.189.20:3306/smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
9
+                url: jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
10 10
                 username: root
11 11
                 password: YMzc157#
12 12
             # 从库数据源

+ 3
- 3
ruoyi-admin/src/main/resources/application.yml 파일 보기

@@ -18,7 +18,7 @@ ruoyi:
18 18
 # 开发环境配置
19 19
 server:
20 20
   # 服务器的HTTP端口,默认为8080
21
-  port: 9001
21
+  port: 8001
22 22
   servlet:
23 23
     # 应用的访问路径
24 24
     context-path: /
@@ -176,6 +176,6 @@ identityAuthentication:
176 176
 # 腾讯云即时通信相关配置
177 177
 imConfig:
178 178
   # sdkAppId
179
-  sdkAppId: 1600011167
179
+  sdkAppId: 1600012141
180 180
   # 密钥
181
-  secretKey: 17d136d9327576a247f991bdfed3a6d14cebc7d540a52245086829c3a1421a86
181
+  secretKey: 6075dc0ad9ae26d4186bfdffc192c649f2826140c84974f2e2b882997fcc8a54

+ 6
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ReservedConference.java 파일 보기

@@ -35,14 +35,19 @@ public class ReservedConference {
35 35
      */
36 36
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
37 37
     private Date scheduleEndTime;
38
+    /**
39
+     * 会议类型,0-创建会议,1-预约会议
40
+     */
41
+    private Integer roomType;
38 42
 
39 43
     public ReservedConference() {
40 44
     }
41 45
 
42
-    public ReservedConference(Long caseId, String roomId, Date scheduleStartTime, Date scheduleEndTime) {
46
+    public ReservedConference(Long caseId, String roomId, Date scheduleStartTime, Date scheduleEndTime,Integer roomType) {
43 47
         this.caseId = caseId;
44 48
         this.roomId = roomId;
45 49
         this.scheduleStartTime = scheduleStartTime;
46 50
         this.scheduleEndTime = scheduleEndTime;
51
+        this.roomType = roomType;
47 52
     }
48 53
 }

+ 0
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ReservedConferenceVO.java 파일 보기

@@ -22,7 +22,6 @@ public class ReservedConferenceVO {
22 22
     /**
23 23
      * 房间号id
24 24
      */
25
-    @NotEmpty(message = "房主id不能为空")
26 25
     private String roomId;
27 26
     @NotNull(message = "会议开始时间不能为空")
28 27
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

+ 6
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java 파일 보기

@@ -79,7 +79,7 @@ public interface CaseApplicationMapper {
79 79
 
80 80
     /**
81 81
      * 批量删除案件
82
-     * @param caseApplication
82
+     * @param ids
83 83
      * @return
84 84
      */
85 85
     int batchDeletecaseApplication(@Param("ids") List<Long> ids);
@@ -104,4 +104,9 @@ public interface CaseApplicationMapper {
104 104
      * @return
105 105
      */
106 106
     List<CaseApplication> selectHandledCase(CaseApplication caseApplication);
107
+    /**
108
+     * 查询最大房间号
109
+     * @return
110
+     */
111
+    Integer selectMaxRoomId();
107 112
 }

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ReservedConferenceMapper.java 파일 보기

@@ -33,7 +33,7 @@ public interface ReservedConferenceMapper {
33 33
      * 根据房间号删除
34 34
      * @param roomId
35 35
      */
36
-    void deleteByRoomId(@Param("roomId")String roomId);
36
+    Integer deleteByRoomId(@Param("roomId")String roomId);
37 37
 
38 38
 
39 39
     void batchDeleteByIds(@Param("ids") List<Long> ids);

+ 4
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java 파일 보기

@@ -6,6 +6,7 @@ import com.ruoyi.wisdomarbitrate.domain.*;
6 6
 import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
7 7
 import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
8 8
 import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
9
+import org.springframework.web.bind.annotation.RequestParam;
9 10
 import org.springframework.web.multipart.MultipartFile;
10 11
 
11 12
 import javax.servlet.http.HttpServletRequest;
@@ -98,11 +99,9 @@ public interface ICaseApplicationService {
98 99
 
99 100
     /**
100 101
      * 腾讯云销毁房间回调
101
-     * @param body
102
-     * @param request
103 102
      * @return
104 103
      */
105
-    void destroyRoomBack(String body, HttpServletRequest request);
104
+    String createRoomId(Long caseId);
106 105
 
107 106
     /**
108 107
      * 根据案件id查询已预约的会议
@@ -110,4 +109,6 @@ public interface ICaseApplicationService {
110 109
      * @return
111 110
      */
112 111
     List<ReservedConference> reserveConferenceList(Long caseId);
112
+
113
+    AjaxResult deleteRoom(  String roomId);
113 114
 }

+ 44
- 28
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java 파일 보기

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

+ 17
- 7
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml 파일 보기

@@ -88,8 +88,15 @@
88 88
         order by c.create_time desc,c.case_num desc
89 89
     </select>
90 90
     <select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
91
-        select t1.* from(
92
-        select DISTINCT(t.id),t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
91
+        select DISTINCT(t1.id),t1.case_num,t1.case_subject_amount,t1.register_date,t1.arbitrat_method,
92
+        t1.arbitratMethodName,t1.case_status,t1.caseStatusName,t1.hear_date,t1.arbitrat_claims,
93
+        t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable,
94
+        t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.update_by,t1.update_time,
95
+        t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type,
96
+        t1.filearbitra_url,t1.lock_status
97
+
98
+        from(
99
+        select t.id,t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
93 100
         t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
94 101
         t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed ,t.claim_liquid_damag,t.fee_payable ,
95 102
         t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
@@ -118,7 +125,7 @@
118 125
         applicantName,
119 126
         c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status
120 127
         from case_application c
121
-        LEFT JOIN (select * from case_affiliate where application_organ_id is not null ) ca ON ca.case_appli_id = c.id
128
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
122 129
         <where>
123 130
             <if test="caseStatus != null">
124 131
                 AND c.case_status = #{caseStatus}
@@ -163,7 +170,7 @@
163 170
             </if>
164 171
 
165 172
             <!--申请人-->
166
-            <if test="nameId != null and nameId != ''">
173
+            <if test="applicationOrganId != null and applicationOrganId != ''">
167 174
                 or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
168 175
                 and t.case_status in (0,2,17))
169 176
 
@@ -250,8 +257,8 @@
250 257
                 </foreach> )
251 258
             </if>
252 259
             <!--申请人-->
253
-            <if test="nameId != null and nameId != ''">
254
-                or ( t.application_organ_id = #{nameId} AND t.identity_type=1
260
+            <if test="applicationOrganId != null and applicationOrganId != ''">
261
+                or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
255 262
                 and t.case_status in (0,2,17))
256 263
 
257 264
             </if>
@@ -616,6 +623,9 @@ order by c.create_time desc limit 1
616 623
         from case_application where room_id=#{roomId} limit 1
617 624
     </select>
618 625
 
619
-
626
+    <select id="selectMaxRoomId" resultType="java.lang.Integer">
627
+        select max(room_id+1) as maxRoomId
628
+        from reserved_conference ;
629
+    </select>
620 630
 
621 631
 </mapper>

+ 5
- 3
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ReservedConferenceMapper.xml 파일 보기

@@ -9,12 +9,14 @@
9 9
         case_id,
10 10
         room_id,
11 11
         schedule_start_time,
12
-        schedule_end_time
12
+        schedule_end_time,
13
+        room_type
13 14
         )values(
14 15
                 #{caseId},
15 16
                 #{roomId},
16 17
                 #{scheduleStartTime},
17
-                #{scheduleEndTime}
18
+                #{scheduleEndTime},
19
+                #{roomType}
18 20
         )
19 21
     </insert>
20 22
     <delete id="deleteByRoomId">
@@ -28,7 +30,7 @@
28 30
     </delete>
29 31
     <select id="selectListByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.ReservedConference">
30 32
         select id, case_id caseId,room_id roomId,schedule_start_time scheduleStartTime,schedule_end_time scheduleEndTime
31
-        from reserved_conference where case_id=#{caseId}
33
+        from reserved_conference where case_id=#{caseId} and room_type=1
32 34
     </select>
33 35
 
34 36