Parcourir la source

Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into hjb

# Conflicts:
#	ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java
hejinbo il y a 2 ans
Parent
révision
1a1f87c998
17 fichiers modifiés avec 423 ajouts et 64 suppressions
  1. 12
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java
  2. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java
  3. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ReservedConference.java
  4. 4
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseEvidenceDTO.java
  5. 6
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java
  6. 1
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java
  7. 30
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachLogMapper.java
  8. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java
  9. 99
    8
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java
  10. 86
    29
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java
  11. 10
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java
  12. 3
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java
  13. 3
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml
  14. 12
    2
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml
  15. 22
    21
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml
  16. 101
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachLogMapper.xml
  17. 11
    3
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml

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

@@ -166,6 +166,10 @@ public class CaseApplication  extends BaseEntity {
166 166
 
167 167
     /** 是否仲裁反请求 */
168 168
     private Integer adjudicaCounter;
169
+    /**
170
+     * 仲裁反请求原因
171
+     */
172
+    private String adjudicaCounterReason;
169 173
 
170 174
     /** 被申请人是否缺席 */
171 175
     private Integer isAbsence;
@@ -178,6 +182,14 @@ public class CaseApplication  extends BaseEntity {
178 182
     /** 申请人是否缺席 */
179 183
     private Integer appliIsAbsen;
180 184
 
185
+    public String getAdjudicaCounterReason() {
186
+        return adjudicaCounterReason;
187
+    }
188
+
189
+    public void setAdjudicaCounterReason(String adjudicaCounterReason) {
190
+        this.adjudicaCounterReason = adjudicaCounterReason;
191
+    }
192
+
181 193
     public Integer getAppliIsAbsen() {
182 194
         return appliIsAbsen;
183 195
     }

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

@@ -18,6 +18,10 @@ public class  CaseAttach {
18 18
      * 案件申请id
19 19
      */
20 20
     private Long caseAppliId;
21
+    /**
22
+     * 案件记录id
23
+     */
24
+    private Long caseAppliLogId;
21 25
     /**
22 26
      * 附件名称
23 27
      */
@@ -46,5 +50,9 @@ public class  CaseAttach {
46 50
      * 印章状态(0未启用,1已启用)
47 51
      */
48 52
     private Integer sealStatus;
53
+    /**
54
+     * 是否是证据上传,0-否,1-是
55
+     */
56
+    private Integer isBatchUpload;
49 57
 
50 58
 }

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

@@ -21,6 +21,10 @@ public class ReservedConference {
21 21
      * 用户id
22 22
      */
23 23
     private Long userId;
24
+    /**
25
+     * 用户名
26
+     */
27
+    private String userName;
24 28
     /**
25 29
      * 案件id
26 30
      */
@@ -39,6 +43,10 @@ public class ReservedConference {
39 43
      */
40 44
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
41 45
     private Date scheduleEndTime;
46
+    /**
47
+     * 是否超过5分钟
48
+     */
49
+    private Boolean isBeforeFiveMinutes;
42 50
 
43 51
 
44 52
     public ReservedConference() {

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

@@ -31,6 +31,10 @@ public class CaseEvidenceDTO {
31 31
     private Integer pendingAppointArbotrar;
32 32
     /** 是否仲裁反请求 */
33 33
     private Integer adjudicaCounter;
34
+    /**
35
+     * 仲裁反请求原因
36
+     */
37
+    private String adjudicaCounterReason;
34 38
     /** 是否管辖异议申请 */
35 39
     private Integer objectiJuris;
36 40
 

+ 6
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java Voir le fichier

@@ -35,4 +35,10 @@ public interface CaseAffiliateMapper {
35 35
      * @param affiliateLogList
36 36
      */
37 37
     void updateCaseAffiliateByCaseId(@Param("caseAppliId")Long caseAppliId,@Param("list") List<CaseAffiliate> affiliateLogList);
38
+
39
+    /**
40
+     * 根据案件id删除
41
+     * @param caseId
42
+     */
43
+    void deleteByCaseId(@Param("caseAppliId") Long caseId);
38 44
 }

+ 1
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java Voir le fichier

@@ -43,4 +43,5 @@ public interface CaseApplicationLogMapper {
43 43
      */
44 44
     void batchDeleteLog(@Param("ids") List<Long> ids);
45 45
 
46
+    CaseApplication selectBeforeCase(@Param("caseId") Long caseId, @Param("version")Integer version);
46 47
 }

+ 30
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachLogMapper.java Voir le fichier

@@ -0,0 +1,30 @@
1
+package com.ruoyi.wisdomarbitrate.mapper;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
4
+import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
5
+import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+
10
+@Mapper
11
+public interface CaseAttachLogMapper {
12
+    int save(CaseAttach caseAttach);
13
+
14
+    List<CaseAttach>  queryAnnexPathByCaseId(Long id);
15
+
16
+    List<CaseAttach> queryCaseAttachList(CaseApplication caseApplication);
17
+
18
+
19
+    int updateCaseAttach(CaseAttach caseAttach);
20
+
21
+    int updateCaseAttachBycaseid(CaseAttach caseAttach);
22
+
23
+    int deleteByFileIds(@Param("ids") List<Integer> fileIds);
24
+
25
+    List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
26
+
27
+    CaseAttach queryAnnexById(Integer annexId);
28
+
29
+
30
+}

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

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

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

@@ -3,12 +3,14 @@ package com.ruoyi.wisdomarbitrate.service.impl;
3 3
 import cn.hutool.core.collection.CollectionUtil;
4 4
 import cn.hutool.core.util.StrUtil;
5 5
 import com.ruoyi.common.core.domain.AjaxResult;
6
+import com.ruoyi.common.core.domain.entity.SysDept;
6 7
 import com.ruoyi.common.enums.UpdateSubmitStatus;
7 8
 import com.ruoyi.common.enums.YesOrNoEnum;
8 9
 import com.ruoyi.common.utils.ObjectFieldUtils;
9 10
 import com.ruoyi.common.utils.SmsUtils;
10 11
 import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
11 12
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
13
+import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
12 14
 import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
13 15
 import com.ruoyi.wisdomarbitrate.domain.vo.CompareCaseVO;
14 16
 import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
@@ -22,6 +24,7 @@ import java.util.Date;
22 24
 import java.util.List;
23 25
 import java.util.Map;
24 26
 import java.util.Objects;
27
+import java.util.function.Function;
25 28
 import java.util.stream.Collectors;
26 29
 
27 30
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
@@ -42,6 +45,10 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
42 45
     @Autowired
43 46
     private CaseAffiliateMapper caseAffiliateMapper;
44 47
     @Autowired
48
+    private CaseAttachMapper caseAttachMapper;
49
+    @Autowired
50
+    private CaseAttachLogMapper caseAttachLogMapper;
51
+    @Autowired
45 52
     private SmsRecordMapper smsRecordMapper;
46 53
     @Override
47 54
     public int insert(CaseApplication caseApplicationLog) {
@@ -105,6 +112,8 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
105 112
             if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) {
106 113
                 // 如果版本号为1,则直接返回
107 114
                 if(vo.getVersion() <= 1){
115
+                    vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE.getCode());
116
+                    caseApplicationLogMapper.updateStatus(vo);
108 117
                     return AjaxResult.success();
109 118
                 }
110 119
                 // 同意,查询日志记录表本版本数据,将数据更新到主表,并将日志表改版本的状态改为同意
@@ -123,8 +132,24 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
123 132
 
124 133
                 // 更新相关人员主表
125 134
                 if(CollectionUtil.isNotEmpty(affiliateLogList)){
135
+                    caseAffiliateMapper.deleteByCaseId(vo.getCaseId());
126 136
                     for (CaseAffiliate caseAffiliate : affiliateLogList) {
127
-                       caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
137
+                        caseAffiliate.setCaseAppliId(vo.getCaseId());
138
+
139
+                    }
140
+                    caseAffiliateMapper.batchCaseAffiliate(affiliateLogList);
141
+                }
142
+                // // 根据caseLogId查询案件记录附件表
143
+                CaseApplication caseApplication = new CaseApplication();
144
+                caseApplication.setCaseLogId(caseApplicationLog.getCaseLogId());
145
+                caseApplication.setAnnexType(2);
146
+                List<CaseAttach> attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication);
147
+                // 更新记录附件表
148
+                if(CollectionUtil.isNotEmpty(attachLogList)){
149
+                //    caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2,0);
150
+                    for (CaseAttach caseAttach : attachLogList) {
151
+                        caseAttach.setCaseAppliId(vo.getCaseId());
152
+                        caseAttachMapper.updateCaseAttach(caseAttach);
128 153
                     }
129 154
                 }
130 155
              //   caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
@@ -177,7 +202,6 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
177 202
             return AjaxResult.success();
178 203
         }
179 204
 
180
-        // todo 给申请人发送短信
181 205
         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
182 206
         request.setTemplateId("1996949");
183 207
         request.setPhone(caseAffiliate.getContactTelphone());
@@ -209,20 +233,29 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
209 233
     public AjaxResult selectCompareCase(UpdateSubmitVO vo) {
210 234
         // 查询当前版本号和上一个版本号的案件
211 235
         CaseApplication afterCase = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion());
212
-        CaseApplication beforeCase = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() - 1);
236
+        CaseApplication beforeCase = caseApplicationLogMapper.selectBeforeCase(vo.getCaseId(), vo.getVersion());
213 237
         // 查询案件关联人员
214 238
         beforeCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(beforeCase.getCaseLogId()));
215 239
         afterCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(afterCase.getCaseLogId()));
240
+        // 查询附件
241
+        CaseAttach caseAttach = new CaseAttach();
242
+        caseAttach.setCaseAppliLogId(beforeCase.getCaseLogId());
243
+        caseAttach.setAnnexType(2);
244
+        caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach);
245
+        beforeCase.setCaseAttachList(caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach));
246
+        caseAttach.setCaseAppliLogId(afterCase.getCaseLogId());
247
+        afterCase.setCaseAttachList(caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach));
216 248
         CompareCaseVO compareCaseVO = new CompareCaseVO();
217 249
         compareCaseVO.setBeforeCase(beforeCase);
218 250
         compareCaseVO.setAfterCase(afterCase);
219 251
         // 对比两个版本修改的字段
220 252
         String[] columns = {"caseSubjectAmount","loanStartDate", "loanEndDate","contractNumber","claimInterestOwed","claimLiquidDamag",
221 253
                 "claimPrinciOwed","arbitratClaims","properPreser","requestRule"};
222
-        String[] affiliateColumns = {"name", "identityNum","contactTelphone","contactAdress","workTelphone","workAddress",
254
+        String[] affiliateColumns = {"name", "identityNum","contactTelphone","contactAddress","workTelphone","workAddress",
223 255
                 "nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent","residenAffili","compLegalPerson",
224 256
         "compLegalperPost","responSex","responBirth"};
225 257
         StringBuilder changeColumn = new StringBuilder();
258
+        // 对比基本字段
226 259
         for (String column : columns) {
227 260
             String beforeValue = ObjectFieldUtils.getValue(beforeCase, column);
228 261
             String afterValue = ObjectFieldUtils.getValue(afterCase, column);
@@ -241,6 +274,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
241 274
             }
242 275
 
243 276
         }
277
+        // 对比人员字段
244 278
         List<CaseAffiliate> beforeCaseCaseAffiliates = beforeCase.getCaseAffiliates();
245 279
         List<CaseAffiliate> afterCaseCaseAffiliates = afterCase.getCaseAffiliates();
246 280
         Map<Integer, CaseAffiliate> beforeCaseCaseAffiliateMap = null;
@@ -257,8 +291,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
257 291
                 affiliateChangeColumn.append(column).append(",");
258 292
             }
259 293
 
260
-        }
261
-        else if (beforeCaseCaseAffiliates == null && afterCaseCaseAffiliates != null) {
294
+        } else if (beforeCaseCaseAffiliates == null && afterCaseCaseAffiliates != null) {
262 295
             affiliateChangeColumn = new StringBuilder();
263 296
             for (String column : affiliateColumns) {
264 297
 
@@ -302,8 +335,49 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
302 335
             }
303 336
 
304 337
 
338
+        }
339
+        boolean notEmptyFlag = CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isEmpty(afterCase.getCaseAttachList());
340
+        boolean emptyFlag = CollectionUtil.isEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(afterCase.getCaseAttachList());
341
+        // 对比附件
342
+        if(notEmptyFlag || emptyFlag){
343
+            changeColumn.append("fileColumn");
344
+        }else if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
345
+            if(beforeCase.getCaseAttachList().size()!=afterCase.getCaseAttachList().size()){
346
+                changeColumn.append("fileColumn");
347
+            }else {
348
+                Map<String, CaseAttach> afterAttachMap = afterCase.getCaseAttachList().stream().collect(Collectors.toMap(CaseAttach::getAnnexPath, Function.identity(), (n1, n2) -> n2));
349
+
350
+
351
+                for (CaseAttach beforeCaseAttach : beforeCase.getCaseAttachList()) {
352
+                    if(!afterAttachMap.containsKey(beforeCaseAttach.getAnnexPath())) {
353
+                        changeColumn.append("fileColumn");
354
+                        break;
355
+                    }
356
+                }
357
+            }
358
+
359
+
305 360
         }
306 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
+        }
307 381
 
308 382
         return AjaxResult.success(compareCaseVO);
309 383
     }
@@ -319,7 +393,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
319 393
             caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() );
320 394
 
321 395
         }else {
322
-            caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() - 1);
396
+            caseApplicationLog = caseApplicationLogMapper.selectBeforeCase(vo.getCaseId(), vo.getVersion() );
323 397
         }
324 398
          if (caseApplicationLog == null) {
325 399
             return;
@@ -330,13 +404,30 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
330 404
         // 根据caseLogId查询相关人员表
331 405
         List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationLog.getCaseLogId());
332 406
 
407
+
333 408
         // 更新案件主表
334 409
         caseApplicationMapper.updataCaseApplication(caseApplicationLog);
335 410
 
336 411
         // 更新相关人员主表
337 412
         if(CollectionUtil.isNotEmpty(affiliateLogList)){
413
+            caseAffiliateMapper.deleteByCaseId(vo.getCaseId());
338 414
             for (CaseAffiliate caseAffiliate : affiliateLogList) {
339
-                caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
415
+                caseAffiliate.setCaseAppliId(vo.getCaseId());
416
+
417
+            }
418
+            caseAffiliateMapper.batchCaseAffiliate(affiliateLogList);
419
+        }
420
+        // // 根据caseLogId查询案件记录附件表
421
+        CaseApplication caseApplication = new CaseApplication();
422
+        caseApplication.setCaseLogId(caseApplicationLog.getCaseLogId());
423
+        caseApplication.setAnnexType(2);
424
+        List<CaseAttach> attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication);
425
+        // 更新记录附件表
426
+        if(CollectionUtil.isNotEmpty(attachLogList)){
427
+        //    caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2,0);
428
+            for (CaseAttach caseAttach : attachLogList) {
429
+                caseAttach.setCaseAppliId(vo.getCaseId());
430
+                caseAttachMapper.updateCaseAttach(caseAttach);
340 431
             }
341 432
         }
342 433
        // caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);

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

@@ -127,6 +127,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
127 127
     private CaseApplicationLogMapper caseApplicationLogMapper;
128 128
     @Autowired
129 129
     private CaseAffiliateLogMapper caseAffiliateLogMapper;
130
+    @Autowired
131
+    private CaseAttachLogMapper caseAttachLogMapper;
130 132
 
131 133
     // 手机号正则
132 134
     private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
@@ -978,7 +980,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
978 980
             if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
979 981
                 caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
980 982
                 // 插入案件日志人员相关表
981
-                caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
983
+                if(CollectionUtil.isNotEmpty(caseAttachList)) {
984
+                    List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
985
+                    // 插入日志附件表
986
+                    if(CollectionUtil.isNotEmpty(filterList)) {
987
+                        for (CaseAttach caseAttach : filterList) {
988
+                            // 查询附件表
989
+                            CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
990
+                            attach.setCaseAppliLogId(caseApplication.getId());
991
+                            caseAttachLogMapper.save(attach);
992
+                        }
993
+                    }
994
+
995
+                }    caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
982 996
             }
983 997
         });
984 998
 
@@ -1083,12 +1097,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1083 1097
 
1084 1098
         }
1085 1099
         List<CaseAttach> caseAttachList = caseApplication.getCaseAttachList();
1086
-        if (caseAttachList != null && caseAttachList.size() > 0) {
1087
-            for (CaseAttach caseAttach : caseAttachList) {
1088
-                caseAttach.setCaseAppliId(caseApplication.getId());
1089
-                caseAttachMapper.updateCaseAttach(caseAttach);
1100
+        // 立案申请状态直接修改主表信息
1101
+            if (caseAttachList != null && caseAttachList.size() > 0
1102
+                    && caseApplication.getCaseStatus()!=null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) {
1103
+                List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
1104
+                if(CollectionUtil.isNotEmpty(filterList)){
1105
+                    // 先删除2的附件在新增
1106
+//                    caseAttachMapper.deleteByCasedIdAndType(caseApplication.getId(),2,0);
1107
+//                for (CaseAttach caseAttach : filterList) {
1108
+//                    caseAttach.setCaseAppliId(caseApplication.getId());
1109
+//                    caseAttachMapper.save(caseAttach);
1110
+//                }
1111
+
1112
+                    for (CaseAttach caseAttach : caseAttachList) {
1113
+                        caseAttach.setCaseAppliId(caseApplication.getId());
1114
+                        caseAttachMapper.updateCaseAttach(caseAttach);
1115
+                    }
1090 1116
             }
1091 1117
 
1118
+
1092 1119
         }
1093 1120
         // 根据案件id查询最新版本号
1094 1121
         Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId());
@@ -1103,12 +1130,31 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1103 1130
 
1104 1131
         // 异步新增案件日志
1105 1132
         ThreadPoolUtil.execute(() -> {
1106
-            caseApplication.setCaseAppliId(caseApplication.getId());
1107
-            int insertRow = caseApplicationLogMapper.insert(caseApplication);
1108
-            if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
1109
-                caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
1110
-                // 插入案件日志人员相关表
1111
-                caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
1133
+            try {
1134
+                caseApplication.setCaseAppliId(caseApplication.getId());
1135
+                int insertRow = caseApplicationLogMapper.insert(caseApplication);
1136
+                if (insertRow != 0 ) {
1137
+                    if( CollectionUtil.isNotEmpty(caseAffiliates)) {
1138
+                        caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
1139
+                        // 插入案件日志人员相关表
1140
+                        caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
1141
+                    }
1142
+                    if(CollectionUtil.isNotEmpty(caseAttachList)) {
1143
+                        List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
1144
+                        // 插入日志附件表
1145
+                       if(CollectionUtil.isNotEmpty(filterList)) {
1146
+                           for (CaseAttach caseAttach : filterList) {
1147
+                               // 查询附件表
1148
+                               CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
1149
+                               attach.setCaseAppliLogId(caseApplication.getId());
1150
+                               caseAttachLogMapper.save(attach);
1151
+                           }
1152
+                       }
1153
+
1154
+                    }
1155
+                }
1156
+            } catch (Exception e) {
1157
+                throw new RuntimeException(e);
1112 1158
             }
1113 1159
         });
1114 1160
 
@@ -2722,8 +2768,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2722 2768
     public long createRoomId(Long caseId) {
2723 2769
         long roomId = generateRoomId();
2724 2770
         // 新增预约会议表
2725
-//        ReservedConference conference = new ReservedConference(caseId, roomId,
2726
-//                null, null,0);
2771
+//        ReservedConference conference = new ReservedConference(caseId, SecurityUtils.getUserId(),roomId,
2772
+//                null, null);
2727 2773
 //        reservedConferenceMapper.insert(conference);
2728 2774
         // 绑定案件与房间号
2729 2775
         caseApplicationMapper.bindCaseId(caseId, String.valueOf(roomId));
@@ -2757,25 +2803,36 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2757 2803
     @Transactional
2758 2804
     public List<ReservedConference> reserveConferenceList(Long caseId) {
2759 2805
         List<ReservedConference> reservedConferences = reservedConferenceMapper.selectListByCaseId(caseId);
2760
-        List<ReservedConference> result = new ArrayList<>();
2761
-        // 判断当前时间是否大于结束时间,如果大于,则把该房间删掉
2762
-        if (CollectionUtil.isNotEmpty(reservedConferences)) {
2763
-            List<Long> ids = new ArrayList<>();
2764
-            for (ReservedConference reservedConference : reservedConferences) {
2765
-                Date endTime = reservedConference.getScheduleEndTime();
2766
-                Date now = new Date();
2767
-                if (now.after(endTime)) {
2768
-                    ids.add(reservedConference.getId());
2769
-                } else {
2770
-                    result.add(reservedConference);
2771
-                }
2806
+        if (CollectionUtil.isEmpty(reservedConferences)) {
2807
+            return reservedConferences;
2808
+        }
2809
+        Map<Long,String> userIdMap = null;
2810
+        List<Long> userIds = reservedConferences.stream().map(ReservedConference::getUserId).collect(Collectors.toList());
2811
+        if(CollectionUtil.isNotEmpty(userIds)){
2812
+            // 根据userids查询用户名
2813
+            List<SysUser> userList = sysUserMapper.selectUserListByIds(userIds);
2814
+            if(CollectionUtil.isNotEmpty(userList)){
2815
+                userIdMap = userList.stream().collect(Collectors.toMap(SysUser::getUserId,SysUser::getUserName));
2816
+            }
2817
+        }
2818
+        for (ReservedConference reservedConference : reservedConferences) {
2819
+            if(null!=reservedConference.getUserId() && null!=userIdMap){
2820
+                reservedConference.setUserName(userIdMap.get(reservedConference.getUserId()));
2821
+            }
2822
+            Date startTime = reservedConference.getScheduleStartTime();
2823
+            if (null == startTime) {
2824
+                continue;
2772 2825
             }
2773
-            if (CollectionUtil.isNotEmpty(ids)) {
2774
-                // 根据id批量删除
2775
-                reservedConferenceMapper.batchDeleteByIds(ids);
2826
+            long beforeMinutes = startTime.getTime() - 1000 * 60 * 5;
2827
+            if (System.currentTimeMillis() < beforeMinutes) {
2828
+                reservedConference.setIsBeforeFiveMinutes(true);
2829
+            } else {
2830
+                reservedConference.setIsBeforeFiveMinutes(false);
2776 2831
             }
2777 2832
         }
2778
-        return result;
2833
+
2834
+
2835
+        return reservedConferences;
2779 2836
     }
2780 2837
 
2781 2838
     /**

+ 10
- 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) {
@@ -193,6 +200,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
193 200
         caseApplication.setId(caseEvidenceDTO.getCaseId());
194 201
         CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
195 202
         if (caseApplication1 != null) {
203
+            caseApplication1.setAdjudicaCounterReason(caseEvidenceDTO.getAdjudicaCounterReason());
196 204
             int caseStatus = caseApplication1.getCaseStatus();
197 205
             caseApplication1.setObjectionAddEviden(caseEvidenceDTO.getObjectionAddEviden());
198 206
             //默认书面审理
@@ -246,6 +254,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
246 254
                         .annexType(annexType)
247 255
                         .userId(userId)
248 256
                         .userName(userName)
257
+                        .isBatchUpload(1)
249 258
                         .build();
250 259
                 int count = caseAttachMapper.save(caseAttach);
251 260
                 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
         }

+ 3
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml Voir le fichier

@@ -150,6 +150,9 @@
150 150
             #{item}
151 151
         </foreach>
152 152
     </delete>
153
+    <delete id="deleteByCaseId">
154
+        delete from case_affiliate where case_appli_id = #{caseAppliId}
155
+    </delete>
153 156
 
154 157
 
155 158
 </mapper>

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

@@ -48,6 +48,7 @@
48 48
         <result property="lockStatus"   column="lock_status"  />
49 49
         <result property="version"   column="version"  />
50 50
         <result property="updateSubmitStatus"   column="update_submit_status"  />
51
+        <result property="properPreser"   column="proper_preser"  />
51 52
     </resultMap>
52 53
     <insert id="insert" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" useGeneratedKeys="true" keyProperty="id">
53 54
         insert into case_application_log(
@@ -69,6 +70,7 @@
69 70
         <if test="createBy != null  and createBy != ''">create_by,</if>
70 71
         <if test="version != null ">version,</if>
71 72
         <if test="updateSubmitStatus != null ">update_submit_status,</if>
73
+        <if test="properPreser != null ">proper_preser,</if>
72 74
         create_time
73 75
         )values(
74 76
         <if test="caseAppliId != null">#{caseAppliId},</if>
@@ -89,6 +91,7 @@
89 91
         <if test="createBy != null  and createBy != ''">#{createBy},</if>
90 92
         <if test="version != null ">#{version},</if>
91 93
         <if test="updateSubmitStatus != null ">#{updateSubmitStatus},</if>
94
+        <if test="properPreser != null ">#{properPreser},</if>
92 95
         sysdate()
93 96
         )
94 97
     </insert>
@@ -130,7 +133,7 @@
130 133
     <select id="selectByCaseIdAndVersion" resultMap="CaseApplicationResult">
131 134
         SELECT case_appli_id id,id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
132 135
                loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
133
-               create_by,version,update_submit_status,create_time
136
+               create_by,version,update_submit_status,create_time,proper_preser
134 137
         FROM case_application_log
135 138
         WHERE case_appli_id = #{caseAppliId} and version=#{version}
136 139
     </select>
@@ -138,7 +141,7 @@
138 141
     <select id="selectLatestCase" resultMap="CaseApplicationResult">
139 142
         SELECT id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
140 143
                loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
141
-               create_by,version,update_submit_status,create_time
144
+               create_by,version,update_submit_status,create_time,proper_preser
142 145
         FROM case_application_log
143 146
         WHERE case_appli_id = #{caseAppliId} ORDER BY version DESC limit 1
144 147
     </select>
@@ -153,6 +156,13 @@
153 156
         FROM case_application_log
154 157
         WHERE case_appli_id = #{caseAppliId} and update_submit_status IN ( 1, 4 )
155 158
     </select>
159
+    <select id="selectBeforeCase" resultMap="CaseApplicationResult">
160
+        SELECT case_appli_id id,id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
161
+               loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
162
+               create_by,version,update_submit_status,create_time,proper_preser
163
+        FROM case_application_log
164
+        WHERE case_appli_id = #{caseId} and version &lt; #{version} and update_submit_status not in ( 4, 5 ) order by version desc limit 1
165
+    </select>
156 166
 
157 167
 
158 168
 </mapper>

+ 22
- 21
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,
@@ -335,8 +335,8 @@
335 335
                 SELECT
336 336
                 l.case_appli_id id,
337 337
                 l.id AS caseLogId,
338
-                l.case_num,
339
-                l.case_subject_amount,
338
+                c.case_num,
339
+                c.case_subject_amount,
340 340
                 c.register_date,
341 341
                 c.arbitrat_method,
342 342
                 CASE
@@ -389,20 +389,20 @@
389 389
                 '待修改开庭时间' ELSE '无案件状态'
390 390
                 END caseStatusName,
391 391
                 c.hear_date,
392
-                l.arbitrat_claims,
393
-                l.loan_start_date,
394
-                l.loan_end_date,
395
-                l.claim_princi_owed,
396
-                l.claim_interest_owed,
397
-                l.claim_liquid_damag,
398
-                l.fee_payable,
392
+                c.arbitrat_claims,
393
+                c.loan_start_date,
394
+                c.loan_end_date,
395
+                c.claim_princi_owed,
396
+                c.claim_interest_owed,
397
+                c.claim_liquid_damag,
398
+                c.fee_payable,
399 399
                 c.begin_video_date,
400 400
                 c.online_video_person,
401
-                l.contract_number,
402
-                l.create_by,
401
+                c.contract_number,
402
+                c.create_by,
403 403
                 c.create_time,
404
-                l.update_by,
405
-                l.update_time,
404
+                c.update_by,
405
+                c.update_time,
406 406
                 c.arbitrator_name,
407 407
                     ca.name,
408 408
                 ca.application_organ_id ,
@@ -1455,6 +1455,7 @@
1455 1455
             <if test="openCourtHear != null">open_court_hear = #{openCourtHear},</if>
1456 1456
             <if test="hearDate != null">hear_date = #{hearDate},</if>
1457 1457
             <if test="filearbitraUrl != null  and filearbitraUrl != ''">filearbitra_url = #{filearbitraUrl},</if>
1458
+            <if test="adjudicaCounterReason != null  and adjudicaCounterReason != ''">adjudica_counter_reason = #{adjudicaCounterReason},</if>
1458 1459
         </set>
1459 1460
         where id = #{id}
1460 1461
     </update>
@@ -1468,9 +1469,9 @@
1468 1469
         update case_application set lock_status=#{lockStatus} where id = #{id}
1469 1470
     </update>
1470 1471
     <update id="bindCaseId">
1471
-       <!-- update case_application set room_id=#{roomId} where id = #{caseId} -->
1472
+        update case_application set room_id=#{roomId} where id = #{caseId}
1472 1473
 
1473
-        update case_application set room_id= CONCAT(room_id,',',#{roomId}) where id =#{caseId}
1474
+<!--         update case_application set room_id= CONCAT(room_id,',',#{roomId}) where id =#{caseId} -->
1474 1475
     </update>
1475 1476
     <update id="updateVersionById">
1476 1477
         update case_application set version = #{version} where id = #{id}
@@ -1585,7 +1586,7 @@ order by c.create_time desc limit 1
1585 1586
     </select>
1586 1587
     <select id="selectCaseIdByRoomId" resultType="java.lang.Long">
1587 1588
         select id
1588
-        from case_application where room_id like concat('%', #{roomId}, '%')  limit 1
1589
+        from case_application where room_id=#{roomId} limit 1
1589 1590
     </select>
1590 1591
 
1591 1592
     <select id="selectMaxRoomId" resultType="java.lang.Long">

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

@@ -0,0 +1,101 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CaseAttachLogMapper">
6
+    <resultMap type="CaseAttach" id="CaseAttachResult">
7
+        <id     property="annexId"       column="annex_id"      />
8
+        <result property="caseAppliId"       column="case_appli_id"      />
9
+        <result property="annexName"     column="annex_name"    />
10
+        <result property="annexPath"     column="annex_path"    />
11
+        <result property="annexType"     column="annex_type"    />
12
+        <result property="note"     column="note"    />
13
+        <result property="userId"     column="use_id"    />
14
+        <result property="userName"     column="use_account"    />
15
+        <result property="sealStatus"     column="seal_status"    />
16
+        <result property="caseAppliLogId"     column="case_appli_log_id"    />
17
+    </resultMap>
18
+    <insert id="save" useGeneratedKeys="true" keyProperty="annexId">
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
+    </insert>
22
+    <delete id="deleteByFileIds">
23
+        delete from case_attach_log
24
+        where annex_id in
25
+        <foreach collection="ids" item="id" open="(" separator="," close=")">
26
+            #{id}
27
+        </foreach>
28
+    </delete>
29
+
30
+    <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
31
+        select *
32
+        from case_attach_log
33
+        where case_appli_log_id =#{id}
34
+    </select>
35
+
36
+    <select id="getCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
37
+        select *
38
+        from case_attach_log
39
+        <where>
40
+            <if test="caseAppliLogId != null ">
41
+                AND case_appli_log_id = #{caseAppliLogId}
42
+            </if>
43
+            <if test="annexType != null ">
44
+                AND annex_type = #{annexType}
45
+            </if>
46
+        </where>
47
+    </select>
48
+
49
+    <select id="queryCaseAttachList" resultMap="CaseAttachResult">
50
+        select *
51
+        from case_attach_log
52
+        <where>
53
+            <if test="caseLogId != null ">
54
+                AND case_appli_log_id = #{caseLogId}
55
+            </if>
56
+            <if test="annexType != null ">
57
+                AND annex_type = #{annexType}
58
+            </if>
59
+            <if test="annexTypeList != null and annexTypeList.size() > 0">
60
+                and annex_type in
61
+                <foreach item="annexType" collection="annexTypeList" open="(" separator="," close=")">
62
+                    #{annexType}
63
+                </foreach>
64
+            </if>
65
+        </where>
66
+    </select>
67
+    <select id="queryAnnexById" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
68
+        select *
69
+        from case_attach_log
70
+        <where>
71
+            <if test="annexId != null ">
72
+                AND annex_id = #{annexId}
73
+            </if>
74
+        </where>
75
+    </select>
76
+
77
+    <update id="updateCaseAttach" parameterType="CaseAttach">
78
+        update case_attach_log
79
+        set
80
+            case_appli_log_id= #{caseAppliLogId}
81
+        where annex_id = #{annexId}
82
+    </update>
83
+
84
+    <update id="updateCaseAttachBycaseid" parameterType="CaseAttach" >
85
+        update case_attach_log
86
+        <set>
87
+            <if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>
88
+            <if test="annexPath != null and annexPath != ''">annex_path = #{annexPath}</if>
89
+        </set>
90
+        <where>
91
+            <if test="caseAppliId != null ">
92
+                AND case_appli_log_id  = #{caseAppliLogId}
93
+            </if>
94
+            <if test="annexType != null ">
95
+                AND annex_type  = #{annexType}
96
+            </if>
97
+        </where>
98
+    </update>
99
+
100
+
101
+</mapper>

+ 11
- 3
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
@@ -25,6 +25,14 @@
25 25
             #{id}
26 26
         </foreach>
27 27
     </delete>
28
+    <delete id="deleteByCasedIdAndType">
29
+        delete from case_attach
30
+        where case_appli_id = #{caseAppliId}
31
+        and annex_type = #{annexType}
32
+        <if test="isBatchUpload != null ">
33
+            AND is_batch_upload = #{isBatchUpload}
34
+        </if>
35
+    </delete>
28 36
 
29 37
     <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
30 38
         select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
@@ -64,7 +72,7 @@
64 72
         </where>
65 73
     </select>
66 74
     <select id="queryAnnexById" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
67
-        select annex_id,annex_name,annex_path,annex_type,note,use_id,use_account
75
+        select *
68 76
         from case_attach
69 77
         <where>
70 78
             <if test="annexId != null ">