Browse Source

会议相关,查询案件修改

18792927508 2 years ago
parent
commit
a6731e8595

+ 15
- 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java View File

377
     }
377
     }
378
 
378
 
379
     /**
379
     /**
380
-     * 腾讯云销毁房间回调
381
-     * @param body
382
-     * @param request
380
+     * 生成房间号
383
      * @return
381
      * @return
384
      */
382
      */
385
     @Anonymous
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
      * 根据案件id查询已预约的会议
400
      * 根据案件id查询已预约的会议

+ 1
- 1
ruoyi-admin/src/main/resources/application-druid.yml View File

6
         druid:
6
         druid:
7
             # 主库数据源
7
             # 主库数据源
8
             master:
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
                 username: root
10
                 username: root
11
                 password: YMzc157#
11
                 password: YMzc157#
12
             # 从库数据源
12
             # 从库数据源

+ 3
- 3
ruoyi-admin/src/main/resources/application.yml View File

18
 # 开发环境配置
18
 # 开发环境配置
19
 server:
19
 server:
20
   # 服务器的HTTP端口,默认为8080
20
   # 服务器的HTTP端口,默认为8080
21
-  port: 9001
21
+  port: 8001
22
   servlet:
22
   servlet:
23
     # 应用的访问路径
23
     # 应用的访问路径
24
     context-path: /
24
     context-path: /
176
 # 腾讯云即时通信相关配置
176
 # 腾讯云即时通信相关配置
177
 imConfig:
177
 imConfig:
178
   # sdkAppId
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 View File

35
      */
35
      */
36
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
36
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
37
     private Date scheduleEndTime;
37
     private Date scheduleEndTime;
38
+    /**
39
+     * 会议类型,0-创建会议,1-预约会议
40
+     */
41
+    private Integer roomType;
38
 
42
 
39
     public ReservedConference() {
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
         this.caseId = caseId;
47
         this.caseId = caseId;
44
         this.roomId = roomId;
48
         this.roomId = roomId;
45
         this.scheduleStartTime = scheduleStartTime;
49
         this.scheduleStartTime = scheduleStartTime;
46
         this.scheduleEndTime = scheduleEndTime;
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 View File

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

+ 6
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java View File

79
 
79
 
80
     /**
80
     /**
81
      * 批量删除案件
81
      * 批量删除案件
82
-     * @param caseApplication
82
+     * @param ids
83
      * @return
83
      * @return
84
      */
84
      */
85
     int batchDeletecaseApplication(@Param("ids") List<Long> ids);
85
     int batchDeletecaseApplication(@Param("ids") List<Long> ids);
104
      * @return
104
      * @return
105
      */
105
      */
106
     List<CaseApplication> selectHandledCase(CaseApplication caseApplication);
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 View File

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

+ 4
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java View File

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

177
                     deptIds.add(sysUser.getDeptId());
177
                     deptIds.add(sysUser.getDeptId());
178
                     caseApplication.setDeptIds(deptIds);
178
                     caseApplication.setDeptIds(deptIds);
179
                 }
179
                 }
180
-                if (StrUtil.isEmpty(caseApplication.getNameId()) && role.getRoleName().equals("申请人")) {
180
+                if (  role.getRoleName().equals("申请人")) {
181
                     // 查询角色有关的用户部门
181
                     // 查询角色有关的用户部门
182
                     caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
182
                     caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
183
                 }
183
                 }
185
                     //
185
                     //
186
                     caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
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
                 deptIds.add(sysUser.getDeptId());
238
                 deptIds.add(sysUser.getDeptId());
242
                 caseApplication.setDeptIds(deptIds);
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
             if (role.getRoleName().equals("被申请人")) {
245
             if (role.getRoleName().equals("被申请人")) {
249
                 //
246
                 //
2544
         if (StrUtil.isEmpty(userSign)) {
2541
         if (StrUtil.isEmpty(userSign)) {
2545
             return AjaxResult.error("生成userSign失败");
2542
             return AjaxResult.error("生成userSign失败");
2546
         }
2543
         }
2544
+        // 生成房间号id
2545
+        String roomId = generateRoomId();
2547
         Date startTime = reservedConferenceVO.getScheduleStartTime();
2546
         Date startTime = reservedConferenceVO.getScheduleStartTime();
2548
         Date endTime = reservedConferenceVO.getScheduleEndTime();
2547
         Date endTime = reservedConferenceVO.getScheduleEndTime();
2549
         Random rand = new Random();
2548
         Random rand = new Random();
2555
         JSONObject bodyParams = new JSONObject();
2554
         JSONObject bodyParams = new JSONObject();
2556
         JSONObject roomParams = new JSONObject();
2555
         JSONObject roomParams = new JSONObject();
2557
         bodyParams.put("ownerId", reservedConferenceVO.getOwnerId());
2556
         bodyParams.put("ownerId", reservedConferenceVO.getOwnerId());
2558
-        bodyParams.put("roomId", reservedConferenceVO.getRoomId());
2557
+        bodyParams.put("roomId", roomId);
2559
         bodyParams.put("scheduleStartTime", startTime);
2558
         bodyParams.put("scheduleStartTime", startTime);
2560
         bodyParams.put("scheduleEndTime", endTime);
2559
         bodyParams.put("scheduleEndTime", endTime);
2561
 
2560
 
2577
             switch ((int) resJson.get("errorCode")) {
2576
             switch ((int) resJson.get("errorCode")) {
2578
                 case 0:
2577
                 case 0:
2579
                     // todo  不需要绑定,以后删        绑定房间号和案件id
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
                     reservedConferenceMapper.insert(conference);
2584
                     reservedConferenceMapper.insert(conference);
2586
                     return AjaxResult.success("预约会议成功");
2585
                     return AjaxResult.success("预约会议成功");
2587
 
2586
 
2600
         }
2599
         }
2601
     }
2600
     }
2602
 
2601
 
2602
+
2603
     /**
2603
     /**
2604
-     * 销毁房间回调
2605
-     *
2606
-     * @param body
2607
-     * @param request
2604
+     * 生成房间号
2608
      */
2605
      */
2609
     @Override
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
         }
2659
         }
2655
         return result;
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 View File

88
         order by c.create_time desc,c.case_num desc
88
         order by c.create_time desc,c.case_num desc
89
     </select>
89
     </select>
90
     <select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
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
         t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
100
         t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
94
         t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed ,t.claim_liquid_damag,t.fee_payable ,
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
         t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
102
         t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
118
         applicantName,
125
         applicantName,
119
         c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status
126
         c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status
120
         from case_application c
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
         <where>
129
         <where>
123
             <if test="caseStatus != null">
130
             <if test="caseStatus != null">
124
                 AND c.case_status = #{caseStatus}
131
                 AND c.case_status = #{caseStatus}
163
             </if>
170
             </if>
164
 
171
 
165
             <!--申请人-->
172
             <!--申请人-->
166
-            <if test="nameId != null and nameId != ''">
173
+            <if test="applicationOrganId != null and applicationOrganId != ''">
167
                 or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
174
                 or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
168
                 and t.case_status in (0,2,17))
175
                 and t.case_status in (0,2,17))
169
 
176
 
250
                 </foreach> )
257
                 </foreach> )
251
             </if>
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
                 and t.case_status in (0,2,17))
262
                 and t.case_status in (0,2,17))
256
 
263
 
257
             </if>
264
             </if>
616
         from case_application where room_id=#{roomId} limit 1
623
         from case_application where room_id=#{roomId} limit 1
617
     </select>
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
 </mapper>
631
 </mapper>

+ 5
- 3
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ReservedConferenceMapper.xml View File

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