Przeglądaj źródła

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

wangqiong123 2 lat temu
rodzic
commit
c7970e884f
25 zmienionych plików z 1279 dodań i 802 usunięć
  1. 51
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java
  2. 5
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java
  3. 11
    3
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java
  4. 173
    9
      ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java
  5. 22
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java
  6. 6
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java
  7. 6
    177
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java
  8. 8
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java
  9. 14
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java
  10. 18
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java
  11. 1
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java
  12. 3
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java
  13. 258
    101
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java
  14. 10
    12
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java
  15. 34
    14
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java
  16. 8
    6
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java
  17. 324
    252
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java
  18. 66
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java
  19. 24
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java
  20. 8
    8
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java
  21. 48
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java
  22. 12
    2
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml
  23. 18
    10
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml
  24. 114
    203
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml
  25. 37
    2
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml

+ 51
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java Wyświetl plik

@@ -1,11 +1,15 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate;
2 2
 
3 3
 import cn.hutool.core.collection.CollectionUtil;
4
+import cn.hutool.core.util.StrUtil;
4 5
 import com.ruoyi.common.core.controller.BaseController;
5 6
 import com.ruoyi.common.core.domain.AjaxResult;
7
+import com.ruoyi.common.core.page.TableDataInfo;
6 8
 import com.ruoyi.common.core.redis.RedisCache;
9
+import com.ruoyi.wisdomarbitrate.StringIdsReq;
7 10
 import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication;
8 11
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
12
+import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
9 13
 import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
10 14
 import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
11 15
 import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
@@ -22,7 +26,41 @@ public class AdjudicationController extends BaseController {
22 26
     @Autowired
23 27
     private IAdjudicationService adjudicationService;
24 28
 
29
+    /**
30
+     * 根据签署流程id查询批量签名链接
31
+     */
32
+//    @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')")
33
+    @PostMapping("/selectBatchSignUrl")
34
+    public AjaxResult selectBatchSignUrl(@RequestBody StringIdsReq idsReq) {
35
+        if(CollectionUtil.isEmpty(idsReq.getIds())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
36
+            return error("参数校验失败");
37
+        }
38
+        SealSignRecord sealSignRecordselect = adjudicationService.selectBatchSignUrl(idsReq);
39
+        return success(sealSignRecordselect);
40
+    }
25 41
 
42
+    /**
43
+     * 根据签署流程id查询批量用印链接
44
+     */
45
+//    @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')")
46
+    @PostMapping("/selectBatchSealUrl")
47
+    public AjaxResult selectBatchSealUrl(@RequestBody StringIdsReq idsReq) {
48
+        if(CollectionUtil.isEmpty(idsReq.getIds())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
49
+            return error("参数校验失败");
50
+        }
51
+        SealSignRecord sealSignRecordselect = adjudicationService.selectBatchSealUrl(idsReq);
52
+        return success(sealSignRecordselect);
53
+    }
54
+    /**
55
+     * 根据仲裁员手机号分页查询待签名/待用印的案件
56
+     */
57
+//    @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')")
58
+    @GetMapping("/pageSignAdjudicate")
59
+    public TableDataInfo pageSignAdjudicate(@RequestParam(value = "personAccount",required = false) String personAccount, @RequestParam("caseStatus") Integer caseStatus)  {
60
+        startPage();
61
+        List<CaseApplication> list = adjudicationService.selectSealSigning(personAccount,caseStatus);
62
+        return getDataTable(list);
63
+    }
26 64
 
27 65
 
28 66
     /**
@@ -37,6 +75,18 @@ public class AdjudicationController extends BaseController {
37 75
         }
38 76
         return adjudicationService.createDocument(caseApplication);
39 77
     }
78
+    /**
79
+     * 批量生成裁决书
80
+     * @param caseApplication
81
+     * @return
82
+     */
83
+    @PostMapping("/batchDocument")
84
+    public AjaxResult batchDocument(@Validated @RequestBody BatchCaseApplication caseApplication){
85
+        if (CollectionUtil.isEmpty(caseApplication.getIds())) {
86
+            return AjaxResult.error("参数校验失败");
87
+        }
88
+        return adjudicationService.batchDocument(caseApplication.getIds());
89
+    }
40 90
 
41 91
     /**
42 92
      * 重新生成裁决书
@@ -81,6 +131,7 @@ public class AdjudicationController extends BaseController {
81 131
         return adjudicationService.signature(caseApplication);
82 132
     }
83 133
 
134
+
84 135
     /**
85 136
      * 归档(暂时只改案件状态)
86 137
      * @param batchCaseApplication

+ 5
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java Wyświetl plik

@@ -14,10 +14,12 @@ import com.ruoyi.common.exception.EsignDemoException;
14 14
 import com.ruoyi.common.exception.ServiceException;
15 15
 import com.ruoyi.common.utils.WxAppletNotifyUtils;
16 16
 import com.ruoyi.util.FileUtil;
17
+import com.ruoyi.wisdomarbitrate.StringIdsReq;
17 18
 import com.ruoyi.wisdomarbitrate.domain.*;
18 19
 import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
19 20
 import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
20 21
 import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
22
+import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
21 23
 import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
22 24
 import org.springframework.beans.factory.annotation.Autowired;
23 25
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -40,6 +42,8 @@ import java.util.List;
40 42
 public class CaseApplicationController extends BaseController {
41 43
     @Autowired
42 44
     private ICaseApplicationService caseApplicationService;
45
+    @Autowired
46
+    private IAdjudicationService adjudicationService;
43 47
 
44 48
 
45 49
     /**
@@ -171,6 +175,7 @@ public class CaseApplicationController extends BaseController {
171 175
         return success(sealSignRecordselect);
172 176
     }
173 177
 
178
+
174 179
     /**
175 180
      * 查询用印链接
176 181
      */

+ 11
- 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java Wyświetl plik

@@ -1,6 +1,8 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate;
2 2
 
3
+import cn.hutool.core.collection.CollectionUtil;
3 4
 import com.ruoyi.common.core.domain.AjaxResult;
5
+import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication;
4 6
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
5 7
 import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO;
6 8
 import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
@@ -9,6 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired;
9 11
 import org.springframework.validation.annotation.Validated;
10 12
 import org.springframework.web.bind.annotation.*;
11 13
 
14
+import java.util.ArrayList;
15
+import java.util.List;
16
+
12 17
 /**
13 18
  * 缴费支付
14 19
  */
@@ -43,13 +48,16 @@ public class CasePaymentController {
43 48
 
44 49
     /**
45 50
      * 缴费确认
46
-     * @param caseApplication
51
+     * @param batchCaseApplication
47 52
      * @return
48 53
      */
49 54
 //    @PreAuthorize("@ss.hasPermi('paymentManagement:list:payconfirm')")
50 55
     @PutMapping("/confirm")
51
-    public AjaxResult confirmPayment(@Validated @RequestBody CaseApplication caseApplication) {
52
-        return paymentService.confirmPayment(caseApplication);
56
+    public AjaxResult confirmPayment(@Validated @RequestBody BatchCaseApplication batchCaseApplication) {
57
+        if(CollectionUtil.isEmpty(batchCaseApplication.getIds())){
58
+            return AjaxResult.error("参数校验失败");
59
+        }
60
+            return paymentService.confirmPayment(batchCaseApplication.getIds());
53 61
     }
54 62
     /**
55 63
      * 缴费列表查询

+ 173
- 9
ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java Wyświetl plik

@@ -1,6 +1,8 @@
1 1
 package com.ruoyi.common.utils;
2 2
 
3 3
 
4
+
5
+import com.ruoyi.common.utils.uuid.UUID;
4 6
 import lombok.Data;
5 7
 import lombok.extern.slf4j.Slf4j;
6 8
 import org.springframework.beans.factory.annotation.Value;
@@ -14,18 +16,17 @@ import org.springframework.stereotype.Component;
14 16
 import javax.activation.DataHandler;
15 17
 import javax.mail.*;
16 18
 import javax.mail.internet.*;
19
+import javax.mail.search.*;
17 20
 import javax.mail.util.ByteArrayDataSource;
18 21
 import javax.validation.constraints.NotNull;
19
-import java.io.File;
20
-import java.io.IOException;
22
+import java.io.*;
21 23
 import java.nio.file.Files;
22 24
 import java.nio.file.Paths;
23 25
 import java.security.Security;
24
-import java.util.Date;
25
-import java.util.List;
26
-import java.util.Properties;
26
+import java.util.*;
27 27
 import java.util.regex.Matcher;
28 28
 import java.util.regex.Pattern;
29
+import java.util.stream.Stream;
29 30
 
30 31
 /**
31 32
  * @ClassName EmailInUtil
@@ -48,10 +49,12 @@ public class EmailOutUtil {
48 49
 //    private static String fromOut;
49 50
     @Value("${spring.mail.host}")
50 51
     private String hostOut;
51
-    @Value("${spring.mail.username}")
52
-    private String usernameOut;
53
-    @Value("${spring.mail.password}")
54
-    private String passwordOut;
52
+//    @Value("${spring.mail.username}")
53
+//    private String usernameOut;
54
+    private String usernameOut="wq18792927508@163.com";
55
+//    @Value("${spring.mail.password}")
56
+//    private String passwordOut;
57
+    private String passwordOut= "WDFHKSEMCKVRELEA";
55 58
     @Value("${spring.mail.port}")
56 59
     private Integer portOut;
57 60
 
@@ -98,6 +101,7 @@ public class EmailOutUtil {
98 101
             String messageContent = "<html><body><p style=\"font-family: Arial, sans-serif; font-size: 18px;\">"+message+"。</p></body></html>";
99 102
             MimeBodyPart messageBodyPart = new MimeBodyPart();
100 103
             messageBodyPart.setContent(messageContent, "text/html;charset=utf-8");
104
+            messageBodyPart.setContentID(UUID.randomUUID().toString());
101 105
             Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
102 106
             final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
103 107
             //设置邮件会话参数
@@ -269,4 +273,164 @@ public class EmailOutUtil {
269 273
         }
270 274
         return flag;
271 275
     }
276
+public  void buildReceiveConnect() throws Exception {
277
+
278
+    //POP3主机名
279
+    String host = "pop3.163.com";
280
+    //设置传输协议
281
+    String protocol = "pop3";
282
+    //用户账号
283
+    String username = "wq18792927508@163.com";
284
+    //密码或者授权码
285
+    String password = "WDFHKSEMCKVRELEA";
286
+    /*
287
+     * 获取Session
288
+     */
289
+    Properties props = new Properties();
290
+    //协议
291
+    props.setProperty("mail.store.protocol", protocol);
292
+    //POP3主机名
293
+    props.setProperty("mail.pop3.host", host);
294
+    props.setProperty("mail.smtp.auth", "true");
295
+    props.setProperty("mail.pop3.default-encoding", "UTF-8");
296
+    Session session = Session.getDefaultInstance(props, new Authenticator() {
297
+        @Override
298
+        protected PasswordAuthentication getPasswordAuthentication() {
299
+            return new PasswordAuthentication(usernameOut, passwordOut);
300
+        }
301
+    });
302
+    URLName urlName = new URLName(protocol, host, 110, null, username, password);
303
+    Store store = session.getStore(urlName);
304
+    store.connect(username, password);
305
+
306
+
307
+    Folder folder = store.getFolder("INBOX");
308
+
309
+    folder.open(Folder.READ_ONLY);
310
+
311
+    }
312
+    /**
313
+     * 接收邮件
314
+     */
315
+    public List<String> receiverMail() {
316
+        List<String> messageIds=new ArrayList<>();
317
+
318
+//        session.setDebug(true);
319
+
320
+        try {
321
+            //POP3主机名
322
+            String host = "pop3.163.com";
323
+            //设置传输协议
324
+            String protocol = "pop3";
325
+            //用户账号
326
+            String username = "wq18792927508@163.com";
327
+            //密码或者授权码
328
+            String password = "WDFHKSEMCKVRELEA";
329
+            /*
330
+             * 获取Session
331
+             */
332
+            Properties props = new Properties();
333
+            //协议
334
+            props.setProperty("mail.store.protocol", protocol);
335
+            //POP3主机名
336
+            props.setProperty("mail.pop3.host", host);
337
+            props.setProperty("mail.smtp.auth", "true");
338
+            props.setProperty("mail.pop3.default-encoding", "UTF-8");
339
+            Session session = Session.getDefaultInstance(props, new Authenticator() {
340
+                @Override
341
+                protected PasswordAuthentication getPasswordAuthentication() {
342
+                    return new PasswordAuthentication(usernameOut, passwordOut);
343
+                }
344
+            });
345
+            URLName urlName = new URLName(protocol, host, 110, null, username, password);
346
+            Store store = session.getStore(urlName);
347
+            store.connect(username, password);
348
+
349
+
350
+            Folder folder = store.getFolder("INBOX");
351
+            folder.open(Folder.READ_ONLY);
352
+            SearchTerm orTerm = new SubjectTerm("退信");
353
+        //    Message[] messages = folder.search(orTerm);
354
+            Date  endTime= new Date();
355
+            long oneDayMillis=24*60*60*1000L;
356
+            Date startTime=new Date(endTime.getTime()-oneDayMillis);
357
+         //   SearchTerm comparisonTermGe = new SentDateTerm(ComparisonTerm.GE, startTime);
358
+         //   SearchTerm comparisonTermLe = new SentDateTerm(ComparisonTerm.LE, endTime);
359
+        //    SearchTerm comparisonAndTerm = new AndTerm(comparisonTermGe, comparisonTermLe);
360
+          //  SearchTerm searchTerm = new AndTerm(comparisonAndTerm, orTerm);
361
+            Message[] messages = folder.search(orTerm);
362
+            if (messages != null) {
363
+
364
+                Arrays.stream(messages).forEach(message -> {
365
+                    String messageId="";
366
+                    try {
367
+                        messageId = EmailUtil.getMessageId(message,session);
368
+                    } catch (Exception e) {
369
+                        e.printStackTrace();
370
+                    }
371
+                    messageIds.add(messageId);
372
+                });
373
+
374
+            }
375
+
376
+            folder.close(false);
377
+            store.close();
378
+        } catch (Exception e) {
379
+           return messageIds;
380
+        }
381
+        return messageIds;
382
+    }
383
+
384
+    public void analyseMail(Session session, Object content) throws Exception {
385
+
386
+        if (content instanceof Multipart) {
387
+            Multipart multipart = (Multipart) content;
388
+            for (int i = 0; i < multipart.getCount(); i++) {
389
+                BodyPart bodyPart = multipart.getBodyPart(i);
390
+//                if (bodyPart.isMimeType("message/rfc822")) {   if(bodyPart.getContentType().startsWith("Message/Rfc822"));
391
+//                    MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream());
392
+//                }
393
+                if(bodyPart.isMimeType("Message/Rfc822")){
394
+                    MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream());
395
+                }
396
+            }
397
+        }
398
+    }
399
+    public static String getMessageId(Part part) throws Exception {
400
+               if (!part.isMimeType("multipart/*")) {
401
+                    return "";
402
+                }
403
+
404
+            Multipart multipart = (Multipart) part.getContent();
405
+            for (int i = 0; i < multipart.getCount(); i++) {
406
+                    BodyPart bodyPart = multipart.getBodyPart(i);
407
+
408
+                    if (part.isMimeType("message/rfc822")) {
409
+                         return getMessageId((Part) part.getContent());
410
+                     }
411
+                    InputStream inputStream = bodyPart.getInputStream();
412
+
413
+                    try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream))) {
414
+                         String strLine;
415
+                         while ((strLine = br.readLine()) != null) {
416
+                             if (strLine.startsWith("Message_Id:")) {
417
+                                     String[] split = strLine.split("Message_Id:");
418
+                                     return split.length > 1 ? split[1].trim() : null;
419
+                                 }
420
+                         }
421
+                     }
422
+                }
423
+
424
+                return "";
425
+            }
426
+
427
+
428
+//检查退信邮件
429
+//                Folder folder = ...; //打开收件箱
430
+//                Message[] messages = folder.getMessages();
431
+//                for (Message message : messages) {
432
+//                    if (message.getSubject().contains("Delivery Status Notification")) {
433
+//                        System.out.println("Delivery failed for recipient: " + message.getRecipients()[0]);
434
+//                    }
435
+//                }
272 436
 }

+ 22
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java Wyświetl plik

@@ -0,0 +1,22 @@
1
+package com.ruoyi.wisdomarbitrate;
2
+
3
+import lombok.Data;
4
+
5
+import java.util.List;
6
+
7
+@Data
8
+public class StringIdsReq {
9
+    private List<String> ids;
10
+    /**
11
+     * 签署人账号(即仲裁员手机号)
12
+     */
13
+    private String psnAccount;
14
+    /**
15
+     * 签署人id
16
+     */
17
+    private String psnId ;
18
+    /**
19
+     * 机构账户
20
+     */
21
+    private String orgId ;
22
+}

+ 6
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java Wyświetl plik

@@ -408,4 +408,10 @@ public class CaseApplication  extends BaseEntity {
408 408
      * 自定义字段
409 409
      */
410 410
     private List<ColumnValue> columnValues;
411
+    /**
412
+     * 待办状态,0待办,1已办
413
+     */
414
+    private Integer pendingStatus;
415
+   /** e签宝流程id */
416
+    private String signFlowId;;
411 417
 }

+ 6
- 177
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java Wyświetl plik

@@ -1,7 +1,13 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain;
2 2
 
3 3
 import com.ruoyi.common.core.domain.BaseEntity;
4
+import lombok.AllArgsConstructor;
5
+import lombok.Data;
6
+import lombok.NoArgsConstructor;
4 7
 
8
+@Data
9
+@NoArgsConstructor
10
+@AllArgsConstructor
5 11
 public class SealSignRecord extends BaseEntity {
6 12
     private static final long serialVersionUID = 1L;
7 13
 
@@ -25,15 +31,6 @@ public class SealSignRecord extends BaseEntity {
25 31
     private String orgnizeNamepsnName;
26 32
 
27 33
     String fileDownloadUrl;
28
-
29
-    public String getFileDownloadUrl() {
30
-        return fileDownloadUrl;
31
-    }
32
-
33
-    public void setFileDownloadUrl(String fileDownloadUrl) {
34
-        this.fileDownloadUrl = fileDownloadUrl;
35
-    }
36
-
37 34
     /** 流程状态 */
38 35
     private Integer signFlowStatus;
39 36
     /** 签名状态 */
@@ -44,171 +41,11 @@ public class SealSignRecord extends BaseEntity {
44 41
     /** 签名链接 */
45 42
     private String signUrl;
46 43
 
47
-    public String getSignUrl() {
48
-        return signUrl;
49
-    }
50
-
51
-    public void setSignUrl(String signUrl) {
52
-        this.signUrl = signUrl;
53
-    }
54
-
55
-    public String getSealUrl() {
56
-        return sealUrl;
57
-    }
58
-
59
-    public void setSealUrl(String sealUrl) {
60
-        this.sealUrl = sealUrl;
61
-    }
62
-
63 44
     /** 用印链接 */
64 45
     private String sealUrl;
65 46
 
66 47
     private Long caseAppliId;
67 48
 
68
-    public Long getCaseAppliId() {
69
-        return caseAppliId;
70
-    }
71
-
72
-    public void setCaseAppliId(Long caseAppliId) {
73
-        this.caseAppliId = caseAppliId;
74
-    }
75
-
76
-    public Integer getPsnsignStatus() {
77
-        return psnsignStatus;
78
-    }
79
-
80
-    public void setPsnsignStatus(Integer psnsignStatus) {
81
-        this.psnsignStatus = psnsignStatus;
82
-    }
83
-
84
-    public Integer getOrgsignStatus() {
85
-        return orgsignStatus;
86
-    }
87
-
88
-    public void setOrgsignStatus(Integer orgsignStatus) {
89
-        this.orgsignStatus = orgsignStatus;
90
-    }
91
-
92
-    public Integer getSignFlowStatus() {
93
-        return signFlowStatus;
94
-    }
95
-
96
-    public void setSignFlowStatus(Integer signFlowStatus) {
97
-        this.signFlowStatus = signFlowStatus;
98
-    }
99
-
100
-    public String getFileid() {
101
-        return fileid;
102
-    }
103
-
104
-    public void setFileid(String fileid) {
105
-        this.fileid = fileid;
106
-    }
107
-
108
-    public String getFilename() {
109
-        return filename;
110
-    }
111
-
112
-    public void setFilename(String filename) {
113
-        this.filename = filename;
114
-    }
115
-
116
-    public String getSignFlowid() {
117
-        return signFlowid;
118
-    }
119
-
120
-    public void setSignFlowid(String signFlowid) {
121
-        this.signFlowid = signFlowid;
122
-    }
123
-
124
-    public String getPensonAccount() {
125
-        return pensonAccount;
126
-    }
127
-
128
-    public void setPensonAccount(String pensonAccount) {
129
-        this.pensonAccount = pensonAccount;
130
-    }
131
-
132
-    public String getPensonName() {
133
-        return pensonName;
134
-    }
135
-
136
-    public void setPensonName(String pensonName) {
137
-        this.pensonName = pensonName;
138
-    }
139
-
140
-    public String getOrgnizeName() {
141
-        return orgnizeName;
142
-    }
143
-
144
-    public void setOrgnizeName(String orgnizeName) {
145
-        this.orgnizeName = orgnizeName;
146
-    }
147
-
148
-    public String getOrgnizeNamePsnAccount() {
149
-        return orgnizeNamePsnAccount;
150
-    }
151
-
152
-    public void setOrgnizeNamePsnAccount(String orgnizeNamePsnAccount) {
153
-        this.orgnizeNamePsnAccount = orgnizeNamePsnAccount;
154
-    }
155
-
156
-    public String getOrgnizeNamepsnName() {
157
-        return orgnizeNamepsnName;
158
-    }
159
-
160
-    public void setOrgnizeNamepsnName(String orgnizeNamepsnName) {
161
-        this.orgnizeNamepsnName = orgnizeNamepsnName;
162
-    }
163
-
164
-    public String getPositionPagepsn() {
165
-        return positionPagepsn;
166
-    }
167
-
168
-    public void setPositionPagepsn(String positionPagepsn) {
169
-        this.positionPagepsn = positionPagepsn;
170
-    }
171
-
172
-    public double getPositionXpsn() {
173
-        return positionXpsn;
174
-    }
175
-
176
-    public void setPositionXpsn(double positionXpsn) {
177
-        this.positionXpsn = positionXpsn;
178
-    }
179
-
180
-    public double getPositionYpsn() {
181
-        return positionYpsn;
182
-    }
183
-
184
-    public void setPositionYpsn(double positionYpsn) {
185
-        this.positionYpsn = positionYpsn;
186
-    }
187
-
188
-    public String getPositionPageorg() {
189
-        return positionPageorg;
190
-    }
191
-
192
-    public void setPositionPageorg(String positionPageorg) {
193
-        this.positionPageorg = positionPageorg;
194
-    }
195
-
196
-    public double getPositionXorg() {
197
-        return positionXorg;
198
-    }
199
-
200
-    public void setPositionXorg(double positionXorg) {
201
-        this.positionXorg = positionXorg;
202
-    }
203
-
204
-    public double getPositionYorg() {
205
-        return positionYorg;
206
-    }
207
-
208
-    public void setPositionYorg(double positionYorg) {
209
-        this.positionYorg = positionYorg;
210
-    }
211
-
212 49
     /** 签名位置页数 */
213 50
     private String positionPagepsn;
214 51
     /** 签名位置x坐标 */
@@ -223,13 +60,5 @@ public class SealSignRecord extends BaseEntity {
223 60
     private double positionYorg;
224 61
 
225 62
 
226
-    public Long getId() {
227
-        return id;
228
-    }
229
-
230
-    public void setId(Long id) {
231
-        this.id = id;
232
-    }
233
-
234 63
 
235 64
 }

+ 8
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java Wyświetl plik

@@ -38,7 +38,7 @@ public interface CaseApplicationLogMapper {
38 38
     Integer selectMaxVersionBySecret(@Param("caseAppliId")Long id);
39 39
 
40 40
     /**
41
-     * 根据案件id删除案件记录表和案件关联人日志
41
+     * 删除日志
42 42
      * @param ids
43 43
      */
44 44
     void batchDeleteLog(@Param("ids") List<Long> ids);
@@ -46,4 +46,11 @@ public interface CaseApplicationLogMapper {
46 46
     CaseApplication selectBeforeCase(@Param("caseId") Long caseId, @Param("version")Integer version);
47 47
 
48 48
     Integer batchSave(@Param("list")List<CaseApplication> caseApplications);
49
+
50
+    /**
51
+     * 根据案件id查询所有的日志id
52
+     * @param ids
53
+     * @return
54
+     */
55
+    List<Long> selectLogsByCaseIds(@Param("ids")List<Long> ids);
49 56
 }

+ 14
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java Wyświetl plik

@@ -2,15 +2,29 @@ package com.ruoyi.wisdomarbitrate.mapper;
2 2
 
3 3
 
4 4
 
5
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
5 6
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
7
+import org.apache.ibatis.annotations.Param;
6 8
 
7 9
 import java.util.List;
8 10
 
9 11
 public interface SealSignRecordMapper {
10 12
     List<SealSignRecord> selectSealSignRecord(SealSignRecord sealSignRecord);
11 13
 
14
+    /**
15
+     * 查询已签署和签署中的文件
16
+     * @param sealSignRecord
17
+     * @return
18
+     */
12 19
     List<SealSignRecord> selectSealSignRecordbyStat(SealSignRecord sealSignRecord);
13 20
 
21
+    /**
22
+     * 差询等待签署,签署中的案件
23
+     * @param penSonAccount 签署人员
24
+     * @return
25
+     */
26
+    List<CaseApplication> selectSealSigning(@Param("penSonAccount") String penSonAccount, @Param("caseStatus") Integer caseStatus);
27
+
14 28
     int updataSealSignRecord(SealSignRecord sealSignRecord);
15 29
 
16 30
 

+ 18
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java Wyświetl plik

@@ -1,8 +1,10 @@
1 1
 package com.ruoyi.wisdomarbitrate.service;
2 2
 
3 3
 import com.ruoyi.common.core.domain.AjaxResult;
4
+import com.ruoyi.wisdomarbitrate.StringIdsReq;
4 5
 import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication;
5 6
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
7
+import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
6 8
 import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
7 9
 
8 10
 import java.util.List;
@@ -39,4 +41,20 @@ public interface IAdjudicationService {
39 41
      * @return
40 42
      */
41 43
     AjaxResult batchDocument(List<Long> ids);
44
+
45
+    /**
46
+     * 根据签署流程id查询批量签名链接
47
+     * @param idsReq
48
+     * @return
49
+     */
50
+    SealSignRecord selectBatchSignUrl( StringIdsReq idsReq);
51
+
52
+    /**
53
+     * 根据仲裁员手机号分页查询等待签署,签署中的裁决书
54
+     * @param personAccount
55
+     * @return
56
+     */
57
+    List<CaseApplication> selectSealSigning(String personAccount,Integer caseStatus);
58
+
59
+    SealSignRecord selectBatchSealUrl(StringIdsReq idsReq);
42 60
 }

+ 1
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java Wyświetl plik

@@ -135,4 +135,5 @@ public interface ICaseApplicationService {
135 135
     AjaxResult editCaseApplicationDefineval(CaseApplication caseApplication);
136 136
 
137 137
     CaseAttach downloadCaseZipFile(CaseApplication caseApplication);
138
+
138 139
 }

+ 3
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java Wyświetl plik

@@ -6,13 +6,15 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
6 6
 import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO;
7 7
 import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
8 8
 
9
+import java.util.List;
10
+
9 11
 public interface ICasePaymentService {
10 12
     /**
11 13
      * 案件缴费
12 14
      */
13 15
     AjaxResult casePay(CasePayDTO casePayDTO);
14 16
 
15
-    AjaxResult confirmPayment(CaseApplication caseApplication);
17
+    AjaxResult confirmPayment( List<Long> ids);
16 18
 
17 19
     /**
18 20
      * 确认缴费

+ 258
- 101
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Wyświetl plik

@@ -5,15 +5,21 @@ import cn.hutool.core.util.StrUtil;
5 5
 import com.alibaba.fastjson.JSON;
6 6
 import com.alibaba.fastjson.JSONObject;
7 7
 import com.deepoove.poi.data.PictureRenderData;
8
+import com.google.gson.Gson;
9
+import com.google.gson.JsonObject;
8 10
 import com.ruoyi.common.constant.CaseApplicationConstants;
11
+import com.ruoyi.common.core.controller.BaseController;
9 12
 import com.ruoyi.common.core.domain.AjaxResult;
13
+import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
10 14
 import com.ruoyi.common.core.domain.entity.SysDictData;
11 15
 import com.ruoyi.common.core.redis.RedisCache;
16
+import com.ruoyi.common.exception.EsignDemoException;
12 17
 import com.ruoyi.common.exception.ServiceException;
13 18
 import com.ruoyi.common.utils.*;
14 19
 import com.ruoyi.common.utils.thread.MultipleThreadListParam;
15 20
 import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil;
16 21
 import com.ruoyi.system.mapper.SysDictDataMapper;
22
+import com.ruoyi.wisdomarbitrate.StringIdsReq;
17 23
 import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
18 24
 import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
19 25
 import com.ruoyi.wisdomarbitrate.mapper.*;
@@ -24,6 +30,7 @@ import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
24 30
 import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
25 31
 import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
26 32
 import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService;
33
+import com.ruoyi.wisdomarbitrate.utils.SignAward;
27 34
 import lombok.extern.slf4j.Slf4j;
28 35
 import org.apache.poi.ss.usermodel.Sheet;
29 36
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -57,6 +64,7 @@ import java.util.regex.Matcher;
57 64
 import java.util.regex.Pattern;
58 65
 import java.util.stream.Collectors;
59 66
 
67
+import static com.ruoyi.common.utils.PageUtils.startPage;
60 68
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
61 69
 
62 70
 @Service
@@ -92,9 +100,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
92 100
     private FatchRuleMapper fatchRuleMapper;
93 101
     @Autowired
94 102
     private SysDictDataMapper dictDataMapper;
103
+    @Autowired
104
+    private SealManageMapper sealManageMapper;
105
+    @Autowired
106
+    private SealSignRecordMapper sealSignRecordMapper;
107
+
95 108
 
96 109
     // 仲裁反请求模板内容
97
-    private final String counterclaim= "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
110
+    private final String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
98 111
             "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" +
99 112
             "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
100 113
     // 财产保全内容
@@ -104,36 +117,37 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
104 117
     String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" +
105 118
             ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
106 119
     // 线上开庭时+线上仲裁
107
-    String onLineDate="{{onLineDate}}";
108
-    String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"+onLineDate+"通过仲裁委智慧仲裁平台开庭审理了本案。";
120
+    String onLineDate = "{{onLineDate}}";
121
+    String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + onLineDate + "通过仲裁委智慧仲裁平台开庭审理了本案。";
109 122
     // 开庭+线下仲裁
110
-    String offLineDate="{{offLineDate}}";
111
-    String offLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于 "+offLineDate+"在仲裁委所在地开庭审理了本案。";
123
+    String offLineDate = "{{offLineDate}}";
124
+    String offLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于 " + offLineDate + "在仲裁委所在地开庭审理了本案。";
112 125
     //书面仲裁时
113
-    String writtenDate="{{writtenDate}}";
114
-    String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"+writtenDate+"在仲裁委所在地开庭审理了本案。仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,根据《2022年版仲裁规则》第五十八条的规定对本案进行了书面审理。 ";
126
+    String writtenDate = "{{writtenDate}}";
127
+    String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + writtenDate + "在仲裁委所在地开庭审理了本案。仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,根据《2022年版仲裁规则》第五十八条的规定对本案进行了书面审理。 ";
115 128
     //开庭+缺席审理
116
-    String absent = "申请人的特别授权委托代理人{{agentName}}"+"出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
129
+    String absent = "申请人的特别授权委托代理人{{agentName}}" + "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
117 130
             "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" +
118
-            "            \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。"+"综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
131
+            "            \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。" + "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
119 132
             "第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
120 133
     // 开庭+出席
121
-    String attend="申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 ";
134
+    String attend = "申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 ";
122 135
     // 开庭+出席+被申提供证据
123
-    String onLineAttendFile="庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;双方当事人均出示了证据材料并对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 ";
136
+    String onLineAttendFile = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;双方当事人均出示了证据材料并对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 ";
124 137
     // 开庭+出席+被申未提供证据
125
-    String onLineAttend="庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 ";
138
+    String onLineAttend = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 ";
126 139
     // 被申请人出席答辩意见
127
-    String resAttendOpinion="\n(二)被申请人的答辩意见  \n(三)当事人提供的证据材料及对方的质证意见\n" +
140
+    String resAttendOpinion = "\n(二)被申请人的答辩意见  \n(三)当事人提供的证据材料及对方的质证意见\n" +
128 141
             "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}\n被申请人对上述材料的质证意见为:{{respondentOpinion}}\n";
129 142
     // 被申请人出席+被申请人提供了资料
130
-    String resFile="被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" +
143
+    String resFile = "被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" +
131 144
             "申请人对上述材料的质证意见为:{{applicantOpinion}}";
132 145
     // 被申请人缺席
133
-    String resAbsent="(二)当事人提供的证据材料\n" +
146
+    String resAbsent = "(二)当事人提供的证据材料\n" +
134 147
             "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}";
135 148
     // 日期格式化年月日
136 149
     SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
150
+
137 151
     @Override
138 152
     @Transactional
139 153
     public AjaxResult createDocument(CaseApplication caseApplicationReq) {
@@ -161,13 +175,13 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
161 175
                 return AjaxResult.error("请先指定裁决书模板");
162 176
             }
163 177
             templatePath = templateManages.get(0).getTemOrigPath();
164
-            if(StrUtil.isEmpty(templatePath)){
178
+            if (StrUtil.isEmpty(templatePath)) {
165 179
                 return AjaxResult.error("未找到该模板");
166 180
             }
167 181
 
168 182
             // todo 部署放开
169
-            if(templatePath!=null){
170
-                templatePath="/home/ruoyi/" +templatePath;
183
+            if (templatePath != null) {
184
+                templatePath = "/home/ruoyi/" + templatePath;
171 185
             }
172 186
             try {
173 187
                 File file = new File(templatePath);
@@ -198,15 +212,15 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
198 212
                 fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
199 213
             }
200 214
             // 自定义字段,从columnValue值取
201
-            if (fatchRuleMap.size()>0&&fatchRuleMap.containsKey(1)) {
215
+            if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) {
202 216
                 // 根据案件id查询key-value表
203 217
                 List<ColumnValue> columnValueList = columnValueMapper.listByCaseId(caseApplicationReq.getId());
204 218
                 if (CollectionUtil.isNotEmpty(columnValueList)) {
205 219
                     columnValueList.forEach(columnValue -> valueMap.put(columnValue.getName(), columnValue.getValue()));
206 220
                 }
207 221
             }
208
-                // 组装内置字段,在主表中查出内容
209
-                buildDefaultColumnValue(dictDataList,caseAffiliates,valueMap,caseApplicationById);
222
+            // 组装内置字段,在主表中查出内容
223
+            buildDefaultColumnValue(dictDataList, caseAffiliates, valueMap, caseApplicationById);
210 224
 
211 225
             // 获取模板中的占位符key
212 226
             List<String> bookmarkList = getBookmarkByDocx(templatePath);
@@ -214,9 +228,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
214 228
                 return AjaxResult.success("请检查模板是否配置正确,未获取到占位符");
215 229
             }
216 230
             // 遍历书签,给书签赋值
217
-            replaceBookmark(bookmarkList,datas,valueMap);
231
+            replaceBookmark(bookmarkList, datas, valueMap);
218 232
             // 根据条件替换书签
219
-            conditionReplaceBookmark(caseApplicationById,datas,agentName,resName,arbitrateRecordSelect);
233
+            conditionReplaceBookmark(caseApplicationById, datas, agentName, resName, arbitrateRecordSelect);
220 234
             // 裁决书生成时间
221 235
             LocalDate now = LocalDate.now();
222 236
             String year = Integer.toString(now.getYear());
@@ -226,7 +240,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
226 240
             // 裁决书编号
227 241
             datas.put("裁决书编号", equipmentNo);
228 242
             // 仲裁费
229
-            datas.put("仲裁费", caseApplicationById.getFeePayable().toString());
243
+            datas.put("仲裁费", caseApplicationById.getFeePayable() != null ? caseApplicationById.getFeePayable().toString() : "");
230 244
             // 案件创建时间
231 245
             Date createTime = caseApplicationById.getCreateTime();
232 246
             // 将日期格式化为字符串
@@ -248,7 +262,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
248 262
             String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
249 263
 //            String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName;
250 264
             // 将word中的标签替换掉,生成新的word
251
-            String docFilePath =  wordChangeText(templatePath,datas,saveFolderPath,fileName);
265
+            String docFilePath = wordChangeText(templatePath, datas, saveFolderPath, fileName);
252 266
 
253 267
             String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
254 268
             // 保存裁决书附件
@@ -262,14 +276,15 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
262 276
 
263 277
     /**
264 278
      * 将word中的标签替换掉,生成新的word
265
-     * @param modalFilePath 裁决书模板路径
266
-     * @param datas 替换标签的内容
279
+     *
280
+     * @param modalFilePath  裁决书模板路径
281
+     * @param datas          替换标签的内容
267 282
      * @param saveFolderPath 保存路径
268
-     * @param fileName 保存文件名
283
+     * @param fileName       保存文件名
269 284
      * @return
270 285
      * @throws IOException
271 286
      */
272
-    private String wordChangeText(String modalFilePath, Map<String, Object> datas, String saveFolderPath,String fileName) throws IOException {
287
+    private String wordChangeText(String modalFilePath, Map<String, Object> datas, String saveFolderPath, String fileName) throws IOException {
273 288
         String resultFilePath = saveFolderPath + "/" + fileName;
274 289
         // 创建日期目录
275 290
         File saveFolder = new File(saveFolderPath);
@@ -291,13 +306,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
291 306
 
292 307
     /**
293 308
      * 根据条件判断裁决书中是否需要该内容
294
-     * @param caseApplicationById 案件信息
295
-     * @param datas 替换标签值
296
-     * @param agentName 代理人名称
297
-     * @param resName 被申请人名称
298
-     * @param   arbitrateRecordSelect  仲裁记录
309
+     *
310
+     * @param caseApplicationById   案件信息
311
+     * @param datas                 替换标签值
312
+     * @param agentName             代理人名称
313
+     * @param resName               被申请人名称
314
+     * @param arbitrateRecordSelect 仲裁记录
299 315
      */
300
-    private void conditionReplaceBookmark(CaseApplication caseApplicationById, Map<String, Object> datas,String agentName,String resName, ArbitrateRecord arbitrateRecordSelect ) {
316
+    private void conditionReplaceBookmark(CaseApplication caseApplicationById, Map<String, Object> datas, String agentName, String resName, ArbitrateRecord arbitrateRecordSelect) {
301 317
         // 如果有仲裁反请求,该字段设置值
302 318
         Integer adjudicaCounter = caseApplicationById.getAdjudicaCounter();
303 319
         if (adjudicaCounter != null && adjudicaCounter == 1) {
@@ -344,7 +360,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
344 360
         }
345 361
         // todo 线上仲裁/线下仲裁方式未选择
346 362
         //线上开庭时+线上仲裁
347
-        if (arbitratMethod!=null&&arbitratMethod == 1) {
363
+        if (arbitratMethod != null && arbitratMethod == 1) {
348 364
             String replace = onLine.replace(onLineDate, Optional.of(hearDateStr).orElse(""));
349 365
             datas.put("线上开庭并线上仲裁", replace);
350 366
             // 所有附件
@@ -418,9 +434,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
418 434
 
419 435
     /**
420 436
      * 给模板中的占位符赋值
437
+     *
421 438
      * @param bookmarkList 书签
422
-     * @param datas 书签赋值
423
-     * @param valueMap 案件内容
439
+     * @param datas        书签赋值
440
+     * @param valueMap     案件内容
424 441
      */
425 442
     private void replaceBookmark(List<String> bookmarkList, Map<String, Object> datas, Map<String, String> valueMap) {
426 443
         for (String bookmark : bookmarkList) {
@@ -454,9 +471,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
454 471
 
455 472
     /**
456 473
      * 组装案件内置字段值,即主表和相关人员表信息
457
-     * @param dictDataList 内置字段
474
+     *
475
+     * @param dictDataList   内置字段
458 476
      * @param caseAffiliates 关联人员
459
-     * @param valueMap 组装的值
477
+     * @param valueMap       组装的值
460 478
      */
461 479
     private void buildDefaultColumnValue(List<SysDictData> dictDataList, List<CaseAffiliate> caseAffiliates, Map<String, String> valueMap, CaseApplication caseApplication) {
462 480
         if (CollectionUtil.isNotEmpty(dictDataList)) {
@@ -479,6 +497,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
479 497
                             case "被申请人住所":
480 498
                                 valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili());
481 499
                                 break;
500
+                            case "被申请人联系地址":
501
+                                valueMap.put(dictData.getDictLabel(), affiliate.getContactAddress());
502
+                                break;
482 503
                             case "被申请人联系电话":
483 504
                                 valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphone());
484 505
                                 break;
@@ -486,13 +507,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
486 507
                                 valueMap.put(dictData.getDictLabel(), affiliate.getEmail());
487 508
                                 break;
488 509
                             case "被申请人性别":
489
-                                if (dictData.getDictLabel().equals("被申请人性别")) {
490
-                                    String responSex = affiliate.getResponSex();
491
-                                    if (responSex.equals("0")) {
492
-                                        valueMap.put(dictData.getDictLabel(), "男");
493
-                                    } else {
494
-                                        valueMap.put(dictData.getDictLabel(), "女");
495
-                                    }
510
+                                String responSex = affiliate.getResponSex();
511
+                                if (responSex.equals("0")) {
512
+                                    valueMap.put(dictData.getDictLabel(), "男");
513
+                                } else {
514
+                                    valueMap.put(dictData.getDictLabel(), "女");
496 515
                                 }
497 516
                                 break;
498 517
                             case "被申请人出生年月日":
@@ -545,10 +564,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
545 564
                             default:
546 565
                                 break;
547 566
                         }
548
-                    }else {
567
+                    } else {
549 568
                         valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue()));
550 569
                     }
551
-                }else {
570
+                } else {
552 571
                     valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue()));
553 572
                 }
554 573
 
@@ -558,10 +577,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
558 577
 
559 578
     /**
560 579
      * 保存裁决书附件
561
-     * @param id 案件id
562
-     * @param saveName 保存的文件名
563
-     * @param savePath 保存路径
564
-     * @param caseApplicationById 案件基本信息
580
+     *
581
+     * @param id                    案件id
582
+     * @param saveName              保存的文件名
583
+     * @param savePath              保存路径
584
+     * @param caseApplicationById   案件基本信息
565 585
      * @param arbitrateRecordSelect 出裁决书生成记录
566 586
      */
567 587
     private void saveArbitorFile(Long id, String saveName, String savePath, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect) {
@@ -770,10 +790,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
770 790
                     String prefix = "/profile/upload/";
771 791
                     int startIndex = prefix.length();
772 792
                     String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
773
-                   File file = new File(path);
774
-                   if(!file.exists()){
775
-                       return AjaxResult.error("未生成裁决书");
776
-                   }
793
+                    File file = new File(path);
794
+                    // todo 部署放开
795
+                    if (!file.exists()) {
796
+                        return AjaxResult.error("未生成裁决书");
797
+                    }
777 798
 
778 799
                 }
779 800
             }
@@ -798,78 +819,105 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
798 819
                 }
799 820
             }
800 821
         }
801
-        //发送邮件
802
-        boolean b = sendCaseEmail(caseApplication1, appEmail, resEmail,caseAttachList);
822
+        //申请人发送邮件
823
+        boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList);
803 824
         SendMailRecord sendMailRecord = new SendMailRecord();
804 825
         sendMailRecord.setCaseId(id);
805 826
         sendMailRecord.setMailAddress(appEmail);
806 827
         sendMailRecord.setMailContent("您好,审核后的裁决书在附件中请查阅");
828
+//        sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
807 829
         sendMailRecord.setMailName("签署后的裁决书");
808 830
         sendMailRecord.setSendTime(new Date());
809 831
         sendMailRecord.setCreateBy(getUsername());
810
-        if (b) {
832
+        if (appEmailFlag) {
811 833
             sendMailRecord.setSendStatus(1);
812 834
         } else {
813 835
             sendMailRecord.setSendStatus(0);
814 836
         }
815 837
         sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
838
+        // 被申请人发送邮件
839
+        boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList);
840
+
816 841
         SendMailRecord sendMailRecord1 = new SendMailRecord();
817 842
         sendMailRecord1.setCaseId(id);
818 843
         sendMailRecord1.setMailAddress(resEmail);
844
+//        sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
819 845
         sendMailRecord1.setMailContent("您好,审核后的裁决书在附件中请查阅");
820 846
         sendMailRecord1.setMailName("签署后的裁决书");
821 847
         sendMailRecord1.setSendTime(new Date());
822 848
         sendMailRecord1.setCreateBy(getUsername());
823
-        if (b) {
849
+        if (resEmailFlag) {
824 850
             sendMailRecord1.setSendStatus(1);
825
-            // 发送短信
826
-            if(CollectionUtil.isNotEmpty(caseAffiliates)) {
851
+        }else {
852
+            sendMailRecord1.setSendStatus(0);
853
+        }
854
+        sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
855
+        if(!appEmailFlag&&!resEmailFlag){
856
+            throw new ServiceException("裁决书发送失败");
857
+        }
858
+        if(!appEmailFlag){
859
+            throw new ServiceException("申请人裁决书发送失败");
860
+        }
861
+        if(!resEmailFlag){
862
+            throw new ServiceException("被申请人裁决书发送失败");
863
+        }
864
+        // 发送短信
865
+        if (appEmailFlag||resEmailFlag) {
866
+
867
+            if (CollectionUtil.isNotEmpty(caseAffiliates)) {
827 868
                 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
828 869
                 request.setTemplateId("1990362");
829 870
                 for (CaseAffiliate affiliate : caseAffiliates) {
871
+                    String telphone=null;
872
+                    if(appEmailFlag&&affiliate.getIdentityType()==1){
873
+                         telphone = affiliate.getContactTelphone();
874
+                    }else if(resEmailFlag&&affiliate.getIdentityType()==2){
875
+                         telphone = affiliate.getContactTelphone();
876
+                    }
877
+                    if(StrUtil.isEmpty(telphone)){
878
+                        continue;
879
+                    }
830 880
 
831
-                    request.setPhone(affiliate.getContactTelphone());
881
+                    request.setPhone(telphone);
832 882
 //                    if(affiliate.getIdentityType() == 1) {
833 883
 //                        request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), appEmail});
834 884
 //                    }else {
835 885
 //                        request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), resEmail});
836 886
 //                    }
837
-                    request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum()});
887
+                    request.setTemplateParamSet(new String[]{affiliate.getName(), caseApplication1.getCaseNum()});
838 888
                     Boolean aBoolean = SmsUtils.sendSms(request);
839 889
 
840
-                       // 保存短信发送记录
841
-                        SmsSendRecord smsSendRecord = new SmsSendRecord();
842
-                        smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId());
890
+                    // 保存短信发送记录
891
+                    SmsSendRecord smsSendRecord = new SmsSendRecord();
892
+                    smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId());
843 893
 
844
-                        smsSendRecord.setCaseNum(caseApplication1.getCaseNum());
845
-                        smsSendRecord.setPhone(request.getPhone());
846
-                        smsSendRecord.setSendTime(new Date());
894
+                    smsSendRecord.setCaseNum(caseApplication1.getCaseNum());
895
+                    smsSendRecord.setPhone(request.getPhone());
896
+                    smsSendRecord.setSendTime(new Date());
847 897
 //                        // 尊敬的{1}用户,您的{2}仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。
848 898
 //                        if(affiliate.getIdentityType() == 1) {
849 899
 //                            smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +appEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。");
850 900
 //                        }else {
851 901
 //                            smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +resEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。");
852 902
 //                        }
853
-                    smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。");
903
+                    smsSendRecord.setSendContent("尊敬的" + affiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。");
854 904
 
855 905
 
856 906
                     smsSendRecord.setCreateBy(getUsername());
857
-                        if (aBoolean) {
858
-                            smsSendRecord.setSendStatus(1);
859
-                        } else {
860
-                            smsSendRecord.setSendStatus(0);
861
-                        }
862
-                        smsRecordMapper.saveSmsSendRecord(smsSendRecord);
907
+                    if (aBoolean) {
908
+                        smsSendRecord.setSendStatus(1);
909
+                    } else {
910
+                        smsSendRecord.setSendStatus(0);
911
+                    }
912
+                    smsRecordMapper.saveSmsSendRecord(smsSendRecord);
863 913
 
864 914
 
865 915
                 }
866 916
 
867 917
             }
868 918
 
869
-        } else {
870
-            sendMailRecord1.setSendStatus(0);
871 919
         }
872
-        sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
920
+
873 921
 
874 922
         // 新增日志
875 923
         CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, "");
@@ -881,10 +929,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
881 929
      * 通过邮件发送裁决书文件
882 930
      *
883 931
      * @param caseApplication1
884
-     * @param appEmail
885
-     * @param resEmail
886 932
      */
887
-    private boolean sendCaseEmail(CaseApplication caseApplication1, String appEmail, String resEmail,  List<CaseAttach> caseAttachList) {
933
+    private boolean sendCaseEmail(CaseApplication caseApplication1, String email, List<CaseAttach> caseAttachList) {
888 934
         List<File> fileList = new ArrayList<>();
889 935
         File file = null;
890 936
         if (caseAttachList != null && caseAttachList.size() > 0) {
@@ -894,7 +940,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
894 940
                     String prefix = "/profile/upload/";
895 941
                     int startIndex = prefix.length();
896 942
                     String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
943
+                    // todo 部署放开
897 944
                     file = new File(path);
945
+//                    file = new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\09\\b10b20d66cfa44df8995c3999e3b6266.pdf");
898 946
                     fileList.add(file);
899 947
                     System.out.println("文件长度==================:" + file.length());
900 948
                 }
@@ -903,9 +951,19 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
903 951
 
904 952
         if (file != null && file.exists()) {
905 953
             try {
906
-                Boolean aBoolean = emailOutUtil.sendEmil(appEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
907
-                Boolean aBoolean1 = emailOutUtil.sendEmil(resEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
908
-                if (aBoolean && aBoolean1) {
954
+                Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
955
+
956
+//                String appUid = UUID.randomUUID().toString();
957
+//                Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅", appUid +"裁决书", fileList, null);
958
+//           //     Thread.sleep(20);
959
+                // 收到退信的所有id,即发送失败的uuid
960
+            //    emailOutUtil.receiverMail();
961
+          //      Thread.sleep(3);
962
+           //   List<String> messageIds = emailOutUtil.receiverMail();
963
+//                if (aBoolean&&(CollectionUtil.isEmpty(messageIds)||!messageIds.contains(appUid))) {
964
+//                    return Boolean.TRUE;
965
+//                }
966
+                if (aBoolean) {
909 967
                     return Boolean.TRUE;
910 968
                 }
911 969
             } catch (Exception e) {
@@ -1255,14 +1313,16 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
1255 1313
         }
1256 1314
         return AjaxResult.success(bookSendVO);
1257 1315
     }
1258
-    private void setExecList(List<MultipleThreadListParam> execList, List<ColumnValue> columnValueList){
1259
-        if(CollectionUtil.isNotEmpty(columnValueList)){
1260
-            Function<List<ColumnValue>,Integer> function= columnValueMapper::batchSave;
1261
-            execList.add(new MultipleThreadListParam(function,columnValueList));
1316
+
1317
+    private void setExecList(List<MultipleThreadListParam> execList, List<ColumnValue> columnValueList) {
1318
+        if (CollectionUtil.isNotEmpty(columnValueList)) {
1319
+            Function<List<ColumnValue>, Integer> function = columnValueMapper::batchSave;
1320
+            execList.add(new MultipleThreadListParam(function, columnValueList));
1262 1321
         }
1263 1322
 
1264 1323
     }
1265
-   @Transactional
1324
+
1325
+    @Transactional
1266 1326
     @Override
1267 1327
     public AjaxResult batchDocument(List<Long> ids) {
1268 1328
         // todo 多线程生成裁决书
@@ -1283,6 +1343,104 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
1283 1343
         return AjaxResult.success();
1284 1344
     }
1285 1345
 
1346
+    /**
1347
+     * 根据签署流程id查询批量签名链接
1348
+     *
1349
+     * @param idsReq
1350
+     * @return
1351
+     */
1352
+    @Override
1353
+    public SealSignRecord selectBatchSignUrl(StringIdsReq idsReq) {
1354
+        SealSignRecord signRecord = new SealSignRecord();
1355
+
1356
+        try {
1357
+            EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq);
1358
+
1359
+            Gson gson = new Gson();
1360
+            if (StrUtil.isNotEmpty(identityInfo.getBody())) {
1361
+                JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
1362
+                if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) {
1363
+                    JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
1364
+                    if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) {
1365
+                        idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
1366
+                    }
1367
+                }
1368
+            }
1369
+            if (StrUtil.isEmpty(idsReq.getPsnId())) {
1370
+                throw new ServiceException("该用户未认证");
1371
+            }
1372
+            EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq);
1373
+            if (StrUtil.isNotEmpty(batchSignUrl.getBody())) {
1374
+                JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
1375
+                if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
1376
+                    JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1377
+                    if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
1378
+                        // 免登录批量签链接(链接有效期2小时)
1379
+                        String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
1380
+                        // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
1381
+                        signRecord.setSignUrl(url);
1382
+                    }
1383
+                }
1384
+            }
1385
+        } catch (EsignDemoException e) {
1386
+            e.printStackTrace();
1387
+        }
1388
+
1389
+        return signRecord;
1390
+    }
1391
+
1392
+    @Override
1393
+    public SealSignRecord selectBatchSealUrl(StringIdsReq idsReq) {
1394
+        SealSignRecord signRecord = new SealSignRecord();
1395
+
1396
+        try {
1397
+            EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq);
1398
+
1399
+            Gson gson = new Gson();
1400
+            if (StrUtil.isNotEmpty(identityInfo.getBody())) {
1401
+                JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
1402
+                if(identityInfoJsonObject!=null&&!identityInfoJsonObject.get("data").isJsonNull()) {
1403
+                    JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
1404
+                    if (identityInfoData != null && !identityInfoData.get("psnId") .isJsonNull()) {
1405
+                        idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
1406
+                    }
1407
+                }
1408
+            }
1409
+            if (StrUtil.isEmpty(idsReq.getPsnId())) {
1410
+                throw new ServiceException("该用户未认证");
1411
+            }
1412
+            EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq);
1413
+            if (StrUtil.isNotEmpty(batchSignUrl.getBody())) {
1414
+                JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
1415
+                if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
1416
+                    JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1417
+                    if (signUrlData != null&& !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
1418
+                        // 免登录批量签链接(链接有效期2小时)
1419
+                        String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
1420
+                        // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
1421
+                        signRecord.setSignUrl(url);
1422
+                    }
1423
+                }
1424
+            }
1425
+        } catch (EsignDemoException e) {
1426
+            e.printStackTrace();
1427
+        }
1428
+
1429
+        return signRecord;
1430
+    }
1431
+
1432
+    /**
1433
+     * 根据仲裁员手机号分页查询等待签署,签署中的裁决书
1434
+     *
1435
+     * @param personAccount 仲裁员手机号
1436
+     * @return
1437
+     */
1438
+    @Override
1439
+    public List<CaseApplication> selectSealSigning(String personAccount, Integer caseStatus) {
1440
+        return sealSignRecordMapper.selectSealSigning(personAccount, caseStatus);
1441
+    }
1442
+
1443
+
1286 1444
     public String getNewEquipmentNo() {
1287 1445
         Object awardNum = redisCache.getCacheObject("awardNum");
1288 1446
         if (awardNum == null) {
@@ -1311,33 +1469,34 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
1311 1469
 
1312 1470
     /**
1313 1471
      * 根据裁决书模板获取所有的占位符,占位符必须是{{name}}格式
1472
+     *
1314 1473
      * @param path
1315 1474
      * @return
1316 1475
      */
1317
-    public List<String> getBookmarkByDocx(String path){
1476
+    public List<String> getBookmarkByDocx(String path) {
1318 1477
         XWPFDocument xwpfDocument = null;
1319 1478
         try {
1320
-            log.error("path===="+path);
1479
+            log.error("path====" + path);
1321 1480
             FileInputStream fileInputStream = new FileInputStream(path);
1322 1481
             log.error("fileInputStream====");
1323 1482
             xwpfDocument = new XWPFDocument(fileInputStream);
1324
-            log.error("xwpfDocument===="+xwpfDocument);
1483
+            log.error("xwpfDocument====" + xwpfDocument);
1325 1484
         } catch (IOException e) {
1326 1485
             e.printStackTrace();
1327 1486
         }
1328
-        if(xwpfDocument==null){
1487
+        if (xwpfDocument == null) {
1329 1488
             return new ArrayList<>();
1330 1489
         }
1331 1490
         List<XWPFParagraph> paragraphs = xwpfDocument.getParagraphs();
1332
-        if(CollectionUtil.isEmpty( xwpfDocument.getParagraphs())){
1491
+        if (CollectionUtil.isEmpty(xwpfDocument.getParagraphs())) {
1333 1492
             return new ArrayList<>();
1334 1493
         }
1335 1494
         String regex = "\\{\\{.*?\\}\\}"; // 定义占位符的正则表达式
1336 1495
         Pattern pattern = Pattern.compile(regex);
1337
-        List<String> bookmarkList=new ArrayList<>();
1496
+        List<String> bookmarkList = new ArrayList<>();
1338 1497
         for (XWPFParagraph paragraph : paragraphs) {
1339 1498
             String text = paragraph.getText();
1340
-            if(StrUtil.isNotEmpty(text)) {
1499
+            if (StrUtil.isNotEmpty(text)) {
1341 1500
                 Matcher matcher = pattern.matcher(text);
1342 1501
 
1343 1502
                 while (matcher.find()) {
@@ -1351,6 +1510,4 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
1351 1510
     }
1352 1511
 
1353 1512
 
1354
-
1355
-
1356 1513
 }

+ 10
- 12
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Wyświetl plik

@@ -160,11 +160,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
160 160
         // 查询登录人身份证号
161 161
         SysUser sysUser = sysUserMapper.selectUserById(userId);
162 162
         startPage();
163
-        // 已办案件
164
-        if (caseApplication.getSelectCaseStatus().equals("1")) {
165
-            caseApplication.setLoginUserName(sysUser.getUserName());
166
-            return caseApplicationMapper.selectHandledCase(caseApplication);
167
-        } else { // 待办案件
163
+        caseApplication.setLoginUserName(sysUser.getUserName());
168 164
             List<SysRole> roles = sysUser.getRoles();
169 165
             // 没有角色不能查看案件列表
170 166
             if (CollectionUtil.isEmpty(roles)) {
@@ -228,7 +224,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
228 224
             // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
229 225
 //            return caseApplicationMapper.selectCaseApplicationList(caseApplication);
230 226
             return caseApplicationMapper.selectCaseApplicationList1(caseApplication);
231
-        }
232 227
 
233 228
     }
234 229
 
@@ -1083,7 +1078,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1083 1078
         caseApplication.setFeePayable(feePayable);
1084 1079
         caseApplication.setUpdateBy(getUsername());
1085 1080
         Integer applicantIsWrittenHear = caseApplication.getApplicantIsWrittenHear();
1086
-        if(applicantIsWrittenHear.intValue()==1){
1081
+        if(applicantIsWrittenHear!=null&&applicantIsWrittenHear.intValue()==1){
1087 1082
             //书面审理
1088 1083
             caseApplication.setArbitratMethod(2);
1089 1084
         }else {
@@ -1396,9 +1391,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1396 1391
     @Override
1397 1392
     @Transactional
1398 1393
     public int deletecaseApplicationByIds(List<Long> ids) {
1394
+        // 查出所有的日志id
1395
+       List<Long> logIds= caseApplicationLogMapper.selectLogsByCaseIds(ids);
1399 1396
         int rows = caseApplicationMapper.batchDeletecaseApplication(ids);
1400
-        caseAffiliateMapper.batchDeletecaseAffiliate(ids);
1401
-      //  caseApplicationLogMapper.batchDeleteLog(ids);
1397
+        // 删除日志
1398
+        if(CollectionUtil.isNotEmpty(logIds)) {
1399
+            caseApplicationLogMapper.batchDeleteLog(logIds);
1400
+        }
1402 1401
         return rows;
1403 1402
     }
1404 1403
 
@@ -1674,7 +1673,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1674 1673
         ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
1675 1674
         arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
1676 1675
         Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck();
1677
-        if (agreeOrNotCheck.intValue() == 1) {//同意审核
1676
+        if (agreeOrNotCheck!=null&&agreeOrNotCheck.intValue() == 1) {//同意审核
1678 1677
             try {
1679 1678
                 //获取当前案件的裁决书
1680 1679
                 CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication);
@@ -2917,8 +2916,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2917 2916
     @Transactional
2918 2917
     @Override
2919 2918
     public AjaxResult uploadCaseZipFile(MultipartFile file, Long templateId) {
2920
-        AjaxResult ajaxResult = caseZipImportImpl.zipImport( file, templateId);
2921
-       return ajaxResult;
2919
+        return   caseZipImportImpl.zipImport( file, templateId);
2922 2920
     }
2923 2921
 
2924 2922
 

+ 34
- 14
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java Wyświetl plik

@@ -79,22 +79,42 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
79 79
                 //根据案件id查询案件证据材料
80 80
                 List<CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
81 81
                 if (evidenceMaterialList != null && evidenceMaterialList.size() > 0) {
82
-                    for (CaseAttach caseAttach : evidenceMaterialList) {
83
-                        //根据附件类型决定返回的路径
84
-                        Integer annexType = caseAttach.getAnnexType();
85
-                        if (annexType != 1){
86
-                            String path = caseAttach.getAnnexName();
82
+//                    for (CaseAttach caseAttach : evidenceMaterialList) {
83
+//                        //根据附件类型决定返回的路径
84
+//                        Integer annexType = caseAttach.getAnnexType();
85
+//                        if (annexType != 1){
86
+//                            String path = caseAttach.getAnnexName();
87
+//                            String prefix = "/profile";
88
+//                            int startIndex = path.indexOf(prefix);
89
+//                            startIndex += prefix.length();
90
+//                            String extractedPath = "/uploadPath" + path.substring(startIndex);
91
+//                            caseAttach.setAnnexPath(extractedPath);
92
+//                        }else {
93
+//                            String annexPath = caseAttach.getAnnexPath();
94
+//                            String result = annexPath.replace("/home/ruoyi", "");
95
+//                            caseAttach.setAnnexPath(result);
96
+//                        }
97
+//                    }
98
+
99
+                        for (CaseAttach caseAttach : evidenceMaterialList) {
100
+                            String annexName = caseAttach.getAnnexName();
87 101
                             String prefix = "/profile";
88
-                            int startIndex = path.indexOf(prefix);
89
-                            startIndex += prefix.length();
90
-                            String extractedPath = "/uploadPath" + path.substring(startIndex);
91
-                            caseAttach.setAnnexPath(extractedPath);
92
-                        }else {
93
-                            String annexPath = caseAttach.getAnnexPath();
94
-                            String result = annexPath.replace("/home/ruoyi", "");
95
-                            caseAttach.setAnnexPath(result);
102
+                            int startIndex = annexName.indexOf(prefix);
103
+                            if(startIndex!=-1) {
104
+                                startIndex += prefix.length();
105
+
106
+                                String annexPath = "/uploadPath" + annexName.substring(startIndex);
107
+                                caseAttach.setAnnexPath(annexPath);
108
+                            }
109
+                            int startIndexnew = annexName.lastIndexOf("/");
110
+                            if (startIndexnew != -1) {
111
+                                String annexNamenew = annexName.substring(startIndexnew + 1);
112
+                                caseAttach.setAnnexName(annexNamenew);
113
+                            }
114
+
115
+
96 116
                         }
97
-                    }
117
+
98 118
                 }
99 119
                 caseDetailVO.setEvidenceMaterialList(evidenceMaterialList);
100 120
             }

+ 8
- 6
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java Wyświetl plik

@@ -106,10 +106,12 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
106 106
 
107 107
     @Override
108 108
     @Transactional
109
-    public AjaxResult confirmPayment(CaseApplication caseApplication) {
110
-        caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI);
111
-        int i = caseApplicationMapper.submitCaseApplication(caseApplication);
112
-        if (i > 0) {
109
+    public AjaxResult confirmPayment( List<Long> ids) {
110
+        for (Long id : ids) {
111
+            CaseApplication caseApplication = new CaseApplication();
112
+            caseApplication.setId(id);
113
+            caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI);
114
+            caseApplicationMapper.submitCaseApplication(caseApplication);
113 115
             //发送短信通知
114 116
             SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
115 117
             CaseAffiliate caseAffiliate = new CaseAffiliate();
@@ -185,7 +187,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
185 187
                 return AjaxResult.success();
186 188
             }
187 189
         }
188
-        return AjaxResult.error("暂无需要确认的缴费清单");
190
+
191
+        return AjaxResult.success();
189 192
     }
190 193
 
191 194
     @Transactional
@@ -248,7 +251,6 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
248 251
             caseApplication.setId(caseId);
249 252
             CaseApplication caseApplication1 = caseApplicationService.selectCaseApplication(caseApplication);
250 253
             BigDecimal feePayable = caseApplication1.getFeePayable();
251
-            feePayable = feePayable.multiply(new BigDecimal(100));
252 254
             sum = sum.add(feePayable);
253 255
             listVO.setTotalFee(sum.intValue());
254 256
             caseApplicationPay.setCaseAppName(caseApplication1.getApplicantName());

+ 324
- 252
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java Wyświetl plik

@@ -25,6 +25,7 @@ import com.ruoyi.system.mapper.*;
25 25
 import com.ruoyi.wisdomarbitrate.domain.*;
26 26
 import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
27 27
 import com.ruoyi.wisdomarbitrate.mapper.*;
28
+import com.ruoyi.wisdomarbitrate.task.CaseZipImportTask;
28 29
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
29 30
 import com.ruoyi.wisdomarbitrate.utils.OCRUtils;
30 31
 import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
@@ -37,6 +38,8 @@ import java.io.*;
37 38
 import java.math.BigDecimal;
38 39
 import java.text.SimpleDateFormat;
39 40
 import java.util.*;
41
+import java.util.concurrent.ExecutionException;
42
+import java.util.concurrent.Future;
40 43
 import java.util.function.Function;
41 44
 import java.util.regex.Matcher;
42 45
 import java.util.regex.Pattern;
@@ -70,8 +73,6 @@ public class CaseZipImportImpl {
70 73
     @Autowired
71 74
     private SysUserRoleMapper userRoleMapper;
72 75
     @Autowired
73
-    private CaseApplicationLogMapper caseApplicationLogMapper;
74
-    @Autowired
75 76
     private CaseAffiliateLogMapper caseAffiliateLogMapper;
76 77
     @Autowired
77 78
     private CaseAttachLogMapper caseAttachLogMapper;
@@ -85,11 +86,14 @@ public class CaseZipImportImpl {
85 86
     private ColumnValueLogMapper columnValueLogMapper;
86 87
     @Autowired
87 88
     private CaseAffiliateMapper caseAffiliateMapper;
89
+    @Autowired
90
+    private CaseApplicationLogMapper caseApplicationLogMapper;
88 91
     // 申请人角色id
89 92
     private long roleId;
90 93
     private Integer maxCaseNum;
91 94
     private Integer maxBatchNumber;
92 95
 
96
+
93 97
     public AjaxResult zipImport(MultipartFile file, Long templateId) {
94 98
         UUID uuid = UUID.randomUUID();
95 99
         // todo
@@ -113,51 +117,14 @@ public class CaseZipImportImpl {
113 117
         boolean unzipSuccess = UnZipFileUtils.unZipFile(zipFile, targetPath);
114 118
         if (!unzipSuccess) {
115 119
             // 解压失败
116
-            return AjaxResult.error("解压失败");
120
+            throw new ServiceException("解压失败");
117 121
         }
118 122
         // 查询抓取规则
119 123
         // todo 批次需要再上传压缩包时用户填写
120 124
         List<FatchRule> fatchRuleList = fatchRuleMapper.listByTemplateId(templateId);
121 125
         if (CollectionUtil.isEmpty(fatchRuleList)) {
122
-            return error("未设置抓取规则");
123
-        }
124
-        File directory = new File(targetPath);
125
-        // fileMap<caseId, List<File>>
126
-        Map<Long, List<File>> fileMap = findAndConvertPDF(directory);
127
-        if (fileMap == null || fileMap.size() <= 0) {
128
-            // 解压失败
129
-            return AjaxResult.error("未获取到文件");
130
-        }
131
-        Map<String, String> fatchMap = new HashMap<>();
132
-        if (CollectionUtil.isNotEmpty(fatchRuleList)) {
133
-
134
-            Map<String, List<FatchRule>> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getFileName));
135
-            // 根据抓取规则循环抓取
136
-            fileMap.forEach((key, fileList) -> {
137
-                if (CollectionUtil.isNotEmpty(fileList)) {
138
-                    for (File caseFile : fileList) {
139
-                        if (fatchRuleMap.containsKey(caseFile.getName())) {
140
-                            // 抓取内容
141
-                            List<FatchRule> fatchRules = fatchRuleMap.get(caseFile.getName());
142
-                            getFatchContentList(caseFile, fatchMap, fatchRules, key);
143
-                        }
144
-                    }
145
-                }
146
-            });
147
-
148
-        }
149
-        if (fatchMap.size() <= 0) {
150
-            return error("从压缩包中未抓取到内容,请检查抓取字段配置");
126
+            throw new ServiceException("未设置抓取规则");
151 127
         }
152
-        // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
153
-        SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
154
-        request.setTemplateId("1956159");
155
-
156
-        // 新增的案件
157
-        List<CaseApplication> caseApplications = new ArrayList<>();
158
-        //  从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue
159
-        // 抓取规则,0-内置字段,1-自定义字段
160
-        Map<Integer, List<FatchRule>> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
161 128
         // 在系统表中查询案件内置字段
162 129
         SysDictData sysDictData = new SysDictData();
163 130
         sysDictData.setDictType("case_built_type");
@@ -170,25 +137,8 @@ public class CaseZipImportImpl {
170 137
             deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV));
171 138
 
172 139
         }
173
-        // 角色用户
174
-        List<SysUserRole> userRoleList = new ArrayList<>();
175 140
         // 查询申请人角色id
176 141
         roleId = roleMapper.selectRoleIdByName("申请人");
177
-
178
-        // 案件基本信息
179
-        caseApplications = new ArrayList<>();
180
-        // 自定义字段,组装columnValue表
181
-        List<ColumnValue> columnValueList = new ArrayList<>();
182
-        // 案件人员
183
-        List<CaseAffiliate> caseAffiliates = new ArrayList<>();
184
-        // 组装机构
185
-        List<SysDept> sysDepts = new ArrayList<>();
186
-        // 案件附件
187
-        List<CaseAttach> caseAttachs = new ArrayList<>();
188
-        //发送短信列表
189
-        List<SmsSendRecord> smsSendRecordList = new ArrayList<>();
190
-        // 短信记录
191
-        List<SmsUtils.SendSmsRequest> smsRequestList = new ArrayList<>();
192 142
         /**
193 143
          * 用户表已存在的用户
194 144
          */
@@ -201,186 +151,299 @@ public class CaseZipImportImpl {
201 151
         String currentDay = DateUtils.dateTime();
202 152
         String caseNum = "zc" + currentDay;
203 153
         maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length());
204
-        // 需要新增的用户
205
-        List<SysUser> addUsers = new ArrayList<>();
206
-        for (Long caseId : fileMap.keySet()) {
207
-            if (CollectionUtil.isEmpty(fileMap.get(caseId))) {
208
-                continue;
209
-            }
210
-            CaseApplication caseApplication = new CaseApplication();
211
-            caseApplications.add(caseApplication);
212
-            caseApplication.setId(caseId);
213
-            caseApplication.setTemplateId(templateId);
214
-
215
-            caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
216
-            caseApplication.setCaseLogId(IdWorkerUtil.getId());
217
-            caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
218
-            caseApplication.setCaseAppliId(caseApplication.getId());
219
-
220
-            // 设置批号
221
-            if (StrUtil.isEmpty(caseApplication.getBatchNumber())) {
222
-                maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
223
-                if (maxBatchNumber == null) {
224
-                    maxBatchNumber = 1;
225
-                    caseApplication.setBatchNumber(maxBatchNumber.toString());
226
-                } else {
227
-                    maxBatchNumber = maxBatchNumber + 1;
228
-                    caseApplication.setBatchNumber(maxBatchNumber.toString());
229
-                }
154
+        // 抓取内容
155
+        Map<String, String> fatchMap = new HashMap<>();
156
+        //  从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue
157
+        // 抓取规则,0-内置字段,1-自定义字段
158
+        Map<String, List<FatchRule>> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getFileName));
159
+
160
+        File directory = new File(targetPath);
161
+        if (!directory.exists()) {
162
+            throw new ServiceException("文件不存在");
163
+        }
164
+        // 找出案件文件夹
165
+        if (!directory.isDirectory() || directory.listFiles() == null) {
166
+            throw new ServiceException("未找到文件夹");
167
+        }
168
+        File[] files = directory.listFiles();
169
+            CaseZipImportTask caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap,SecurityUtils.getLoginUser());
170
+        Future<List<CaseApplication>> future = ThreadPoolUtil.submit(caseZipImportTask);
171
+        try {
172
+            if(future.get()!=null){
173
+                return success("导入成功");
230 174
             }
231
-            // 设置编号
232
-            String maxCaseNumStr = generateCaseNum();
233
-            caseApplication.setCaseNum(maxCaseNumStr);
234
-            caseApplication.setCreateBy(getUsername());
235
-            caseApplication.setVersion(1);
236
-            // 组装案件内置字段主表内容
237
-
238
-            if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) {
239
-                List<FatchRule> columnRules = fatchRuleMap.get(1);
240
-                columnRules.forEach(columnRule -> {
241
-                    ColumnValue columnValue = new ColumnValue();
242
-                    columnValue.setColumn(columnRule.getColumn());
243
-                    columnValue.setName(columnRule.getColumnName());
244
-                    columnValue.setName(columnRule.getColumnName());
245
-                    columnValue.setValue(fatchMap.get(columnRule.getColumnName() + Constants.PDFSTR + caseId));
246
-                    columnValue.setIsDefault(1);
247
-                    columnValue.setCaseId(caseId);
248
-                    columnValue.setCaseAppliLogId(caseApplication.getCaseLogId());
249
-                    columnValueList.add(columnValue);
250
-                });
175
+        } catch (InterruptedException e) {
176
+            e.printStackTrace();
177
+        } catch (ExecutionException e) {
178
+            e.printStackTrace();
179
+        }
180
+        return error("无可导入的案件");
181
+
182
+
183
+    }
184
+
185
+    public CaseApplication buildCaseInfo(File file, Long templateId, List<FatchRule> fatchRuleList, Map<String, List<FatchRule>> fatchRuleMap, Map<String, String> fatchMap, Map<String, SysUser> userMap, List<SysDictData> dictDataList, Map<String, Long> deptMap,LoginUser loginUser) {
186
+        // fileMap<caseId, List<File>>
187
+        Map<String, String> fileMap = findFile(file, fatchRuleList);
188
+        if (fileMap != null && fileMap.size()> 0) {
189
+            // 根据抓取规则循环抓取
190
+            for (Map.Entry<String, List<FatchRule>> entry : fatchRuleMap.entrySet()) {
191
+                getFatchContent(fileMap, entry.getKey(), fatchMap, entry.getValue());
251 192
             }
252
-            caseApplication.setColumnValues(columnValueList);
253
-            // 组装内置字段
254
-            buildDefaultColumn(caseApplication, dictDataList, fatchMap, caseAffiliates, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList);
255
-            for (File caseFile : fileMap.get(caseId)) {
256
-                String fileUrl = caseFile.getAbsolutePath();
257
-                if (StrUtil.isEmpty(fileUrl)) {
258
-                    continue;
193
+
194
+            if (fatchMap.size() > 0) {
195
+
196
+                // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
197
+                SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
198
+                request.setTemplateId("1956159");
199
+
200
+                // 新增的案件
201
+                // 组装案件内置字段主表内容
202
+                CaseApplication caseApplication = new CaseApplication();
203
+                caseApplication.setId(IdWorkerUtil.getId());
204
+                caseApplication.setTemplateId(templateId);
205
+                Map<Integer, List<FatchRule>> defaultRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
206
+                // 自定义字段,组装columnValue表
207
+                List<ColumnValue> columnValueList = new ArrayList<>();
208
+                if (defaultRuleMap.size() > 0 && defaultRuleMap.containsKey(1)) {
209
+                    List<FatchRule> columnRules = defaultRuleMap.get(1);
210
+                    columnRules.forEach(columnRule -> {
211
+                        ColumnValue columnValue = new ColumnValue();
212
+                        columnValue.setColumn(columnRule.getColumn());
213
+                        columnValue.setName(columnRule.getColumnName());
214
+                        columnValue.setValue(fatchMap.get(columnRule.getColumnName()));
215
+                        columnValue.setIsDefault(1);
216
+                        columnValue.setCaseId(caseApplication.getId());
217
+                        columnValueList.add(columnValue);
218
+                    });
219
+                    caseApplication.setColumnValues(columnValueList);
259 220
                 }
260
-                // 上传
261
-                String filePath = RuoYiConfig.getUploadPath();
262
-
263
-                CaseAttach caseAttach = new CaseAttach();
264
-                caseAttach.setCaseAppliId(caseApplication.getId());
265
-                caseAttach.setCaseAppliLogId(caseApplication.getCaseLogId());
266
-                caseAttach.setAnnexPath(filePath);
267
-                if (StrUtil.isNotEmpty(fileUrl)) {
268
-                    String fileName = fileUrl.replace(filePath, "/profile/upload");
269
-                    caseAttach.setAnnexName(fileName);
221
+
222
+                // 角色用户
223
+                List<SysUserRole> userRoleList = new ArrayList<>();
224
+
225
+                // 组装机构
226
+                List<SysDept> sysDepts = new ArrayList<>();
227
+                // 案件附件
228
+                List<CaseAttach> caseAttachs = new ArrayList<>();
229
+                //发送短信列表
230
+                List<SmsSendRecord> smsSendRecordList = new ArrayList<>();
231
+                // 短信记录
232
+                List<SmsUtils.SendSmsRequest> smsRequestList = new ArrayList<>();
233
+
234
+                // 需要新增的用户
235
+                List<SysUser> addUsers = new ArrayList<>();
236
+                caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
237
+                caseApplication.setCaseLogId(IdWorkerUtil.getId());
238
+                caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
239
+                caseApplication.setCaseAppliId(caseApplication.getId());
240
+
241
+                // 设置批号
242
+                if (StrUtil.isEmpty(caseApplication.getBatchNumber())) {
243
+                    maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
244
+                    if (maxBatchNumber == null) {
245
+                        maxBatchNumber = 1;
246
+                        caseApplication.setBatchNumber(maxBatchNumber.toString());
247
+                    } else {
248
+                        maxBatchNumber = maxBatchNumber + 1;
249
+                        caseApplication.setBatchNumber(maxBatchNumber.toString());
250
+                    }
270 251
                 }
271
-                // 申请人提供的证据材料
272
-                caseAttach.setAnnexType(2);
273
-                caseAttachs.add(caseAttach);
274
-                if (fileUrl.contains("仲裁申请书")) {
275
-                    CaseAttach applyFile = new CaseAttach();
276
-                    BeanUtil.copyProperties(caseAttach, applyFile);
277
-                    applyFile.setAnnexType(1);
278
-                    caseAttachs.add(applyFile);
252
+                // 设置编号
253
+                String maxCaseNumStr = generateCaseNum();
254
+                caseApplication.setCaseNum(maxCaseNumStr);
255
+                caseApplication.setCreateBy(loginUser!=null?loginUser.getUsername():"admin");
256
+                caseApplication.setVersion(1);
257
+                // 组装案件内置字段主表内容
258
+
259
+                // 组装内置字段
260
+                buildDefaultColumn(caseApplication, dictDataList, fatchMap, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList);
261
+                // 组装附件
262
+                for (Map.Entry<String, String> entry : fileMap.entrySet()) {
263
+                    String fileUrl = entry.getValue();
264
+                    if (StrUtil.isEmpty(fileUrl)) {
265
+                        continue;
266
+                    }
267
+                    // 上传
268
+                    String filePath = RuoYiConfig.getUploadPath();
269
+
270
+                    CaseAttach caseAttach = new CaseAttach();
271
+                    caseAttach.setCaseAppliId(caseApplication.getId());
272
+                    caseAttach.setAnnexPath(filePath);
273
+                    if (StrUtil.isNotEmpty(fileUrl)) {
274
+                        String fileName = fileUrl.replace(filePath, "/profile/upload");
275
+                        caseAttach.setAnnexName(fileName);
276
+                    }
277
+                    // 申请人提供的证据材料
278
+                    caseAttach.setAnnexType(2);
279
+                    caseAttachs.add(caseAttach);
280
+                    if (fileUrl.contains("仲裁申请书")) {
281
+                        CaseAttach applyFile = new CaseAttach();
282
+                        BeanUtil.copyProperties(caseAttach, applyFile);
283
+                        applyFile.setAnnexType(1);
284
+                        caseAttachs.add(applyFile);
285
+                    }
286
+
279 287
                 }
280
-            }
281
-            // 案件压缩包导入
282
-            caseApplication.setImportFlag(2);
283
-            // 组装短信
288
+                caseApplication.setCaseAttachList(caseAttachs);
289
+                // 案件压缩包导入
290
+                caseApplication.setImportFlag(2);
291
+                caseApplicationMapper.insertCaseApplication(caseApplication);
292
+                // 多线程执行
293
+                ThreadPoolUtil.execute(() -> {
294
+                    caseApplicationLogMapper.insert(caseApplication);
295
+                    // 多线程执行
296
+                    if (CollectionUtil.isNotEmpty(addUsers)) {
297
+                        userMapper.batchSave(addUsers);
284 298
 
285
-        }
286
-        // 多线程执行
287
-        List<MultipleThreadListParam> execList = new ArrayList<>();
288
-        if (CollectionUtil.isNotEmpty(addUsers)) {
289
-            Function<List<SysUser>, Integer> function = userMapper::batchSave;
290
-            execList.add(new MultipleThreadListParam(function, addUsers));
291
-        }
292
-        if (CollectionUtil.isNotEmpty(userRoleList)) {
293
-            Function<List<SysUserRole>, Integer> function = userRoleMapper::batchUserRole;
294
-            execList.add(new MultipleThreadListParam(function, userRoleList));
299
+                    }
300
+                    if (CollectionUtil.isNotEmpty(userRoleList)) {
301
+                        userRoleMapper.batchUserRole(userRoleList);
295 302
 
296
-        }
297
-        if (CollectionUtil.isNotEmpty(sysDepts)) {
298
-            Function<List<SysDept>, Integer> function = sysDeptMapper::batchSave;
299
-            execList.add(new MultipleThreadListParam(function, sysDepts));
303
+                    }
304
+                    if (CollectionUtil.isNotEmpty(sysDepts)) {
305
+                        sysDeptMapper.batchSave(sysDepts);
300 306
 
301
-        }
302
-        if (CollectionUtil.isNotEmpty(caseApplications)) {
303
-            Function<List<CaseApplication>, Integer> function = caseApplicationMapper::batchSave;
304
-            execList.add(new MultipleThreadListParam(function, caseApplications));
305
-            Function<List<CaseApplication>, Integer> functionLog = caseApplicationLogMapper::batchSave;
306
-            execList.add(new MultipleThreadListParam(functionLog, caseApplications));
307
+                    }
308
+                    if (CollectionUtil.isNotEmpty(caseApplication.getCaseAffiliates())) {
309
+                        caseAffiliateMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates());
310
+                        caseAffiliateLogMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates());
311
+                    }
312
+                    if (CollectionUtil.isNotEmpty(caseAttachs)) {
313
+                        caseAttachMapper.batchSave(caseAttachs);
314
+                        caseAttachLogMapper.batchSave(caseAttachs);
307 315
 
308
-        }
309
-        if (CollectionUtil.isNotEmpty(caseAffiliates)) {
310
-            Function<List<CaseAffiliate>, Integer> function = caseAffiliateMapper::batchCaseAffiliate;
311
-            execList.add(new MultipleThreadListParam(function, caseAffiliates));
312
-            Function<List<CaseAffiliate>, Integer> functionLog = caseAffiliateLogMapper::batchCaseAffiliate;
313
-            execList.add(new MultipleThreadListParam(functionLog, caseAffiliates));
314
-        }
315
-        if (CollectionUtil.isNotEmpty(caseAttachs)) {
316
-            Function<List<CaseAttach>, Integer> function = caseAttachMapper::batchSave;
317
-            execList.add(new MultipleThreadListParam(function, caseAttachs));
318
-            Function<List<CaseAttach>, Integer> functionLog = caseAttachLogMapper::batchSave;
319
-            execList.add(new MultipleThreadListParam(functionLog, caseAttachs));
320
-        }
321
-        if (CollectionUtil.isNotEmpty(columnValueList)) {
322
-            Function<List<ColumnValue>, Integer> function = columnValueMapper::batchSave;
323
-            execList.add(new MultipleThreadListParam(function, columnValueList));
324
-            Function<List<ColumnValue>, Integer> functionLog = columnValueLogMapper::batchSave;
325
-            execList.add(new MultipleThreadListParam(functionLog, columnValueList));
326
-        }
327
-        if (CollectionUtil.isNotEmpty(execList)) {
328
-            MultipleThreadWorkUtil.execListFun(execList.toArray(new MultipleThreadListParam[execList.size()]));
329
-        }
330
-        if (CollectionUtil.isNotEmpty(caseApplications)) {
331
-            LoginUser loginUser = SecurityUtils.getLoginUser();
332
-            List<CaseLogRecord> logRecords = new ArrayList<>();
333
-
334
-            caseApplications.forEach(caseApplication -> {
335
-                        CaseLogRecord operLog = new CaseLogRecord();
336
-                        // 获取当前的用户
337
-
338
-                        if (loginUser != null) {
339
-                            SysUser user = loginUser.getUser();
340
-                            operLog.setCreateBy(user.getUserName());
341
-                            operLog.setCreateNickName(user.getNickName());
342
-                            operLog.setUpdateBy(user.getUserName());
343
-                        } else {
344
-                            operLog.setCreateBy("admin");
345
-                            operLog.setCreateNickName("管理员");
346
-                            operLog.setUpdateBy("admin");
347
-                        }
348
-                        operLog.setCaseAppliId(caseApplication.getId());
349
-                        operLog.setCaseNode(CaseApplicationConstants.CASE_APPLICATION);
350
-                        logRecords.add(operLog);
351 316
                     }
352
-            );
353
-            // todo 发送短信
354
-            ThreadPoolUtil.execute(() -> {
355
-                        CaseLogUtils.batchInsertCaseLog(logRecords);
356
-                        // 发送短信
357
-                        if (CollectionUtil.isNotEmpty(smsRequestList)) {
358
-                            Map<Long, SmsSendRecord> sendRecordMap = null;
359
-                            if (CollectionUtil.isNotEmpty(smsSendRecordList)) {
360
-                                sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity()));
361
-                                for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) {
362
-                                    Boolean aBoolean = SmsUtils.sendSms(request);
363
-                                    if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) {
364
-                                        if (aBoolean) {
365
-                                            sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1);
366
-                                        } else {
367
-                                            sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0);
368
-                                        }
317
+                    if (CollectionUtil.isNotEmpty(columnValueList)) {
318
+                        columnValueMapper.batchSave(columnValueList);
319
+                        columnValueLogMapper.batchSave(columnValueList);
320
+                    }
321
+                    // 新增日志
322
+                    CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser);
323
+                    // 发送短信
324
+                    if (CollectionUtil.isNotEmpty(smsRequestList)) {
325
+                        Map<Long, SmsSendRecord> sendRecordMap = null;
326
+                        if (CollectionUtil.isNotEmpty(smsSendRecordList)) {
327
+                            sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity()));
328
+                            for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) {
329
+                                Boolean aBoolean = SmsUtils.sendSms(request);
330
+                                if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) {
331
+                                    if (aBoolean) {
332
+                                        sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1);
333
+                                    } else {
334
+                                        sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0);
369 335
                                     }
370 336
                                 }
371
-                                smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList);
372 337
                             }
373
-
374
-
338
+                            smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList);
375 339
                         }
376 340
 
341
+
377 342
                     }
378 343
 
379
-            );
344
+                });
345
+                return caseApplication;
346
+            }
347
+        }
348
+        return null;
349
+    }
350
+
351
+    /**
352
+     * 获取抓取内容
353
+     *
354
+     * @param andConvertPDF 文件路径map
355
+     * @param mapKey        文件名
356
+     * @param map           抓取内容map
357
+     * @param fatchRules    抓取规则
358
+     */
359
+    private void getFatchContent(Map<String, String> andConvertPDF, String mapKey, Map<String, String> map, List<FatchRule> fatchRules) {
360
+        String fileURL = andConvertPDF.get(mapKey);
361
+        if (StrUtil.isEmpty(fileURL)) {
362
+            return;
363
+        }
364
+        if (fileURL.endsWith("txt")) {
365
+            String readerFile = ReadFileUtils.readerTxtFile(fileURL);
366
+            OCRUtils.fatchRuleGetContent(readerFile, fatchRules, map);
367
+        } else if (fileURL.endsWith("doc") || fileURL.endsWith("docx")) {
368
+            // doc,docx,text识别内容
369
+            String readerFile = null;
370
+            try {
371
+                readerFile = ReadFileUtils.readWord(fileURL);
372
+            } catch (Exception e) {
373
+                e.printStackTrace();
374
+            }
375
+            OCRUtils.fatchRuleGetContent(readerFile, fatchRules, map);
376
+
377
+        } else if (fileURL.endsWith("pdf")) {
378
+            //获取文件的页数
379
+            int fileNumPage = getFileNumPage(fileURL);
380
+            //文件转成base64
381
+            String base64 = OCRUtils.pdfConvertBase64(fileURL);
382
+            if (base64 == null) {
383
+                throw new ServiceException("pdf转base64失败");
384
+                //  return false;
385
+            }
386
+            StringBuilder ocrText = new StringBuilder(); // 创建一个StringBuilder对象
387
+            for (int i = 1; i <= fileNumPage; i++) {
388
+                //对接腾讯云接口.识别里面的数据
389
+                String text = OCRUtils.pdfIdentifyText(base64, i, fatchRules);
390
+                ocrText.append(text); // 拼接当前的字符串
391
+
392
+
393
+            }
394
+            // 根据抓取规则截取内容
395
+            OCRUtils.fatchRuleGetContent(ocrText.toString(), fatchRules, map);
396
+        }
397
+
398
+
399
+    }
400
+
401
+    /**
402
+     * 查找文件
403
+     *
404
+     * @param directory
405
+     * @param fatchRuleList
406
+     * @return
407
+     */
408
+    private Map<String, String> findFile(File directory, List<FatchRule> fatchRuleList) {
409
+        Map<String, String> filePathMap = new HashMap<>();
410
+        if (directory.isFile()) {
411
+            String path = "";
412
+            // 如果传入的参数是一个文件
413
+            path = directory.getAbsolutePath();
414
+            filePathMap.put(directory.getName(), path);
415
+
416
+        } else if (directory.isDirectory()) {
417
+            searchAndConvertPDF(directory, filePathMap);
418
+        } else {
419
+            return null;
380 420
         }
381
-        // 案件日志
382
-        return success("导入成功");
421
+        return filePathMap;
422
+    }
423
+
424
+    /**
425
+     * 递归查找文件夹
426
+     *
427
+     * @param directory
428
+     * @param filePathMap
429
+     */
430
+    public static void searchAndConvertPDF(File directory, Map<String, String> filePathMap) {
431
+        File[] files = directory.listFiles();
383 432
 
433
+        if (files != null) {
434
+            for (File file : files) {
435
+                if (file.getName().contains("zip") || file.getName().contains("rar")) {
436
+                    continue;
437
+                }
438
+                if (file.isFile()) {
439
+
440
+                    filePathMap.put(file.getName(), file.getAbsolutePath());
441
+                } else if (file.isDirectory()) {
442
+                    // 如果是目录,递归查找
443
+                    searchAndConvertPDF(file, filePathMap);
444
+                }
445
+            }
446
+        }
384 447
     }
385 448
 
386 449
     /**
@@ -584,13 +647,14 @@ public class CaseZipImportImpl {
584 647
      * @param fatchMap        抓取字段内容
585 648
      */
586 649
     private void buildDefaultColumn(CaseApplication caseApplication, List<SysDictData> dictDataList, Map<String, String> fatchMap,
587
-                                    List<CaseAffiliate> caseAffiliates, Map<String, Long> deptMap, List<SysDept> sysDepts,
650
+                                    Map<String, Long> deptMap, List<SysDept> sysDepts,
588 651
                                     Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList,
589 652
                                     List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
590 653
         // 组装内置字段
591 654
         if (CollectionUtil.isEmpty(dictDataList)) {
592 655
             return;
593 656
         }
657
+        List<CaseAffiliate> caseAffiliates = new ArrayList<>();
594 658
         // 被申请人
595 659
         CaseAffiliate debtorAffiliate = new CaseAffiliate();
596 660
         debtorAffiliate.setCaseAppliId(caseApplication.getId());
@@ -610,27 +674,35 @@ public class CaseZipImportImpl {
610 674
                     buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList, caseApplication, smsSendRecords, smsRequestList);
611 675
                 } else if (dictData.getDictLabel().contains("合同编号")) {
612 676
                     // 合同编号
613
-                    String contractNumber = fatchMap.get("合同编号" + Constants.PDFSTR + caseApplication.getId());
677
+                    String contractNumber = fatchMap.get("合同编号" );
614 678
                     if (StrUtil.isNotEmpty(contractNumber)) {
615 679
                         // 提取字母和数字
616 680
                         String regx = "[^a-zA-Z0-9]";
617 681
                         String replaceAll = contractNumber.replaceAll(regx, "");
618 682
                         caseApplication.setContractNumber(replaceAll.toUpperCase());
619 683
                     }
620
-                }else if(dictData.getDictLabel().contains("案件标的")){
621
-                    // todo 案件标的名字要改,字典配置中也要改
622
-                    if(null!=caseApplication.getCaseSubjectAmount()) {
623
-                        //todo 暂时设置计费比率为0.01
624
-                        BigDecimal feeRate = new BigDecimal(0.01);
625
-                        BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP);
626
-                        caseApplication.setFeePayable(feePayable);
684
+                } else if (dictData.getDictLabel().contains("案件标的")) {
685
+                    String caseSubjectAmount = fatchMap.get(dictData.getDictLabel());
686
+                    if(StrUtil.isNotEmpty(caseSubjectAmount)) {
687
+                        try {
688
+                            BigDecimal bigDecimal = new BigDecimal(caseSubjectAmount);
689
+                            caseApplication.setCaseSubjectAmount(bigDecimal);
690
+                            // todo 案件标的名字要改,字典配置中也要改
691
+                                //todo 暂时设置计费比率为0.01
692
+                                BigDecimal feeRate = new BigDecimal(0.01);
693
+                                BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP);
694
+                                caseApplication.setFeePayable(feePayable);
695
+
696
+                        } catch (Exception e) {
697
+                        }
627 698
                     }
699
+
628 700
                 } else {
629
-                    ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
701
+                    ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() ));
630 702
                 }
631 703
 
632 704
             } else {
633
-                ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
705
+                ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() ));
634 706
 
635 707
             }
636 708
 
@@ -641,7 +713,7 @@ public class CaseZipImportImpl {
641 713
         if (ObjectUtil.isNotEmpty(debtorAffiliate)) {
642 714
             caseAffiliates.add(debtorAffiliate);
643 715
         }
644
-
716
+        caseApplication.setCaseAffiliates(caseAffiliates);
645 717
 
646 718
     }
647 719
 
@@ -662,7 +734,7 @@ public class CaseZipImportImpl {
662 734
         // 申请人
663 735
         switch (dictData.getDictLabel()) {
664 736
             case "申请人姓名":
665
-                affiliate.setName((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())));
737
+                affiliate.setName((fatchMap.get(dictData.getDictLabel())));
666 738
                 if (StrUtil.isNotEmpty(affiliate.getName())) {
667 739
                     // 组装申请机构
668 740
                     // 将组织机构id设为申请人名称
@@ -690,25 +762,25 @@ public class CaseZipImportImpl {
690 762
                 }
691 763
                 break;
692 764
             case "统一社会信用代码":
693
-                affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())));
765
+                affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel())));
694 766
                 break;
695 767
             case "法定代表人":
696
-                affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
768
+                affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel()));
697 769
                 break;
698 770
             case "法定代表人职位":
699
-                affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())));
771
+                affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel())));
700 772
                 break;
701 773
             case "申请人住所":
702
-                affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())));
774
+                affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel())));
703 775
                 break;
704 776
             case "申请人联系地址":
705
-                affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
777
+                affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel()));
706 778
                 break;
707 779
             case "委托代理人姓名":
708
-                affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
780
+                affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel()));
709 781
                 break;
710 782
             case "委托代理人联系电话":
711
-                affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
783
+                affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel()));
712 784
                 if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
713 785
                     SysUser agentUser = null;
714 786
                     // 用户已存在
@@ -754,11 +826,11 @@ public class CaseZipImportImpl {
754 826
                     }
755 827
                     if (addUsers != null) {
756 828
                         SysUser finalAgentUser = agentUser;
757
-                        if(CollectionUtil.isNotEmpty(smsRequestList)&& smsRequestList.stream().noneMatch(smsSendRecord -> smsSendRecord.getPhone().equals(finalAgentUser.getPhonenumber()))){
758
-                        SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
759
-                        request.setTemplateId("1956159");
760
-                        request.setPhone(agentUser.getPhonenumber());
761
-                        request.setTemplateParamSet(new String[]{agentUser.getNickName()});
829
+                        if (CollectionUtil.isNotEmpty(smsRequestList) && smsRequestList.stream().noneMatch(smsSendRecord -> smsSendRecord.getPhone().equals(finalAgentUser.getPhonenumber()))) {
830
+                            SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
831
+                            request.setTemplateId("1956159");
832
+                            request.setPhone(agentUser.getPhonenumber());
833
+                            request.setTemplateParamSet(new String[]{agentUser.getNickName()});
762 834
                             smsRequestList.add(request);
763 835
                             SmsSendRecord smsSendRecord = new SmsSendRecord();
764 836
                             smsSendRecord.setCaseId(caseApplication.getId());
@@ -777,10 +849,10 @@ public class CaseZipImportImpl {
777 849
                 }
778 850
                 break;
779 851
             case "委托代理人电子邮件":
780
-                affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()).replace("\n", "").replaceAll("\\s", "") : null);
781
-
852
+                affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel())) ? fatchMap.get(dictData.getDictLabel()).replace("\n", "").replaceAll("\\s", "") : null);
782 853
                 break;
783 854
             default:
855
+                ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() ));
784 856
                 break;
785 857
         }
786 858
     }
@@ -813,11 +885,11 @@ public class CaseZipImportImpl {
813 885
         // 被申请人
814 886
         switch (dictData.getDictLabel()) {
815 887
             case "被申请人姓名":
816
-                debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
888
+                debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() ));
817 889
                 break;
818 890
             case "被申请人身份证号":
819
-                String identityNum = fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId);
820
-                debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
891
+                String identityNum = fatchMap.get(dictData.getDictLabel() );
892
+                debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() ));
821 893
                 // 出生年月日,从身份证抓取
822 894
                 if (StrUtil.isNotEmpty(identityNum)) {
823 895
                     identityNum = identityNum.replace("\n", "");
@@ -839,13 +911,13 @@ public class CaseZipImportImpl {
839 911
 
840 912
                 break;
841 913
             case "被申请人住所":
842
-                debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
914
+                debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() ));
843 915
                 break;
844 916
             case "被申请人联系电话":
845
-                debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
917
+                debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() ));
846 918
                 break;
847 919
             case "被申请人电子邮件":
848
-                debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
920
+                debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() )) ? fatchMap.get(dictData.getDictLabel() ).replace("\n", "").replaceAll("\\s", "") : null);
849 921
 
850 922
                 break;
851 923
             default:

+ 66
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java Wyświetl plik

@@ -0,0 +1,66 @@
1
+package com.ruoyi.wisdomarbitrate.task;
2
+
3
+
4
+import com.ruoyi.common.core.domain.entity.SysDictData;
5
+import com.ruoyi.common.core.domain.entity.SysUser;
6
+import com.ruoyi.common.core.domain.model.LoginUser;
7
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
8
+import com.ruoyi.wisdomarbitrate.domain.FatchRule;
9
+import com.ruoyi.wisdomarbitrate.service.impl.CaseZipImportImpl;
10
+
11
+import java.io.File;
12
+import java.util.ArrayList;
13
+import java.util.List;
14
+import java.util.Map;
15
+import java.util.concurrent.Callable;
16
+
17
+/**
18
+ * @description rbd调用xfta计算任务类
19
+ * @Author mingYang
20
+ * @Date 2021/11/12 15:35
21
+ * @Version V1.0
22
+ **/
23
+
24
+public class CaseZipImportTask implements Callable<List<CaseApplication>> {
25
+    private CaseZipImportImpl caseZipImportImpl;
26
+    private Long templateId;
27
+    private List<FatchRule> fatchRuleList;
28
+    private Map<String, String> fatchMap;
29
+    private Map<String, List<FatchRule>> fatchRuleMap;
30
+    private Map<String, SysUser> userMap;
31
+    private List<SysDictData> dictDataList;
32
+    private File[] files;
33
+    private Map<String, Long> deptMap;
34
+    private LoginUser loginUser;
35
+
36
+    public CaseZipImportTask(CaseZipImportImpl caseZipImportImpl, Long templateId, List<FatchRule> fatchRuleList, Map<String, String> fatchMap, Map<String, List<FatchRule>> fatchRuleMap, Map<String, SysUser> userMap, List<SysDictData> dictDataList, File[] files, Map<String, Long> deptMap, LoginUser loginUser) {
37
+        this.caseZipImportImpl = caseZipImportImpl;
38
+        this.templateId = templateId;
39
+        this.fatchRuleList = fatchRuleList;
40
+        this.fatchMap = fatchMap;
41
+        this.fatchRuleMap = fatchRuleMap;
42
+        this.userMap = userMap;
43
+        this.dictDataList = dictDataList;
44
+        this.files = files;
45
+        this.deptMap = deptMap;
46
+        this.loginUser = loginUser;
47
+    }
48
+
49
+    @Override
50
+    public List<CaseApplication> call() {
51
+        List<CaseApplication> caseApplications = new ArrayList<>();
52
+        for (File file1 : files) {
53
+            if (file1.isDirectory() && file1.listFiles() != null) {
54
+
55
+                for (File file2 : file1.listFiles()) {
56
+                    CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, fatchMap, userMap, dictDataList, deptMap, loginUser);
57
+                    if (caseApplication != null) {
58
+                        caseApplications.add(caseApplication);
59
+                    }
60
+                }
61
+            }
62
+        }
63
+
64
+        return caseApplications;
65
+    }
66
+}

+ 24
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java Wyświetl plik

@@ -47,6 +47,30 @@ public class CaseLogUtils
47 47
         operLog.setNotes(notes);
48 48
         caseLogRecordMapper.insertCaseLogRecord(operLog);
49 49
     }
50
+    /**
51
+     * 新增案件日志
52
+     * @param caseAppliId 案件id,不能为空
53
+     * @param caseNode 案件节点,不能为空
54
+     * @param notes 备注
55
+     */
56
+    public static void insertCaseLog(@NotNull Long caseAppliId, @NotEmpty Integer caseNode, String notes ,LoginUser loginUser ){
57
+        CaseLogRecord operLog = new CaseLogRecord();
58
+        // 获取当前的用户
59
+        if(loginUser!=null) {
60
+            SysUser sysUser = userMapper.selectUserById(loginUser.getUserId());
61
+            operLog.setCreateBy(sysUser.getUserName());
62
+            operLog.setCreateNickName(sysUser.getNickName());
63
+            operLog.setUpdateBy(sysUser.getUserName());
64
+        }else {
65
+            operLog.setCreateBy("admin");
66
+            operLog.setCreateNickName("管理员");
67
+            operLog.setUpdateBy("admin");
68
+        }
69
+        operLog.setCaseAppliId(caseAppliId);
70
+        operLog.setCaseNode(caseNode);
71
+        operLog.setNotes(notes);
72
+        caseLogRecordMapper.insertCaseLogRecord(operLog);
73
+    }
50 74
     /**
51 75
      * 批量新增案件日志
52 76
      * @param list

+ 8
- 8
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java Wyświetl plik

@@ -167,14 +167,14 @@ public class OCRUtils {
167 167
         String endContent = fatchRule.getEndContent();
168 168
         // 开始为空结束为空
169 169
         if (StrUtil.isEmpty(startContent) && StrUtil.isEmpty(endContent)) {
170
-            fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(text));
170
+            fatchMap.put(fatchRule.getColumnName(), trimStr(text));
171 171
         } else if (StrUtil.isNotEmpty(startContent) && StrUtil.isEmpty(endContent)) {
172 172
             // 开始不为空结束为空
173 173
             int startContIndex = StrUtil.ordinalIndexOf(text, startContent, fatchRule.getStartContentRepeatOrder());
174 174
             if (startContIndex != -1 && text.length() >= (startContIndex + startContent.length())) {
175 175
                 String substring = text.substring(startContIndex + startContent.length());
176 176
                 // 去除\n
177
-                fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(substring));
177
+                fatchMap.put(fatchRule.getColumnName(), trimStr(substring));
178 178
             }
179 179
 
180 180
         } else if (StrUtil.isEmpty(startContent) && StrUtil.isNotEmpty(endContent)) {
@@ -182,7 +182,7 @@ public class OCRUtils {
182 182
             int endContIndex = StrUtil.ordinalIndexOf(text, endContent, fatchRule.getEndContentRepeatOrder());
183 183
             if (endContIndex != -1) {
184 184
                 String substring = text.substring(0, endContIndex);
185
-                fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(substring));
185
+                fatchMap.put(fatchRule.getColumnName(), trimStr(substring));
186 186
             }
187 187
         } else if (StrUtil.isNotEmpty(startContent) && StrUtil.isNotEmpty(endContent)) {
188 188
             // 开始结束不为空
@@ -191,7 +191,7 @@ public class OCRUtils {
191 191
             if (startIndexOf != -1 && endIndexOf != -1 && endIndexOf >= (startIndexOf + startContent.length()) && text.length() >= endIndexOf) {
192 192
                 String substring = text.substring(startIndexOf + startContent.length(), endIndexOf);
193 193
 
194
-                fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(substring));
194
+                fatchMap.put(fatchRule.getColumnName(), trimStr(substring));
195 195
 
196 196
             }
197 197
         }
@@ -221,7 +221,7 @@ public class OCRUtils {
221 221
         }
222 222
         // 开始和结束截取都为空
223 223
         if (StrUtil.isEmpty(reverseStartContent) && StrUtil.isEmpty(reverseEndContent)) {
224
-            fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(text));
224
+            fatchMap.put(fatchRule.getColumnName(), trimStr(text));
225 225
         } else if (StrUtil.isEmpty(reverseStartContent) && StrUtil.isNotEmpty(reverseEndContent)) {
226 226
             // 开始为空,结束不为空
227 227
             // 根据截取的序号查找出位置
@@ -229,7 +229,7 @@ public class OCRUtils {
229 229
             if (indexOf != -1) {
230 230
                 String substring = reverseText.substring(0, indexOf);
231 231
                 if (StrUtil.isNotEmpty(substring)) {
232
-                    fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring)));
232
+                    fatchMap.put(fatchRule.getColumnName(), trimStr(StrUtil.reverse(substring)));
233 233
                 }
234 234
             }
235 235
         } else if (StrUtil.isNotEmpty(reverseStartContent) && StrUtil.isEmpty(reverseEndContent)) {
@@ -238,7 +238,7 @@ public class OCRUtils {
238 238
             if (indexOf != -1 && (indexOf + reverseStartContent.length() <= text.length())) {
239 239
                 String substring = reverseText.substring(indexOf + reverseStartContent.length());
240 240
                 if (StrUtil.isNotEmpty(substring)) {
241
-                    fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring)));
241
+                    fatchMap.put(fatchRule.getColumnName(), trimStr(StrUtil.reverse(substring)));
242 242
                 }
243 243
             }
244 244
 
@@ -249,7 +249,7 @@ public class OCRUtils {
249 249
             if (startIndexOf != -1 && endIndexOf != -1 && endIndexOf >= (startIndexOf + reverseStartContent.length()) && text.length() >= endIndexOf) {
250 250
                 String substring = reverseText.substring(startIndexOf + reverseStartContent.length(), endIndexOf);
251 251
                 if (StrUtil.isNotEmpty(substring)) {
252
-                    fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring)));
252
+                    fatchMap.put(fatchRule.getColumnName(), trimStr(StrUtil.reverse(substring)));
253 253
                 }
254 254
             }
255 255
         }

+ 48
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java Wyświetl plik

@@ -1,5 +1,7 @@
1 1
 package com.ruoyi.wisdomarbitrate.utils;
2 2
 
3
+import cn.hutool.json.JSONUtil;
4
+import com.alibaba.fastjson.JSON;
3 5
 import com.alibaba.fastjson.JSONObject;
4 6
 import com.google.gson.Gson;
5 7
 import com.google.gson.JsonArray;
@@ -11,6 +13,7 @@ import com.ruoyi.common.utils.DateUtils;
11 13
 import com.ruoyi.common.utils.EsignApplicaConfig;
12 14
 import com.ruoyi.common.utils.EsignHttpHelper;
13 15
 import com.ruoyi.common.utils.SealUtil;
16
+import com.ruoyi.wisdomarbitrate.StringIdsReq;
14 17
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
15 18
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
16 19
 
@@ -252,7 +255,7 @@ public class SignAward {
252 255
              /*       "                        \"availableSealIds\": [\n" +
253 256
                 "                               \"" + availableSealId + "\"\n" +
254 257
                 "                           ],\n" +*/
255
-                "                               \"availableSealIds\": " + new Gson().toJson(sealIdList) + ",\n" +
258
+           //     "                               \"availableSealIds\": " + new Gson().toJson(sealIdList) + ",\n" +
256 259
 
257 260
                 "                        \"signFieldPosition\": {\n" +
258 261
                 "                            \"positionPage\": \"" + positionPageorg + "\",\n" +
@@ -305,6 +308,50 @@ public class SignAward {
305 308
         //发起接口请求
306 309
         return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
307 310
     }
311
+    /**
312
+     * 获取批量签页面链接
313
+     *
314
+     * @return
315
+     * @throws EsignDemoException
316
+     */
317
+    public static EsignHttpResponse batchSignUrl(StringIdsReq idsReq) throws EsignDemoException {
318
+
319
+        List<String> signFlowIds = idsReq.getIds();
320
+        String psnAccount = idsReq.getPsnAccount();
321
+        String apiaddr = "/v3/sign-flow/batch-sign-url";
322
+        JSONObject paramObj = new JSONObject();
323
+        paramObj.put("operatorId",idsReq.getPsnId());
324
+        paramObj.put("signFlowIds",signFlowIds);
325
+        paramObj.put("clientType","PC");
326
+        String jsonParm =  JSON.toJSONString(paramObj);
327
+        //请求方法
328
+        EsignRequestType requestType = EsignRequestType.POST;
329
+        //生成请求签名鉴权方式的Header
330
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
331
+        //发起接口请求
332
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
333
+    }
334
+    /**
335
+     * 根据手机号获取账户id
336
+     *
337
+     * @return
338
+     * @throws EsignDemoException
339
+     */
340
+    public static EsignHttpResponse identityInfo(StringIdsReq idsReq) throws EsignDemoException {
341
+
342
+        List<String> signFlowIds = idsReq.getIds();
343
+        String psnAccount = idsReq.getPsnAccount();
344
+        String apiaddr = "/v3/persons/identity-info?psnAccount=" +psnAccount;
345
+
346
+        String jsonParm =  "{}";
347
+        //请求方法
348
+        EsignRequestType requestType = EsignRequestType.GET;
349
+        //生成请求签名鉴权方式的Header
350
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
351
+        //发起接口请求
352
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
353
+    }
354
+
308 355
 
309 356
     /**
310 357
      * 获取合同文件用印链接

+ 12
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml Wyświetl plik

@@ -37,7 +37,12 @@
37 37
     </resultMap>
38 38
 
39 39
     <select id="selectCaseAffiliate" parameterType="CaseAffiliate" resultMap="CaseAffiliateResult">
40
-        select c.*,s.user_id
40
+        select distinct (c.id),
41
+        c.case_appli_id, c.identity_type,c.application_organ_id,c.application_organ_name,c.name,c.identity_num,c.contact_telphone,
42
+        c.contact_address,c.work_address,c.work_telphone ,c.name_agent,c.identity_num_agent,c.contact_telphone_agent,
43
+        c.comp_legal_person,c.comp_legalper_post,c.respon_sex ,c.respon_birth,
44
+        c.residen_affili,appli_agent_title,
45
+        c.contact_address_agent,c.email, c.send_email,c.track_num,c.applicant_agent_user_id,c.agent_email,s.user_id
41 46
         from case_affiliate c
42 47
         left join sys_user s on c.identity_num=s.id_card
43 48
         <where>
@@ -47,7 +52,12 @@
47 52
         </where>
48 53
     </select>
49 54
     <select id="selectCaseAffiliateByCaseIds" resultMap="CaseAffiliateResult">
50
-        select c.*,s.user_id
55
+        select (c.id),
56
+        c.case_appli_id, c.identity_type,c.application_organ_id,c.application_organ_name,c.name,c.identity_num,c.contact_telphone,
57
+        c.contact_address,c.work_address,c.work_telphone ,c.name_agent,c.identity_num_agent,c.contact_telphone_agent,
58
+        c.comp_legal_person,c.comp_legalper_post,c.respon_sex ,c.respon_birth,
59
+        c.residen_affili,appli_agent_title,
60
+        c.contact_address_agent,c.email, c.send_email,c.track_num,c.applicant_agent_user_id,c.agent_email,s.user_id
51 61
         from case_affiliate c
52 62
         left join sys_user s on c.identity_num=s.id_card
53 63
         <where>

+ 18
- 10
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml Wyświetl plik

@@ -202,25 +202,27 @@
202 202
         WHERE id = #{id}
203 203
     </delete>
204 204
     <delete id="batchDeleteLog">
205
-        delete a from case_affiliate_log  a
206
-        join case_application_log l on l.id=a.case_appli_log_id
207
-        where l.id in (
205
+
206
+        delete from case_application_log l where l.id in
207
+        <foreach collection="ids" item="id" separator=",">
208
+            #{id}
209
+        </foreach>
210
+        ;
211
+        delete from case_affiliate_log l where l.case_appli_log_id in
208 212
         <foreach collection="ids" item="id" separator=",">
209 213
             #{id}
210 214
         </foreach>
211
-        );
212
-        delete a from case_attach_log  a
213
-        join case_application_log l on l.id=a.case_appli_log_id
214
-        where l.id in (
215
+        ;
216
+        delete from case_attach_log l where l.case_appli_log_id in
215 217
         <foreach collection="ids" item="id" separator=",">
216 218
             #{id}
217 219
         </foreach>
218
-        );
219
-        delete from case_application_log l where l.id in (
220
+        ;
221
+        delete from column_value_log l where l.case_appli_log_id in
220 222
         <foreach collection="ids" item="id" separator=",">
221 223
             #{id}
222 224
         </foreach>
223
-        );
225
+        ;
224 226
     </delete>
225 227
 
226 228
 
@@ -278,6 +280,12 @@
278 280
         FROM case_application_log
279 281
         WHERE case_appli_id = #{caseId} and version &lt; #{version} and update_submit_status not in ( 4, 5 ) order by version desc limit 1
280 282
     </select>
283
+    <select id="selectLogsByCaseIds" resultType="java.lang.Long">
284
+        select id  from case_application_log where case_appli_id in
285
+        <foreach collection="ids" item="item" separator="," open="(" close=")">
286
+            #{item}
287
+        </foreach>
288
+    </select>
281 289
 
282 290
 
283 291
 </mapper>

+ 114
- 203
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Wyświetl plik

@@ -62,21 +62,11 @@
62 62
         t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable,
63 63
         t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.update_by,t1.update_time,
64 64
         t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type,
65
-        t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus,t1.batch_number
65
+        t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus,t1.batch_number,t1.pendingStatus
66 66
         from(
67 67
         <trim suffixOverrides="union">
68
-            <!--申请人,被申请人,仲裁员,部门长,财务,代理人案件-->
68
+            <!--被申请人,仲裁员,部门长,财务,代理人案件-->
69 69
             <if test="isOtherRole!=null and isOtherRole==1">
70
-
71
-                select t.id,t.caseLogId,t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
72
-                t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
73
-                t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed
74
-                ,t.claim_liquid_damag,t.fee_payable ,
75
-                t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
76
-                t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName,
77
-                t.arbitrator_id,t.identity_num ,
78
-                t.identity_type,t.filearbitra_url,t.lock_status,t.version,t.updateSubmitStatus,t.batch_number
79
-                from(
80 70
                 select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
81 71
                 CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
82 72
                 ELSE '无审理方式'
@@ -99,78 +89,42 @@
99 89
                 c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
100 90
                 as applicantName,
101 91
                 c.arbitrator_id,ca.identity_num ,ca.identity_type,c.filearbitra_url,c.lock_status,c.version,null as
102
-                updateSubmitStatus,c.batch_number
92
+                updateSubmitStatus,c.batch_number,0 as pendingStatus
103 93
                 from case_application c
104 94
                 JOIN case_affiliate ca ON ca.case_appli_id = c.id
105
-                <!--查询条件-->
106
-                <where>
107
-                    <if test="caseStatus != null">
108
-                        AND c.case_status = #{caseStatus}
109
-                    </if>
110
-                    <if test="caseNum != null and caseNum != ''">
111
-                        AND c.case_num = #{caseNum}
112
-                    </if>
113
-                    <if test="nameId != null and nameId != ''">
114
-                        AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
115
-                    </if>
116
-                    <if test="caseStatusList != null and caseStatusList.size() > 0">
117
-                        and c.case_status in
118
-                        <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
119
-                            #{caseStatus}
120
-                        </foreach>
121
-                    </if>
122
-                    <if test="lockStatus != null">
123
-                        AND c.lock_status = #{lockStatus}
124
-                    </if>
125
-                </where>
126
-                ) t
127 95
                 <where>
128 96
                     <!--根据角色和状态过滤-->
129 97
                     <!--被申请人-->
130 98
                     <if test="idCard != null and idCard != ''">
131
-                        or (t.identity_num=#{idCard} AND t.identity_type=2
132
-<!--                         and (t.case_status=4 or t.case_status=17) -->
99
+                        or (ca.identity_num=#{idCard} AND ca.identity_type=2
100
+                         and (c.case_status=4 or c.case_status=17)
133 101
                         )
134 102
                     </if>
135 103
                     <!--仲裁员-->
136 104
                     <if test="userId != null and userId != ''">
137
-                <!--        or ( t.identity_type=1 and
138
-                        t.case_status in (7,13,17,18) -->
139
-                        or (t.identity_type=1
105
+                        or ( ca.identity_type=1 and
106
+                        c.case_status in (7,13,17,18)
140 107
                         and
141
-                        instr (t.arbitrator_id,#{userId})>0)
108
+                        instr (c.arbitrator_id,#{userId})>0)
142 109
                     </if>
143
-                    <!--申请人-->
144
-                    <!--                    <if test="applicationOrganId != null and applicationOrganId != ''">-->
145
-                    <!--                        or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1-->
146
-                    <!--                        &lt;!&ndash;暂时改为可以查询到生成裁决书之前所有的案件状态&ndash;&gt;-->
147
-                    <!--                        and (t.case_status &lt;= 10 or t.case_status=31))-->
148
-
149
-                    <!--                    </if>-->
150 110
                     <!--部门长-->
151 111
                     <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
152
-                        or (t.identity_type=1)
153
-                        <!--and t.case_status in
154
-                        <foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">
155
-                            #{caseStatus}
156
-                        </foreach>)-->
112
+                        or (ca.identity_type=1)
157 113
                     </if>
158 114
                     <!--财务-->
159 115
                     <if test="financeStatus != null and financeStatus != ''">
160
-                        or (t.identity_type=1
161
-                        <!-- and t.case_status =#{financeStatus}-->
116
+                        or (ca.identity_type=1
117
+                         and c.case_status =#{financeStatus}
162 118
                         )
163
-
164
-
165 119
                     </if>
166 120
                     <!--代理人-->
167 121
                     <if test="agentDeptIds != null and agentDeptIds.size()>0">
168 122
                         or (
169
-                        t.application_organ_id in
123
+                        ca.application_organ_id in
170 124
                         <foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
171 125
                         </foreach>
172
-                        AND t.identity_type=1
173
-                      <!--  and t.case_status in (0,9)-->
126
+                        AND ca.identity_type=1
127
+                        and c.case_status in (0,9)
174 128
                         )
175 129
 
176 130
                     </if>
@@ -206,30 +160,17 @@
206 160
                 c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,(select version from
207 161
                 case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select
208 162
                 update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1)
209
-                as updateSubmitStatus,c.batch_number
163
+                as updateSubmitStatus,c.batch_number,0 as pendingStatus
210 164
                 from case_application c
211 165
                 JOIN case_affiliate ca ON ca.case_appli_id =c.id AND ca.identity_type = 1
212 166
 
213 167
                 <where>
214
-                    <!--(c.case_status &lt;= 10 or c.case_status=31) AND-->
168
+                    (c.case_status &lt;= 10 or c.case_status=31) AND
215 169
                      ca.identity_type=1
216 170
 
217 171
                     <if test="applicationOrganId != null and applicationOrganId != ''">
218 172
                         AND ca.application_organ_id = #{applicationOrganId}
219 173
                     </if>
220
-                    <if test="caseStatus != null">
221
-                        AND c.case_status = #{caseStatus}
222
-                    </if>
223
-                    <if test="caseNum != null and caseNum != ''">
224
-                        AND c.case_num = #{caseNum}
225
-                    </if>
226
-                    <if test="nameId != null and nameId != ''">
227
-                        AND ca.application_organ_id=#{nameId}
228
-                    </if>
229
-
230
-                    <if test="lockStatus != null">
231
-                        AND c.lock_status = #{lockStatus}
232
-                    </if>
233 174
                 </where>
234 175
                 union
235 176
             </if>
@@ -237,7 +178,6 @@
237 178
             <if test="deptIds != null and deptIds.size() > 0">
238 179
 
239 180
                 <!--秘书主表案件-->
240
-                select tt.* from(
241 181
                 SELECT
242 182
                 c.id,
243 183
                 '' AS caseLogId,
@@ -287,7 +227,7 @@
287 227
                 c.filearbitra_url,
288 228
                 c.lock_status,c.version,
289 229
                 null as updateSubmitStatus,
290
-                c.batch_number
230
+                c.batch_number,0 as pendingStatus
291 231
                 FROM
292 232
                 case_application c
293 233
                 JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
@@ -302,40 +242,9 @@
302 242
                 )
303 243
                 WHERE
304 244
                 ca.identity_type=1
305
-
306
-              <!--  and c.case_status in (1,5,8,9,11,14,15,16,17,31)-->
307
-
308
-          <!--      <if test="deptIds != null and deptIds.size() > 0">
309
-                    and ca.application_organ_id in
310
-                    <foreach item="item" collection="deptIds" open="(" separator="," close=")">
311
-                        #{item}
312
-                    </foreach>
313
-                </if>-->
314
-                <if test="lockStatus != null">
315
-                    AND c.lock_status = #{lockStatus}
316
-                </if>
317
-
318
-                <if test="caseNum != null and caseNum != ''">
319
-                    AND c.case_num = #{caseNum}
320
-                </if>
321
-                <if test="nameId != null and nameId != ''">
322
-                    AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
323
-                </if>) tt
324
-                <where>
325
-                    <if test="caseStatusList != null and caseStatusList.size() > 0">
326
-                        and tt.case_status in
327
-                        <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
328
-                            #{caseStatus}
329
-                        </foreach>
330
-                    </if>
331
-                    <if test="caseStatus != null">
332
-                        AND tt.case_status = #{caseStatus}
333
-                    </if>
334
-
335
-                </where>
245
+                and c.case_status in (1,5,8,9,11,14,15,16,17,31)
336 246
                 union
337 247
                 <!--秘书审核案件-->
338
-                select tt2.* from(
339 248
                 SELECT
340 249
                 l.case_appli_id id,
341 250
                 l.id AS caseLogId,
@@ -382,7 +291,7 @@
382 291
                 ca.application_organ_id ,
383 292
                 ca.application_organ_name AS applicantName,
384 293
                 c.arbitrator_id,ca.identity_num ,ca.identity_type,
385
-                c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus,c.batch_number
294
+                c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus,c.batch_number,0 as pendingStatus
386 295
                 FROM
387 296
                 case_application c
388 297
                 JOIN case_application_log l ON c.id = l.case_appli_id
@@ -390,33 +299,7 @@
390 299
                 AND ca.identity_type = 1
391 300
                 WHERE
392 301
                 l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
393
-<!--                <if test="caseStatusList != null and caseStatusList.size() > 0">-->
394
-<!--                    and c.case_status in-->
395
-<!--                    <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">-->
396
-<!--                        #{caseStatus}-->
397
-<!--                    </foreach>-->
398
-<!--                </if>-->
399
-          <!--      <if test="deptIds != null and deptIds.size() > 0">
400
-                    and ca.application_organ_id in
401
-                    <foreach item="item" collection="deptIds" open="(" separator="," close=")">
402
-                        #{item}
403
-                    </foreach>
404
-                </if> -->
405
-<!--                <if test="caseStatus != null">-->
406
-<!--                    AND c.case_status = #{caseStatus}-->
407
-<!--                </if>-->
408
-                <if test="lockStatus != null">
409
-                    AND c.lock_status = #{lockStatus}
410
-                </if>
411
-                <if test="caseNum != null and caseNum != ''">
412
-                    AND c.case_num = #{caseNum}
413
-                </if>
414
-                <if test="nameId != null and nameId != ''">
415
-                    AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
416
-                </if>
417
-                <!--                    <if test="caseStatusList != null and caseStatusList.size() > 0">-->
418
-                <!--                        and c.case_status in (1,5)-->
419
-                <!--                    </if>-->
302
+
420 303
                 <!-- 查询该案件的最新记录 -->
421 304
                 AND l.version = (
422 305
                 SELECT
@@ -425,26 +308,86 @@
425 308
                 case_application_log
426 309
                 WHERE
427 310
                 c.id = case_appli_id)
428
-                ) tt2
429
-
430
-                                 <where>
431
-
432
-                                     <if test="caseStatus != null">
433
-                                         AND tt2.case_status = #{caseStatus}
434
-                                     </if>
435
-                                     <if test="caseStatusList != null and caseStatusList.size() > 0">
436
-                                         and tt2.case_status in
437
-                                         <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
438
-                                             #{caseStatus}
439
-                                         </foreach>
440
-                                     </if>
441
-                                 </where>
442 311
 
312
+                union
313
+            </if>
314
+        <!-- 已办案件 -->
315
+            <if test="loginUserName != null and loginUserName != ''">
316
+            SELECT
317
+            c.id,
318
+            '' AS caseLogId,
319
+            c.case_num,
320
+            c.case_subject_amount,
321
+            c.register_date,
322
+            c.arbitrat_method,
323
+            CASE
324
+            c.arbitrat_method
325
+            WHEN 1 THEN
326
+            '开庭审理'
327
+            WHEN 2 THEN
328
+            '书面审理' ELSE '无审理方式'
329
+            END arbitratMethodName,
330
+            c.case_status,
331
+            CASE
332
+            c.case_status
333
+            when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
334
+            when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
335
+            when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
336
+            when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
337
+            when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
338
+            when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
339
+            when 18 then '待仲裁员审核仲裁文书'
340
+            when 31 then '待修改开庭时间' ELSE '无案件状态'
341
+            END caseStatusName,
342
+            c.hear_date,
343
+            c.arbitrat_claims,
344
+            c.loan_start_date,
345
+            c.loan_end_date,
346
+            c.claim_princi_owed,
347
+            c.claim_interest_owed,
348
+            c.claim_liquid_damag,
349
+            c.fee_payable,
350
+            c.begin_video_date,
351
+            c.online_video_person,
352
+            c.contract_number,
353
+            c.create_by,
354
+            c.create_time,
355
+            c.update_by,
356
+            c.update_time,
357
+            c.arbitrator_name,
358
+            ca.name,
359
+            ca.application_organ_id ,
360
+            ca.application_organ_name AS applicantName,
361
+            c.arbitrator_id,ca.identity_num ,ca.identity_type,
362
+            c.filearbitra_url,
363
+            c.lock_status,c.version,
364
+            null as updateSubmitStatus,
365
+            c.batch_number,1 as pendingStatus
366
+                from case_log_record r
367
+                join case_application c on r.case_appli_id=c.id and r.case_node!=c.case_status
368
+                JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
369
+                WHERE
370
+                 r.create_by=#{loginUserName}  AND ca.identity_type=1
443 371
             </if>
372
+
444 373
         </trim>
445 374
         ) t1
375
+        <where>
376
+            <if test="caseStatus != null">
377
+                AND t1.case_status = #{caseStatus}
378
+            </if>
379
+            <if test="lockStatus != null">
380
+                AND t1.lock_status = #{lockStatus}
381
+            </if>
382
+            <if test="caseNum != null and caseNum != ''">
383
+                AND t1.case_num = #{caseNum}
384
+            </if>
385
+            <if test="nameId != null and nameId != ''">
386
+                AND t1.application_organ_id=#{nameId} AND t1.identity_type=1
387
+            </if>
388
+        </where>
446 389
 
447
-        order by t1.case_num desc
390
+        order by  t1.pendingStatus asc,t1.case_num desc
448 391
     </select>
449 392
 
450 393
 
@@ -563,15 +506,6 @@
563 506
                 and
564 507
                 instr (t.arbitrator_id,#{userId})>0)
565 508
             </if>
566
-            <!--法律顾问秘书-->
567
-            <!--            <if test="deptIds != null and deptIds.size() > 0">-->
568
-            <!--                or (t.identity_type=1 and t.case_status in (1,5,11,15,16,17,31)-->
569
-            <!--                and t.application_organ_id in-->
570
-            <!--                <foreach item="item" collection="deptIds" open="(" separator="," close=")">-->
571
-            <!--                    #{item}-->
572
-            <!--                </foreach> )-->
573
-            <!--            </if>-->
574
-
575 509
             <!--申请人-->
576 510
             <if test="applicationOrganId != null and applicationOrganId != ''">
577 511
                 or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
@@ -663,14 +597,6 @@
663 597
                         and
664 598
                         instr (t.arbitrator_id,#{userId})>0)
665 599
                     </if>
666
-                    <!--法律顾问-->
667
-                    <!--            <if test="deptIds != null and deptIds.size() > 0">-->
668
-                    <!--                or (t.identity_type=1 and t.case_status in (1,5,11,15,16,17,31)-->
669
-                    <!--                and t.application_organ_id in-->
670
-                    <!--                <foreach item="item" collection="deptIds" open="(" separator="," close=")">-->
671
-                    <!--                    #{item}-->
672
-                    <!--                </foreach> )-->
673
-                    <!--            </if>-->
674 600
                     <!--申请人-->
675 601
                     <if test="applicationOrganId != null and applicationOrganId != ''">
676 602
                         or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
@@ -702,37 +628,7 @@
702 628
                 </where>
703 629
                 union
704 630
             </if>
705
-            <!--            <if test="applicationOrganId != null and applicationOrganId != ''">-->
706
-            <!--                &lt;!&ndash;申请人案件&ndash;&gt;-->
707
-
708
-            <!--                select l.case_appli_id id ,-->
709
-            <!--                c.case_status,ca.application_organ_id,-->
710
-            <!--                c.arbitrator_id,ca.identity_num , ca.identity_type-->
711
-            <!--                from case_application c-->
712
-            <!--                JOIN case_application_log l ON c.id = l.case_appli_id-->
713
-            <!--                JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1 and c.version=l.version-->
714
-            <!--                <where>-->
715
-            <!--                    (c.case_status &lt;= 10 or c.case_status=31) AND ca.identity_type=1-->
716
-
717
-            <!--                    <if test="applicationOrganId != null and applicationOrganId != ''">-->
718
-            <!--                        AND ca.application_organ_id = #{applicationOrganId}-->
719
-            <!--                    </if>-->
720
-            <!--                    <if test="caseStatus != null">-->
721
-            <!--                        AND c.case_status = #{caseStatus}-->
722
-            <!--                    </if>-->
723
-            <!--                    <if test="caseNum != null and caseNum != ''">-->
724
-            <!--                        AND c.case_num = #{caseNum}-->
725
-            <!--                    </if>-->
726
-            <!--                    <if test="nameId != null and nameId != ''">-->
727
-            <!--                        AND ca.application_organ_id=#{nameId}-->
728
-            <!--                    </if>-->
729
-
730
-            <!--                    <if test="lockStatus != null">-->
731
-            <!--                        AND c.lock_status = #{lockStatus}-->
732
-            <!--                    </if>-->
733
-            <!--                </where>-->
734
-            <!--                union-->
735
-            <!--            </if>-->
631
+
736 632
             <!--秘书案件-->
737 633
             <if test="deptIds != null and deptIds.size() > 0">
738 634
 
@@ -904,7 +800,7 @@
904 800
     </select>
905 801
     <insert id="insertCaseApplication" parameterType="CaseApplication" useGeneratedKeys="true" keyProperty="id">
906 802
         insert into case_application(
907
-        <if test="id != null''">id ,</if>
803
+        <if test="id != null">id ,</if>
908 804
         <if test="caseName != null  and caseName != ''">case_name ,</if>
909 805
         <if test="caseNum != null and caseNum != ''">case_num,</if>
910 806
         <if test="caseSubjectAmount != null">case_subject_amount,</if>
@@ -938,7 +834,7 @@
938 834
         batch_number,
939 835
         create_time
940 836
         )values(
941
-        <if test="id != null''">#{id} ,</if>
837
+        <if test="id != null">#{id} ,</if>
942 838
         <if test="caseName != null and caseName != ''">#{caseName},</if>
943 839
         <if test="caseNum != null and caseNum != ''">#{caseNum},</if>
944 840
         <if test="caseSubjectAmount != null">#{caseSubjectAmount},</if>
@@ -1143,7 +1039,22 @@
1143 1039
         where id in
1144 1040
         <foreach collection="ids" item="item" open="(" separator="," close=")">
1145 1041
             #{item}
1146
-        </foreach>
1042
+        </foreach>;
1043
+        delete from case_affiliate
1044
+        where case_appli_id in
1045
+        <foreach collection="ids" item="item" open="(" separator="," close=")">
1046
+            #{item}
1047
+        </foreach>;
1048
+        delete from case_attach
1049
+        where case_appli_id in
1050
+        <foreach collection="ids" item="item" open="(" separator="," close=")">
1051
+            #{item}
1052
+        </foreach>;
1053
+        delete from column_value
1054
+        where case_id in
1055
+        <foreach collection="ids" item="item" open="(" separator="," close=")">
1056
+            #{item}
1057
+        </foreach>;
1147 1058
     </delete>
1148 1059
 
1149 1060
     <select id="selectCaseApplication" parameterType="CaseApplication" resultMap="CaseApplicationResult">

+ 37
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml Wyświetl plik

@@ -42,10 +42,45 @@
42 42
     </select>
43 43
 
44 44
     <select id="selectSealSignRecordbyStat" parameterType="SealSignRecord" resultMap="SealSignRecordResult">
45
-        SELECT s.id ,s.case_appli_id ,s.file_id ,s.sign_flow_id
46
-        from seal_sign_record s
45
+        SELECT s.id ,s.case_appli_id ,s.file_id ,s.sign_flow_id,s.sign_flow_status
46
+        from seal_sign_record s join case_application c on s.case_appli_id=c.id
47 47
         where s.sign_flow_status  in (1,2)
48 48
     </select>
49
+    <select id="selectSealSigning" resultType="com.ruoyi.wisdomarbitrate.domain.CaseApplication">
50
+        SELECT s.sign_flow_id signFlowId,c.id id,c.case_status caseStatus,
51
+        CASE c.case_status  when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
52
+        when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
53
+        when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
54
+        when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
55
+        when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
56
+        when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
57
+        when 18 then '待仲裁员审核仲裁文书'
58
+        when 31 then '待修改开庭时间'
59
+        ELSE '无案件状态'
60
+        END caseStatusName,
61
+        c.case_subject_amount caseSubjectAmount,c.case_num caseNum,c.hear_date hearDate,
62
+        ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,
63
+        c.arbitrat_method arbitratMethod ,
64
+        CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
65
+        ELSE '无审理方式'
66
+        END arbitratMethodName,
67
+        c.arbitrator_id arbitratorId,
68
+        c.arbitrator_name arbitratorName
69
+        from seal_sign_record s
70
+        join case_application c on s.case_appli_id=c.id
71
+        JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
72
+        <!-- where s.sign_flow_status in (0,1,2)-->
73
+        <where>
74
+        <if test="penSonAccount != null and penSonAccount!='' ">
75
+            AND s.penson_account  = #{penSonAccount}
76
+        </if>
77
+        <if test="caseStatus != null and caseStatus!='' ">
78
+            AND c.case_status  = #{caseStatus}
79
+        </if>
80
+        </where>
81
+        order by c.case_num desc
82
+    </select>
83
+
49 84
 
50 85
     <update id="updataSealSignRecord" parameterType="SealSignRecord">
51 86
         update seal_sign_record