18792927508 il y a 2 ans
Parent
révision
c39cd5babd

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java Voir le fichier

@@ -50,5 +50,9 @@ public class  CaseAttach {
50 50
      * 印章状态(0未启用,1已启用)
51 51
      */
52 52
     private Integer sealStatus;
53
+    /**
54
+     * 是否是证据上传,0-否,1-是
55
+     */
56
+    private Integer isBatchUpload;
53 57
 
54 58
 }

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ReservedConference.java Voir le fichier

@@ -39,6 +39,10 @@ public class ReservedConference {
39 39
      */
40 40
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
41 41
     private Date scheduleEndTime;
42
+    /**
43
+     * 是否超过5分钟
44
+     */
45
+    private Boolean isBeforeFiveMinutes;
42 46
 
43 47
 
44 48
     public ReservedConference() {

+ 2
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java Voir le fichier

@@ -27,9 +27,9 @@ public interface CaseAttachMapper {
27 27
     CaseAttach queryAnnexById(Integer annexId);
28 28
 
29 29
     /**
30
-     * 根据案件id和附件类型删除
30
+     * 根据案件id和附件类型删除和上传类型
31 31
      * @param caseAppliId
32 32
      * @param annexType
33 33
      */
34
-    void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType);
34
+    void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType,@Param("isBatchUpload") int isBatchUpload);
35 35
 }

+ 26
- 8
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java Voir le fichier

@@ -146,10 +146,10 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
146 146
                 List<CaseAttach> attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication);
147 147
                 // 更新记录附件表
148 148
                 if(CollectionUtil.isNotEmpty(attachLogList)){
149
-                    caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2);
149
+                //    caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2,0);
150 150
                     for (CaseAttach caseAttach : attachLogList) {
151 151
                         caseAttach.setCaseAppliId(vo.getCaseId());
152
-                        caseAttachMapper.save(caseAttach);
152
+                        caseAttachMapper.updateCaseAttach(caseAttach);
153 153
                     }
154 154
                 }
155 155
              //   caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
@@ -202,7 +202,6 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
202 202
             return AjaxResult.success();
203 203
         }
204 204
 
205
-        // todo 给申请人发送短信
206 205
         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
207 206
         request.setTemplateId("1996949");
208 207
         request.setPhone(caseAffiliate.getContactTelphone());
@@ -337,12 +336,12 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
337 336
 
338 337
 
339 338
         }
340
-        boolean notEmptyFlag = CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isEmpty(beforeCase.getCaseAttachList());
341
-        boolean emptyFlag = CollectionUtil.isEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList());
339
+        boolean notEmptyFlag = CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isEmpty(afterCase.getCaseAttachList());
340
+        boolean emptyFlag = CollectionUtil.isEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(afterCase.getCaseAttachList());
342 341
         // 对比附件
343 342
         if(notEmptyFlag || emptyFlag){
344 343
             changeColumn.append("fileColumn");
345
-        }else if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){
344
+        }else if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
346 345
             if(beforeCase.getCaseAttachList().size()!=afterCase.getCaseAttachList().size()){
347 346
                 changeColumn.append("fileColumn");
348 347
             }else {
@@ -360,6 +359,25 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
360 359
 
361 360
         }
362 361
         compareCaseVO.setChangeColumn(changeColumn.toString());
362
+        if(CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
363
+            List<CaseAttach> caseAttachList = afterCase.getCaseAttachList();
364
+            for (CaseAttach attach : caseAttachList) {
365
+                    String annexName = attach.getAnnexName();
366
+                    String prefix = "/profile";
367
+                    int startIndex = annexName.indexOf(prefix);
368
+                    startIndex += prefix.length();
369
+                    String annexPath = "/uploadPath" + annexName.substring(startIndex);
370
+                    attach.setAnnexPath(annexPath);
371
+                    int startIndexnew = annexName.lastIndexOf("/");
372
+                    if (startIndexnew != -1) {
373
+                        String annexNamenew = annexName.substring(startIndexnew + 1);
374
+                        attach.setAnnexName(annexNamenew);
375
+                    }
376
+
377
+
378
+                }
379
+            afterCase.setCaseAttachList(caseAttachList);
380
+        }
363 381
 
364 382
         return AjaxResult.success(compareCaseVO);
365 383
     }
@@ -406,10 +424,10 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
406 424
         List<CaseAttach> attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication);
407 425
         // 更新记录附件表
408 426
         if(CollectionUtil.isNotEmpty(attachLogList)){
409
-            caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2);
427
+        //    caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2,0);
410 428
             for (CaseAttach caseAttach : attachLogList) {
411 429
                 caseAttach.setCaseAppliId(vo.getCaseId());
412
-                caseAttachMapper.save(caseAttach);
430
+                caseAttachMapper.updateCaseAttach(caseAttach);
413 431
             }
414 432
         }
415 433
        // caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);

+ 51
- 13
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Voir le fichier

@@ -969,7 +969,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
969 969
             if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
970 970
                 caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
971 971
                 // 插入案件日志人员相关表
972
-                caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
972
+                if(CollectionUtil.isNotEmpty(caseAttachList)) {
973
+                    List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
974
+                    // 插入日志附件表
975
+                    if(CollectionUtil.isNotEmpty(filterList)) {
976
+                        for (CaseAttach caseAttach : filterList) {
977
+                            // 查询附件表
978
+                            CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
979
+                            attach.setCaseAppliLogId(caseApplication.getId());
980
+                            caseAttachLogMapper.save(attach);
981
+                        }
982
+                    }
983
+
984
+                }    caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
973 985
             }
974 986
         });
975 987
 
@@ -1077,11 +1089,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1077 1089
         // 立案申请状态直接修改主表信息
1078 1090
             if (caseAttachList != null && caseAttachList.size() > 0
1079 1091
                     && caseApplication.getCaseStatus()!=null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) {
1080
-            for (CaseAttach caseAttach : caseAttachList) {
1081
-                caseAttach.setCaseAppliId(caseApplication.getId());
1082
-                caseAttachMapper.updateCaseAttach(caseAttach);
1092
+                List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
1093
+                if(CollectionUtil.isNotEmpty(filterList)){
1094
+                    // 先删除2的附件在新增
1095
+//                    caseAttachMapper.deleteByCasedIdAndType(caseApplication.getId(),2,0);
1096
+//                for (CaseAttach caseAttach : filterList) {
1097
+//                    caseAttach.setCaseAppliId(caseApplication.getId());
1098
+//                    caseAttachMapper.save(caseAttach);
1099
+//                }
1100
+
1101
+                    for (CaseAttach caseAttach : caseAttachList) {
1102
+                        caseAttach.setCaseAppliId(caseApplication.getId());
1103
+                        caseAttachMapper.updateCaseAttach(caseAttach);
1104
+                    }
1083 1105
             }
1084 1106
 
1107
+
1085 1108
         }
1086 1109
         // 根据案件id查询最新版本号
1087 1110
         Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId());
@@ -1106,13 +1129,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1106 1129
                         caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
1107 1130
                     }
1108 1131
                     if(CollectionUtil.isNotEmpty(caseAttachList)) {
1132
+                        List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
1109 1133
                         // 插入日志附件表
1110
-                        for (CaseAttach caseAttach : caseAttachList) {
1111
-                            // 查询附件表
1112
-                            CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
1113
-                            attach.setCaseAppliLogId(caseApplication.getId());
1114
-                            caseAttachLogMapper.save(attach);
1115
-                        }
1134
+                       if(CollectionUtil.isNotEmpty(filterList)) {
1135
+                           for (CaseAttach caseAttach : filterList) {
1136
+                               // 查询附件表
1137
+                               CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
1138
+                               attach.setCaseAppliLogId(caseApplication.getId());
1139
+                               caseAttachLogMapper.save(attach);
1140
+                           }
1141
+                       }
1116 1142
 
1117 1143
                     }
1118 1144
                 }
@@ -2731,8 +2757,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2731 2757
     public long createRoomId(Long caseId) {
2732 2758
         long roomId = generateRoomId();
2733 2759
         // 新增预约会议表
2734
-//        ReservedConference conference = new ReservedConference(caseId, roomId,
2735
-//                null, null,0);
2760
+//        ReservedConference conference = new ReservedConference(caseId, SecurityUtils.getUserId(),roomId,
2761
+//                null, null);
2736 2762
 //        reservedConferenceMapper.insert(conference);
2737 2763
         // 绑定案件与房间号
2738 2764
         caseApplicationMapper.bindCaseId(caseId, String.valueOf(roomId));
@@ -2766,6 +2792,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2766 2792
     @Transactional
2767 2793
     public List<ReservedConference> reserveConferenceList(Long caseId) {
2768 2794
         List<ReservedConference> reservedConferences = reservedConferenceMapper.selectListByCaseId(caseId);
2795
+        if(CollectionUtil.isNotEmpty(reservedConferences)){
2796
+            for (ReservedConference reservedConference : reservedConferences) {
2797
+                Date startTime = reservedConference.getScheduleStartTime();
2798
+                if(null != startTime){
2799
+                    long beforeMinutes = startTime.getTime() - 1000 * 60 * 5;
2800
+                    if(System.currentTimeMillis()<beforeMinutes ){
2801
+                        reservedConference.setIsBeforeFiveMinutes(true);
2802
+                    }else {
2803
+                        reservedConference.setIsBeforeFiveMinutes(false);
2804
+                    }
2805
+                }
2806
+            }
2807
+        }
2769 2808
 
2770 2809
         return reservedConferences;
2771 2810
     }
@@ -2782,7 +2821,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2782 2821
         return success( reservedConferenceMapper.deleteByRoomId(roomId));
2783 2822
     }
2784 2823
 
2785
-
2786 2824
 }
2787 2825
 
2788 2826
 

+ 9
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java Voir le fichier

@@ -125,7 +125,14 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
125 125
             }
126 126
                 CaseAttach caseAttachselect = new CaseAttach();
127 127
                 caseAttachselect.setAnnexId(caseAttach.getAnnexId());
128
-                caseAttachselect.setAnnexName(caseAttach.getAnnexName());
128
+            String annexName = caseAttach.getAnnexName();
129
+            if(StrUtil.isNotEmpty(annexName)) {
130
+                int startIndexnew = annexName.lastIndexOf("/");
131
+                if (startIndexnew != -1) {
132
+                    String annexNamenew = annexName.substring(startIndexnew + 1);
133
+                    caseAttach.setAnnexName(annexNamenew);
134
+                }
135
+            }
129 136
                 caseAttachselect.setAnnexType(caseAttach.getAnnexType());
130 137
                 return AjaxResult.success("上传成功", caseAttachselect);
131 138
         } catch (IOException e) {
@@ -246,6 +253,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
246 253
                         .annexType(annexType)
247 254
                         .userId(userId)
248 255
                         .userName(userName)
256
+                        .isBatchUpload(1)
249 257
                         .build();
250 258
                 int count = caseAttachMapper.save(caseAttach);
251 259
                 if (count > 0 && annexType != null && annexType != 8) {

+ 3
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java Voir le fichier

@@ -365,7 +365,9 @@ public class VideoServiceImpl implements VideoService {
365 365
                 staticAndMksDir = Paths.get(absPath).toFile().toString();
366 366
             long downloadFile = HttpUtil.downloadFile(fileUrl, staticAndMksDir);
367 367
             if(downloadFile>0) {
368
+                log.info("下载成功roomId"+roomId);
368 369
                 Long caseId = caseApplicationMapper.selectCaseIdByRoomId(roomId);
370
+                log.info("下载成功caseId"+caseId);
369 371
                 String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName);
370 372
                 // 存入数据库
371 373
                 CaseAttach caseAttach = CaseAttach.builder().caseAppliId(caseId)
@@ -374,6 +376,7 @@ public class VideoServiceImpl implements VideoService {
374 376
                         .annexType(9)
375 377
                         .build();
376 378
                 caseAttachMapper.save(caseAttach);
379
+                log.info("保存附件号成功");
377 380
                 return annexName;
378 381
             }
379 382
         }

+ 8
- 8
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Voir le fichier

@@ -162,7 +162,7 @@
162 162
 
163 163
 
164 164
                 <!--申请人案件-->
165
-                select c.id ,l.id AS caseLogId,c.case_num ,l.case_subject_amount ,c.register_date ,c.arbitrat_method ,
165
+                select c.id ,l.id AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
166 166
                 CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
167 167
                 ELSE '无审理方式'
168 168
                 END arbitratMethodName,
@@ -176,10 +176,10 @@
176 176
                 when 31 then '待修改开庭时间'
177 177
                 ELSE '无案件状态'
178 178
                 END caseStatusName,
179
-                c.hear_date ,l.arbitrat_claims ,
180
-                l.loan_start_date ,l.loan_end_date ,l.claim_princi_owed ,l.claim_interest_owed ,l.claim_liquid_damag
181
-                ,l.fee_payable ,
182
-                c.begin_video_date ,c.online_video_person ,l.contract_number ,c.create_by ,c.create_time ,
179
+                c.hear_date ,c.arbitrat_claims ,
180
+                c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
181
+                ,c.fee_payable ,
182
+                c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
183 183
                 c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
184 184
                 as
185 185
                 applicantName,
@@ -1468,9 +1468,9 @@
1468 1468
         update case_application set lock_status=#{lockStatus} where id = #{id}
1469 1469
     </update>
1470 1470
     <update id="bindCaseId">
1471
-       <!-- update case_application set room_id=#{roomId} where id = #{caseId} -->
1471
+        update case_application set room_id=#{roomId} where id = #{caseId}
1472 1472
 
1473
-        update case_application set room_id= CONCAT(room_id,',',#{roomId}) where id =#{caseId}
1473
+<!--         update case_application set room_id= CONCAT(room_id,',',#{roomId}) where id =#{caseId} -->
1474 1474
     </update>
1475 1475
     <update id="updateVersionById">
1476 1476
         update case_application set version = #{version} where id = #{id}
@@ -1585,7 +1585,7 @@ order by c.create_time desc limit 1
1585 1585
     </select>
1586 1586
     <select id="selectCaseIdByRoomId" resultType="java.lang.Long">
1587 1587
         select id
1588
-        from case_application where room_id like concat('%', #{roomId}, '%')  limit 1
1588
+        from case_application where room_id=#{roomId} limit 1
1589 1589
     </select>
1590 1590
 
1591 1591
     <select id="selectMaxRoomId" resultType="java.lang.Long">

+ 4
- 4
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachLogMapper.xml Voir le fichier

@@ -16,8 +16,8 @@
16 16
         <result property="caseAppliLogId"     column="case_appli_log_id"    />
17 17
     </resultMap>
18 18
     <insert id="save" useGeneratedKeys="true" keyProperty="annexId">
19
-        INSERT INTO case_attach_log (case_appli_log_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
20
-        VALUES (#{caseAppliLogId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus})
19
+        INSERT INTO case_attach_log (case_appli_log_id, annex_id,annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
20
+        VALUES (#{caseAppliLogId},#{annexId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus})
21 21
     </insert>
22 22
     <delete id="deleteByFileIds">
23 23
         delete from case_attach_log
@@ -28,7 +28,7 @@
28 28
     </delete>
29 29
 
30 30
     <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
31
-        select annex_id,case_appli_log_id,annex_name,annex_path,annex_type,note,use_id,use_account
31
+        select *
32 32
         from case_attach_log
33 33
         where case_appli_log_id =#{id}
34 34
     </select>
@@ -65,7 +65,7 @@
65 65
         </where>
66 66
     </select>
67 67
     <select id="queryAnnexById" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
68
-        select case_appli_log_id caseAppliLogId,annex_id,annex_name,annex_path,annex_type,note,use_id,use_account
68
+        select *
69 69
         from case_attach_log
70 70
         <where>
71 71
             <if test="annexId != null ">

+ 5
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml Voir le fichier

@@ -15,8 +15,8 @@
15 15
         <result property="sealStatus"     column="seal_status"    />
16 16
     </resultMap>
17 17
     <insert id="save" useGeneratedKeys="true" keyProperty="annexId">
18
-        INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
19
-        VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus})
18
+        INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
19
+        VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus},#{isBatchUpload})
20 20
     </insert>
21 21
     <delete id="deleteByFileIds">
22 22
         delete from case_attach
@@ -29,6 +29,9 @@
29 29
         delete from case_attach
30 30
         where case_appli_id = #{caseAppliId}
31 31
         and annex_type = #{annexType}
32
+        <if test="isBatchUpload != null ">
33
+            AND is_batch_upload = #{isBatchUpload}
34
+        </if>
32 35
     </delete>
33 36
 
34 37
     <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">