Ver código fonte

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

qitz 2 anos atrás
pai
commit
07704327ab
16 arquivos alterados com 573 adições e 150 exclusões
  1. 2
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/RegisterController.java
  2. 34
    4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java
  3. 1
    1
      ruoyi-admin/src/main/resources/application-druid.yml
  4. 3
    2
      ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java
  5. 44
    45
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
  6. 2
    1
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java
  7. 136
    18
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java
  8. 26
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/BookSendVO.java
  9. 29
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseLogVO.java
  10. 16
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/LogisticsInfoVO.java
  11. 9
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java
  12. 8
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java
  13. 141
    39
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java
  14. 113
    34
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java
  15. 4
    1
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml
  16. 5
    4
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml

+ 2
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/RegisterController.java Ver arquivo

@@ -26,4 +26,6 @@ public class RegisterController {
26 26
     public AjaxResult createDocument(@Validated @RequestBody PersonRegisterVO personRegisterVO) {
27 27
         return signRegisterService.registerPerson(personRegisterVO);
28 28
     }
29
+//    @PostMapping("/registerEnterprise")
30
+//    public AjaxResult
29 31
 }

+ 34
- 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java Ver arquivo

@@ -3,6 +3,7 @@ package com.ruoyi.web.controller.wisdomarbitrate;
3 3
 import com.ruoyi.common.core.controller.BaseController;
4 4
 import com.ruoyi.common.core.domain.AjaxResult;
5 5
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
6
+import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
6 7
 import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
7 8
 import org.springframework.beans.factory.annotation.Autowired;
8 9
 import org.springframework.validation.annotation.Validated;
@@ -41,12 +42,41 @@ public class AdjudicationController extends BaseController {
41 42
 
42 43
     /**
43 44
      * 根据快递单号查询物流信息
44
-     * @param trackingNum 单号
45
-     * @param phoneLastFour 收/寄件人手机号后四位,顺丰快递需填写本字段。
45
+     * @param caseApplication
46 46
      * @return
47 47
      */
48 48
     @GetMapping("/logistics")
49
-    public AjaxResult  getLogisticsInfo(String trackingNum,Integer phoneLastFour){
50
-        return adjudicationService.getLogisticsInfo(trackingNum,phoneLastFour);
49
+    public AjaxResult  getLogisticsInfo(CaseApplication caseApplication){
50
+        return adjudicationService.getLogisticsInfo(caseApplication);
51
+    }
52
+
53
+    /**
54
+     * 签名(暂时只改案件状态)
55
+     * @param caseApplication
56
+     * @return
57
+     */
58
+    @PostMapping("/signature")
59
+    public AjaxResult signature(@Validated @RequestBody CaseApplication caseApplication){
60
+        return adjudicationService.signature(caseApplication);
61
+    }
62
+
63
+    /**
64
+     * 归档(暂时只改案件状态)
65
+     * @param caseApplication
66
+     * @return
67
+     */
68
+    @PostMapping("/caseFile")
69
+    public AjaxResult caseFile(@Validated @RequestBody CaseApplication caseApplication){
70
+        return adjudicationService.caseFile(caseApplication);
71
+    }
72
+
73
+    /**
74
+     * 送达(不包含发送电子邮件)
75
+     * @param bookSendVO
76
+     * @return
77
+     */
78
+    @PostMapping("/service")
79
+    public AjaxResult service(@RequestBody BookSendVO bookSendVO){
80
+        return adjudicationService.service(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum());
51 81
     }
52 82
 }

+ 1
- 1
ruoyi-admin/src/main/resources/application-druid.yml Ver arquivo

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

+ 3
- 2
ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java Ver arquivo

@@ -37,12 +37,13 @@ public class CaseApplicationConstants {
37 37
     /**待仲裁文书签名*/
38 38
     public static final int SIGN_ARBITRATION = 13;
39 39
     /** 待仲裁文书用印 */
40
-    public static final int ARBITRATED_SEAL = 14;
40
+    public static final int     ARBITRATED_SEAL = 14;
41 41
     /** 待仲裁文书送达 */
42 42
     public static final int ARBITRATION_DELIVERY = 15;
43 43
     /** 待案件归档*/
44 44
     public static final int CASE_FILING = 16;
45
-
45
+    /** 已归档*/
46
+    public static final int CASE_ARCHIVED = 17;
46 47
 
47 48
 
48 49
 

+ 44
- 45
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java Ver arquivo

@@ -1,118 +1,117 @@
1 1
 package com.ruoyi.common.core.domain;
2 2
 
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import com.fasterxml.jackson.annotation.JsonIgnore;
5
+import com.fasterxml.jackson.annotation.JsonInclude;
6
+
3 7
 import java.io.Serializable;
4 8
 import java.util.Date;
5 9
 import java.util.HashMap;
6 10
 import java.util.Map;
7
-import com.fasterxml.jackson.annotation.JsonFormat;
8
-import com.fasterxml.jackson.annotation.JsonIgnore;
9
-import com.fasterxml.jackson.annotation.JsonInclude;
10 11
 
11 12
 /**
12 13
  * Entity基类
13
- * 
14
+ *
14 15
  * @author ruoyi
15 16
  */
16
-public class BaseEntity implements Serializable
17
-{
17
+public class BaseEntity implements Serializable {
18 18
     private static final long serialVersionUID = 1L;
19 19
 
20
-    /** 搜索值 */
20
+    /**
21
+     * 搜索值
22
+     */
21 23
     @JsonIgnore
22 24
     private String searchValue;
23 25
 
24
-    /** 创建者 */
26
+    /**
27
+     * 创建者
28
+     */
25 29
     private String createBy;
26 30
 
27
-    /** 创建时间 */
28
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
31
+    /**
32
+     * 创建时间
33
+     */
34
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
29 35
     private Date createTime;
30 36
 
31
-    /** 更新者 */
37
+    /**
38
+     * 更新者
39
+     */
32 40
     private String updateBy;
33 41
 
34
-    /** 更新时间 */
35
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
42
+    /**
43
+     * 更新时间
44
+     */
45
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
36 46
     private Date updateTime;
37 47
 
38
-    /** 备注 */
48
+    /**
49
+     * 备注
50
+     */
39 51
     private String remark;
40 52
 
41
-    /** 请求参数 */
53
+    /**
54
+     * 请求参数
55
+     */
42 56
     @JsonInclude(JsonInclude.Include.NON_EMPTY)
43 57
     private Map<String, Object> params;
44 58
 
45
-    public String getSearchValue()
46
-    {
59
+    public String getSearchValue() {
47 60
         return searchValue;
48 61
     }
49 62
 
50
-    public void setSearchValue(String searchValue)
51
-    {
63
+    public void setSearchValue(String searchValue) {
52 64
         this.searchValue = searchValue;
53 65
     }
54 66
 
55
-    public String getCreateBy()
56
-    {
67
+    public String getCreateBy() {
57 68
         return createBy;
58 69
     }
59 70
 
60
-    public void setCreateBy(String createBy)
61
-    {
71
+    public void setCreateBy(String createBy) {
62 72
         this.createBy = createBy;
63 73
     }
64 74
 
65
-    public Date getCreateTime()
66
-    {
75
+    public Date getCreateTime() {
67 76
         return createTime;
68 77
     }
69 78
 
70
-    public void setCreateTime(Date createTime)
71
-    {
79
+    public void setCreateTime(Date createTime) {
72 80
         this.createTime = createTime;
73 81
     }
74 82
 
75
-    public String getUpdateBy()
76
-    {
83
+    public String getUpdateBy() {
77 84
         return updateBy;
78 85
     }
79 86
 
80
-    public void setUpdateBy(String updateBy)
81
-    {
87
+    public void setUpdateBy(String updateBy) {
82 88
         this.updateBy = updateBy;
83 89
     }
84 90
 
85
-    public Date getUpdateTime()
86
-    {
91
+    public Date getUpdateTime() {
87 92
         return updateTime;
88 93
     }
89 94
 
90
-    public void setUpdateTime(Date updateTime)
91
-    {
95
+    public void setUpdateTime(Date updateTime) {
92 96
         this.updateTime = updateTime;
93 97
     }
94 98
 
95
-    public String getRemark()
96
-    {
99
+    public String getRemark() {
97 100
         return remark;
98 101
     }
99 102
 
100
-    public void setRemark(String remark)
101
-    {
103
+    public void setRemark(String remark) {
102 104
         this.remark = remark;
103 105
     }
104 106
 
105
-    public Map<String, Object> getParams()
106
-    {
107
-        if (params == null)
108
-        {
107
+    public Map<String, Object> getParams() {
108
+        if (params == null) {
109 109
             params = new HashMap<>();
110 110
         }
111 111
         return params;
112 112
     }
113 113
 
114
-    public void setParams(Map<String, Object> params)
115
-    {
114
+    public void setParams(Map<String, Object> params) {
116 115
         this.params = params;
117 116
     }
118 117
 }

+ 2
- 1
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java Ver arquivo

@@ -25,6 +25,7 @@ public class ApplicationConfig
25 25
     @Bean
26 26
     public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization()
27 27
     {
28
-        return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault());
28
+//        return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault());
29
+        return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone("Asia/Shanghai");
29 30
     }
30 31
 }

+ 136
- 18
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java Ver arquivo

@@ -13,7 +13,7 @@ public class CaseApplication  extends BaseEntity {
13 13
     /** ID */
14 14
     private Long id;
15 15
     /** 案件编号 */
16
-    @Excel(name = "案件编号")
16
+//    @Excel(name = "案件编号")
17 17
     private String caseNum;
18 18
     /** 案件标的 */
19 19
     @Excel(name = "案件标的")
@@ -58,8 +58,7 @@ public class CaseApplication  extends BaseEntity {
58 58
     /** 开庭日期 */
59 59
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
60 60
     private Date hearDate;
61
-    /** 申请人仲裁诉求 */
62
-    private String arbitratClaims;
61
+
63 62
     /** 借款开始日期 */
64 63
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
65 64
     @Excel(name = "借款开始日期")
@@ -80,6 +79,9 @@ public class CaseApplication  extends BaseEntity {
80 79
     /** 申请人主张违约金 */
81 80
     @Excel(name = "申请人主张违约金")
82 81
     private BigDecimal claimLiquidDamag;
82
+    /** 申请人仲裁诉求 */
83
+    @Excel(name = "申请人仲裁诉求")
84
+    private String arbitratClaims;
83 85
     /** 仲裁应缴费用 */
84 86
     private BigDecimal feePayable;
85 87
 
@@ -324,36 +326,78 @@ public class CaseApplication  extends BaseEntity {
324 326
     }
325 327
 
326 328
     /** 身份类型 */
327
-    @Excel(name = "身份类型")
329
+//    @Excel(name = "身份类型")
328 330
     private int identityType;
331
+    /**
332
+     * 申请人主体信息
333
+     */
329 334
     /** 姓名 */
330
-    @Excel(name = "姓名")
335
+    @Excel(name = "申请人主体信息-申请人姓名",width = 26)
331 336
     private String name;
332 337
     /** 身份证号 */
333
-    @Excel(name = "身份证号")
338
+    @Excel(name = "申请人主体信息-身份证号",width = 26)
334 339
     private String identityNum;
335
-    /** 单位电话 */
336
-    @Excel(name = "单位电话")
337
-    private String workTelphone;
340
+
338 341
     /** 联系电话 */
339
-    @Excel(name = "联系电话")
342
+    @Excel(name = "申请人主体信息-联系电话",width = 26)
340 343
     private String contactTelphone;
341 344
     /** 联系地址 */
342
-    @Excel(name = "联系地址")
345
+    @Excel(name = "申请人主体信息-联系地址",width = 26)
343 346
     private String contactAddress;
347
+    /** 单位电话 */
348
+    @Excel(name = "申请人主体信息-单位电话",width = 26)
349
+    private String workTelphone;
344 350
     /** 单位地址 */
345
-    @Excel(name = "单位地址")
351
+    @Excel(name = "申请人主体信息-单位地址",width = 26)
346 352
     private String workAddress;
347 353
 
348 354
     /** 代理人姓名 */
349
-    @Excel(name = "代理人姓名")
355
+    @Excel(name = "申请人主体信息-代理人姓名",width = 26)
350 356
     private String nameAgent;
351 357
     /** 身份证号 */
352
-    @Excel(name = "代理人身份证号")
358
+    @Excel(name = "申请人主体信息-代理人身份证号",width = 26)
353 359
     private String identityNumAgent;
354 360
     /** 联系电话 */
355
-    @Excel(name = "代理人联系电话")
361
+    @Excel(name = "申请人主体信息-代理人联系电话",width = 26)
356 362
     private String contactTelphoneAgent;
363
+    /** 联系地址 */
364
+    @Excel(name = "申请人主体信息-代理人联系地址",width = 26)
365
+    private String contactAddressAgent;
366
+    /**
367
+     * 被申请人主体信息
368
+     */
369
+    /** 姓名 */
370
+    @Excel(name = "被申请人主体信息-申请人姓名",width = 26)
371
+    private String debtorName;
372
+    /** 身份证号 */
373
+    @Excel(name = "被申请人主体信息-身份证号",width = 26)
374
+    private String debtorIdentityNum;
375
+
376
+    /** 联系电话 */
377
+    @Excel(name = "被申请人主体信息-联系电话",width = 26)
378
+    private String debtorContactTelphone;
379
+    /** 联系地址 */
380
+    @Excel(name = "被申请人主体信息-联系地址",width = 26)
381
+    private String debtorContactAddress;
382
+    /** 单位电话 */
383
+    @Excel(name = "被申请人主体信息-单位电话",width = 26)
384
+    private String debtorWorkTelphone;
385
+    /** 单位地址 */
386
+    @Excel(name = "被申请人主体信息-单位地址",width = 26)
387
+    private String debtorWorkAddress;
388
+
389
+    /** 代理人姓名 */
390
+    @Excel(name = "被申请人主体信息-代理人姓名",width = 26)
391
+    private String debtorNameAgent;
392
+    /** 身份证号 */
393
+    @Excel(name = "被申请人主体信息-代理人身份证号",width = 26)
394
+    private String debtorIdentityNumAgent;
395
+    /** 联系电话 */
396
+    @Excel(name = "被申请人主体信息-代理人联系电话",width = 26)
397
+    private String debtorContactTelphoneAgent;
398
+    /** 联系地址 */
399
+    @Excel(name = "被申请人主体信息-代理人联系地址",width = 26)
400
+    private String debtorContactAddressAgent;
357 401
 
358 402
     public int getIdentityType() {
359 403
         return identityType;
@@ -443,12 +487,86 @@ public class CaseApplication  extends BaseEntity {
443 487
         this.contactAddressAgent = contactAddressAgent;
444 488
     }
445 489
 
446
-    /** 联系地址 */
447
-    @Excel(name = "代理人联系地址")
448
-    private String contactAddressAgent;
449 490
 
491
+    public String getDebtorName() {
492
+        return debtorName;
493
+    }
494
+
495
+    public void setDebtorName(String debtorName) {
496
+        this.debtorName = debtorName;
497
+    }
450 498
 
499
+    public String getDebtorIdentityNum() {
500
+        return debtorIdentityNum;
501
+    }
451 502
 
503
+    public void setDebtorIdentityNum(String debtorIdentityNum) {
504
+        this.debtorIdentityNum = debtorIdentityNum;
505
+    }
506
+
507
+    public String getDebtorContactTelphone() {
508
+        return debtorContactTelphone;
509
+    }
510
+
511
+    public void setDebtorContactTelphone(String debtorContactTelphone) {
512
+        this.debtorContactTelphone = debtorContactTelphone;
513
+    }
514
+
515
+    public String getDebtorContactAddress() {
516
+        return debtorContactAddress;
517
+    }
518
+
519
+    public void setDebtorContactAddress(String debtorContactAddress) {
520
+        this.debtorContactAddress = debtorContactAddress;
521
+    }
522
+
523
+    public String getDebtorWorkTelphone() {
524
+        return debtorWorkTelphone;
525
+    }
526
+
527
+    public void setDebtorWorkTelphone(String debtorWorkTelphone) {
528
+        this.debtorWorkTelphone = debtorWorkTelphone;
529
+    }
530
+
531
+    public String getDebtorWorkAddress() {
532
+        return debtorWorkAddress;
533
+    }
534
+
535
+    public void setDebtorWorkAddress(String debtorWorkAddress) {
536
+        this.debtorWorkAddress = debtorWorkAddress;
537
+    }
538
+
539
+    public String getDebtorNameAgent() {
540
+        return debtorNameAgent;
541
+    }
542
+
543
+    public void setDebtorNameAgent(String debtorNameAgent) {
544
+        this.debtorNameAgent = debtorNameAgent;
545
+    }
546
+
547
+    public String getDebtorIdentityNumAgent() {
548
+        return debtorIdentityNumAgent;
549
+    }
550
+
551
+    public void setDebtorIdentityNumAgent(String debtorIdentityNumAgent) {
552
+        this.debtorIdentityNumAgent = debtorIdentityNumAgent;
553
+    }
554
+
555
+    public String getDebtorContactTelphoneAgent() {
556
+        return debtorContactTelphoneAgent;
557
+    }
558
+
559
+    public void setDebtorContactTelphoneAgent(String debtorContactTelphoneAgent) {
560
+        this.debtorContactTelphoneAgent = debtorContactTelphoneAgent;
561
+    }
562
+
563
+    public String getDebtorContactAddressAgent() {
564
+        return debtorContactAddressAgent;
565
+    }
566
+
567
+    public void setDebtorContactAddressAgent(String debtorContactAddressAgent) {
568
+        this.debtorContactAddressAgent = debtorContactAddressAgent;
569
+    }
452 570
 
453 571
     public Long getId() {
454 572
         return id;

+ 26
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/BookSendVO.java Ver arquivo

@@ -0,0 +1,26 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Builder;
5
+import lombok.Data;
6
+import lombok.NoArgsConstructor;
7
+
8
+@Data
9
+@Builder
10
+@NoArgsConstructor
11
+@AllArgsConstructor
12
+public class BookSendVO {
13
+    /**
14
+     * 案件id
15
+     * 申请人邮箱
16
+     * 被申请人邮箱
17
+     * 申请人快递编号
18
+     * 被申请人快递编号
19
+     */
20
+    private Long id;
21
+    private String appEmail;
22
+    private String resEmail;
23
+    private String apptrackingNum;
24
+    private String restrackingNum;
25
+
26
+}

+ 29
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseLogVO.java Ver arquivo

@@ -0,0 +1,29 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo;
2
+
3
+import lombok.Data;
4
+
5
+import java.util.Date;
6
+
7
+/**
8
+ * @description 案件操作日志实体
9
+ * @Author wangqiong
10
+ * @Date 2023/10/09 15:18
11
+ * @Version V1.0
12
+ **/
13
+@Data
14
+public class CaseLogVO {
15
+    /**日志id*/
16
+    private String logId;
17
+    /**操作人id*/
18
+    private String operatorId;
19
+    /**操作人名称*/
20
+    private String operatorName;
21
+    /**操作人ip*/
22
+    private String ip;
23
+    /**操作时间*/
24
+    private Date operateTime;
25
+    /**操作明细*/
26
+    private String operateDetail;
27
+    /**操作类型*/
28
+    private String operateType;
29
+}

+ 16
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/LogisticsInfoVO.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo;
2
+
3
+import lombok.Data;
4
+
5
+@Data
6
+public class LogisticsInfoVO {
7
+    /**
8
+     * 案件关联人身份类型
9
+     */
10
+    private Integer identityType;
11
+
12
+    /**
13
+     * 物流信息
14
+     */
15
+    private String logisticsInfo;
16
+}

+ 9
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java Ver arquivo

@@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.mapper;
2 2
 
3 3
 import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
4 4
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
5
+import org.apache.ibatis.annotations.Param;
5 6
 
6 7
 import java.util.List;
7 8
 
@@ -22,4 +23,12 @@ public interface CaseApplicationMapper {
22 23
     CaseApplication selectCaseApplication(CaseApplication caseApplication);
23 24
 
24 25
     CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication);
26
+
27
+    /**
28
+     * 查询最大编号
29
+     * @param caseNum
30
+     * @param length
31
+     * @return
32
+     */
33
+    Integer selectCaseNumLike(@Param("caseNum") String caseNum, @Param("length") int length);
25 34
 }

+ 8
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java Ver arquivo

@@ -8,5 +8,12 @@ public interface IAdjudicationService {
8 8
 
9 9
     AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail ,String apptrackingNum,String restrackingNum);
10 10
 
11
-    AjaxResult getLogisticsInfo(String trackingNum,Integer phoneLastFour);
11
+    AjaxResult getLogisticsInfo(CaseApplication caseApplication);
12
+
13
+    AjaxResult signature(CaseApplication caseApplication);
14
+
15
+    AjaxResult caseFile(CaseApplication caseApplication);
16
+
17
+    AjaxResult service(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum);
18
+
12 19
 }

+ 141
- 39
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Ver arquivo

@@ -1,16 +1,21 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.impl;
2 2
 
3
+import com.alibaba.fastjson.JSON;
4
+import com.alibaba.fastjson.JSONObject;
3 5
 import com.deepoove.poi.config.Configure;
4 6
 import com.ruoyi.common.constant.CaseApplicationConstants;
5 7
 import com.ruoyi.common.core.domain.AjaxResult;
6 8
 import com.ruoyi.common.utils.EmailOutUtil;
7 9
 import com.ruoyi.common.utils.WordUtil;
8 10
 import com.ruoyi.wisdomarbitrate.domain.*;
11
+import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
9 12
 import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper;
10 13
 import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
11 14
 import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
12 15
 import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
13 16
 import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
17
+import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
18
+import lombok.extern.slf4j.Slf4j;
14 19
 import org.apache.poi.xwpf.usermodel.*;
15 20
 import org.springframework.beans.factory.annotation.Autowired;
16 21
 import org.springframework.mail.MailSendException;
@@ -31,6 +36,7 @@ import java.time.format.DateTimeFormatter;
31 36
 import java.util.*;
32 37
 
33 38
 @Service
39
+@Slf4j
34 40
 public class AdjudicationServiceImpl implements IAdjudicationService {
35 41
     private final String apiUrl = "http://api.cainiaoapi.com/api/exp/v1/index";
36 42
 
@@ -44,6 +50,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
44 50
     private CaseAttachMapper caseAttachMapper;
45 51
     @Autowired
46 52
     private EmailOutUtil emailOutUtil;
53
+    @Autowired
54
+    private ICaseApplicationService caseApplicationService;
47 55
 
48 56
     @Override
49 57
     public AjaxResult createDocument(CaseApplication caseApplication) {
@@ -123,14 +131,18 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
123 131
                 datas.put("arbitratorName2", secondName);
124 132
             }
125 133
             LocalDate now = LocalDate.now();
126
-            datas.put("year", now.getYear());
127
-            datas.put("months", now.getMonthValue());
128
-            datas.put("day", now.getDayOfMonth());
134
+            String year = Integer.toString(now.getYear());
135
+            String month = String.format("%02d", now.getMonthValue());
136
+            String day = String.format("%02d", now.getDayOfMonth());
137
+            datas.put("year", year);
138
+            datas.put("months", month);
139
+            datas.put("day", day);
129 140
             String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
130 141
             //String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
131
-            String saveFolderPath = "/data/arbitrate-document/formal/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
142
+            String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
132 143
             //String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
133 144
             String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
145
+            String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
134 146
             String resultFilePath = saveFolderPath + "/" + fileName;
135 147
             // 创建日期目录
136 148
             File saveFolder = new File(saveFolderPath);
@@ -141,14 +153,15 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
141 153
             Path destinationPath = new File(resultFilePath).toPath();
142 154
             Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
143 155
             String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
156
+            String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
144 157
             //修改案件状态
145 158
             caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
146 159
             caseApplicationMapper.submitCaseApplication(caseApplication1);
147 160
             //将裁决书保存到附件表里
148 161
             CaseAttach caseAttach = CaseAttach.builder()
149 162
                     .caseAppliId(id)
150
-                    .annexName(fileName)
151
-                    .annexPath(docFilePath)
163
+                    .annexName(saveName)
164
+                    .annexPath(savePath)
152 165
                     .annexType(3)
153 166
                     .build();
154 167
             int i = caseAttachMapper.save(caseAttach);
@@ -169,7 +182,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
169 182
 
170 183
     @Override
171 184
     @Transactional
172
-    public AjaxResult sendDocumentByEmail(Long id, String appEmail, String resEmail ,String apptrackingNum,String restrackingNum) {
185
+    public AjaxResult sendDocumentByEmail(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum) {
173 186
         CaseApplication caseApplication = new CaseApplication();
174 187
         caseApplication.setId(id);
175 188
         CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
@@ -180,16 +193,21 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
180 193
         //根据案件id查询裁决书
181 194
         try {
182 195
             List<File> fileList = new ArrayList<>();
183
-            List<CaseAttach> caseAttachList = caseAttachMapper.queryAnnexPathByCaseId(id);
196
+            CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication);
197
+            List<CaseAttach> caseAttachList = caseApplication2.getCaseAttachList();
184 198
             if (caseAttachList != null && caseAttachList.size() > 0) {
185 199
                 for (CaseAttach caseAttach : caseAttachList) {
186 200
                     if (caseAttach.getAnnexType() == 3) {
187 201
                         String annexPath = caseAttach.getAnnexPath();
188
-                        fileList.add(new File(annexPath));
202
+                        //File file = new File("/home/ruoyi/" + annexPath);
203
+                        String path = "/home/ruoyi/" + annexPath;
204
+                        File file = new File(path);
205
+                        System.out.println("文件是:" + file);
206
+                        fileList.add(file);
189 207
                     }
190 208
                 }
191 209
             }
192
-            if (fileList.size()<1){
210
+            if (fileList.size() < 1) {
193 211
                 return AjaxResult.error("未查询到裁决书");
194 212
             }
195 213
             File file = fileList.get(0);
@@ -210,13 +228,13 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
210 228
             CaseAffiliate caseAffiliate = new CaseAffiliate();
211 229
             caseAffiliate.setCaseAppliId(id);
212 230
             List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
213
-            if (caseAffiliates!=null&&caseAffiliates.size()>0){
231
+            if (caseAffiliates != null && caseAffiliates.size() > 0) {
214 232
                 for (CaseAffiliate affiliate : caseAffiliates) {
215
-                    if (affiliate.getIdentityType() == 1){  //申请人
233
+                    if (affiliate.getIdentityType() == 1) {  //申请人
216 234
                         affiliate.setSendEmail(appEmail);
217 235
                         affiliate.setTrackNum(apptrackingNum);
218 236
                         caseAffiliateMapper.updataCaseAffiliate(affiliate);
219
-                    }else {
237
+                    } else {
220 238
                         affiliate.setSendEmail(resEmail);
221 239
                         affiliate.setTrackNum(restrackingNum);
222 240
                         caseAffiliateMapper.updataCaseAffiliate(affiliate);
@@ -230,40 +248,124 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
230 248
     }
231 249
 
232 250
     @Override
233
-    public AjaxResult getLogisticsInfo(String trackingNum, Integer phoneLastFour) {
251
+    public AjaxResult getLogisticsInfo(CaseApplication caseApplication) {
234 252
         try {
235 253
             //快递单号查询
236
-            String key = "70ba5c7b327f71fccd5924f70e3e7b7f";
254
+            String key = "729437f92468910aee6c12dbfeaee3c1";
237 255
             String com = "auto";
238
-            // 构造查询字符串参数
239
-            String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d",
240
-                    URLEncoder.encode(key, "UTF-8"),
241
-                    URLEncoder.encode(com, "UTF-8"),
242
-                    URLEncoder.encode(trackingNum, "UTF-8"),
243
-                    phoneLastFour);
244
-            // 拼接到API URL中
245
-            String fullUrl = apiUrl + "?" + queryParameters;
246
-            URL url = new URL(fullUrl);
247
-            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
248
-            connection.setRequestMethod("GET");
249
-            int responseCode = connection.getResponseCode();
250
-            if (responseCode == HttpURLConnection.HTTP_OK) {
251
-                BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
252
-                String line;
253
-                StringBuilder response = new StringBuilder();
254
-                while ((line = reader.readLine()) != null) {
255
-                    response.append(line);
256
+            //根据案件id查询单号信息
257
+            CaseAffiliate caseAffiliate = new CaseAffiliate();
258
+            caseAffiliate.setCaseAppliId(caseApplication.getId());
259
+            List<LogisticsInfoVO> logisticsInfoVOList = new ArrayList<>();
260
+            List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
261
+            if (caseAffiliates != null && caseAffiliates.size() > 0) {
262
+                for (CaseAffiliate affiliate : caseAffiliates) {
263
+                    LogisticsInfoVO logisticsInfoVO = new LogisticsInfoVO();
264
+                    String trackNum = affiliate.getTrackNum();
265
+                    if (trackNum != null) {
266
+                        // 构造查询字符串参数
267
+                        String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d",
268
+                                URLEncoder.encode(key, "UTF-8"),
269
+                                URLEncoder.encode(com, "UTF-8"),
270
+                                URLEncoder.encode(trackNum, "UTF-8"), null);
271
+                        // 拼接到API URL中
272
+                        String fullUrl = apiUrl + "?" + queryParameters;
273
+                        URL url = new URL(fullUrl);
274
+                        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
275
+                        connection.setRequestMethod("GET");
276
+                        int responseCode = connection.getResponseCode();
277
+                        if (responseCode == HttpURLConnection.HTTP_OK) {
278
+                            BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
279
+                            String line;
280
+                            StringBuilder response = new StringBuilder();
281
+                            while ((line = reader.readLine()) != null) {
282
+                                response.append(line);
283
+                            }
284
+                            reader.close();
285
+                            // 处理返回的响应数据\
286
+                            JSONObject jsonObject = JSON.parseObject(response.toString());
287
+                            // 提取 "data" 字段并转换为字符串
288
+                            String data = jsonObject.getString("data");
289
+                            if (data != null) {
290
+                                logisticsInfoVO.setIdentityType(affiliate.getIdentityType());
291
+                                logisticsInfoVO.setLogisticsInfo(data);
292
+                                logisticsInfoVOList.add(logisticsInfoVO);
293
+                            }
294
+                        } else {
295
+                            // 请求失败
296
+                            return AjaxResult.error("请求失败,错误码:" + responseCode);
297
+                        }
298
+                    }
256 299
                 }
257
-                reader.close();
258
-                // 处理返回的响应数据
259
-                return AjaxResult.success(response);
260
-            } else {
261
-                // 请求失败
262
-                return AjaxResult.error("请求失败,错误码:" + responseCode);
300
+                return AjaxResult.success(logisticsInfoVOList);
263 301
             }
264 302
         } catch (IOException e) {
265 303
             e.printStackTrace();
266 304
         }
267 305
         return null;
268 306
     }
307
+
308
+    @Override
309
+    public AjaxResult signature(CaseApplication caseApplication) {
310
+        //更改案件状态(暂时)
311
+        caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
312
+        caseApplicationMapper.submitCaseApplication(caseApplication);
313
+        return AjaxResult.success("签名成功,案件状态已改为待仲裁文书用印");
314
+    }
315
+
316
+    @Override
317
+    public AjaxResult caseFile(CaseApplication caseApplication) {
318
+        //更改案件状态(暂时)
319
+        caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED);
320
+        caseApplicationMapper.submitCaseApplication(caseApplication);
321
+        return AjaxResult.success("归档成功,案件状态已改为已归档");
322
+    }
323
+
324
+    @Override
325
+    public AjaxResult service(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum) {
326
+        CaseApplication caseApplication = new CaseApplication();
327
+        caseApplication.setId(id);
328
+        CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
329
+        if (caseApplication1 == null) {
330
+            return AjaxResult.error("未查询到相关案件");
331
+        }
332
+        //修改案件状态
333
+        caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
334
+        caseApplicationMapper.submitCaseApplication(caseApplication1);
335
+        //保存邮箱信息和快递单号到关联人表
336
+        CaseAffiliate caseAffiliate = new CaseAffiliate();
337
+        caseAffiliate.setCaseAppliId(id);
338
+        List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
339
+        if (caseAffiliates != null && caseAffiliates.size() > 0) {
340
+            for (CaseAffiliate affiliate : caseAffiliates) {
341
+                if (affiliate.getIdentityType() == 1) {  //申请人
342
+                    affiliate.setSendEmail(appEmail);
343
+                    affiliate.setTrackNum(apptrackingNum);
344
+                    caseAffiliateMapper.updataCaseAffiliate(affiliate);
345
+                } else {
346
+                    affiliate.setSendEmail(resEmail);
347
+                    affiliate.setTrackNum(restrackingNum);
348
+                    caseAffiliateMapper.updataCaseAffiliate(affiliate);
349
+                }
350
+            }
351
+        }
352
+        return AjaxResult.success("仲裁文书送达成功");
353
+    }
354
+
355
+    public static void main(String[] args) {
356
+        try {
357
+            List<File> fileList = new ArrayList<>();
358
+            fileList.add(new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\b442880179844a848f1f8b08c29e3d0c.docx"));
359
+            File file = fileList.get(0);
360
+            //电子邮件送达
361
+            EmailOutUtil emailOutUtil = new EmailOutUtil();
362
+            JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender();
363
+            if (javaMailSender != null) {
364
+                emailOutUtil.sendMessageCarryFile("1154956315@qq.com", "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
365
+                        , "hjbjava@163.com", javaMailSender);
366
+            }
367
+        } catch (MailSendException e) {
368
+            e.printStackTrace();
369
+        }
370
+    }
269 371
 }

+ 113
- 34
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Ver arquivo

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.impl;
2 2
 
3
+
3 4
 import com.ruoyi.common.constant.CaseApplicationConstants;
4 5
 import com.ruoyi.common.exception.ServiceException;
5 6
 import com.ruoyi.common.utils.DateUtils;
@@ -12,16 +13,11 @@ import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
12 13
 import org.springframework.beans.factory.annotation.Autowired;
13 14
 import org.springframework.stereotype.Service;
14 15
 import org.springframework.transaction.annotation.Transactional;
15
-
16
-import java.lang.reflect.Field;
17 16
 import java.math.BigDecimal;
18 17
 import java.text.SimpleDateFormat;
19 18
 import java.util.*;
20 19
 import java.util.stream.Collectors;
21 20
 
22
-import static com.ruoyi.common.core.domain.AjaxResult.error;
23
-import static java.util.stream.Collectors.collectingAndThen;
24
-import static java.util.stream.Collectors.toCollection;
25 21
 
26 22
 @Service
27 23
 public class CaseApplicationServiceImpl implements ICaseApplicationService {
@@ -58,7 +54,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
58 54
         BigDecimal feeRate = new BigDecimal(0.01);
59 55
         BigDecimal feePayable  = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP);
60 56
         caseApplication.setFeePayable(feePayable);
61
-
57
+        // 获取自动编码
62 58
         String caseNum = generateCaseNum();
63 59
         caseApplication.setCaseNum(caseNum);
64 60
 
@@ -83,15 +79,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
83 79
         return rows;
84 80
     }
85 81
 
82
+    /**
83
+     * 获取自动编码
84
+     * @return
85
+     */
86
+
86 87
     private String generateCaseNum() {
87
-        String currentday = DateUtils.dateTime();
88
-        String caseNum = "zc"+ currentday;
89
-        //查询出当天的案件编号的最大值 ,如等于1
90
-        Integer caseNumMax = 1;
91
-        if(caseNumMax!=null){
92
-            //根据查询到的caseNumMax拼接一个案件编号
88
+        // 自动编码格式 zc+yyyyMMdd+001
89
+        String currentDay = DateUtils.dateTime();
90
+        String caseNum = "zc"+ currentDay;
91
+        //查询出当天的案件编号的最大值
92
+            Integer maxCaseNum =  caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length());
93
+        if(null == maxCaseNum){
94
+            caseNum = caseNum + "001";
93 95
         }else {
94
-            caseNum += "001";
96
+            caseNum = caseNum + String.format("%03d", maxCaseNum);
95 97
         }
96 98
         return caseNum;
97 99
 
@@ -105,13 +107,28 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
105 107
     @Override
106 108
     @Transactional
107 109
     public int editCaseApplication(CaseApplication caseApplication) {
110
+        //根据仲裁费用计费规则计算应缴费用
111
+        //暂时设置计费比率为0.01
112
+        BigDecimal feeRate = new BigDecimal(0.01);
113
+        BigDecimal feePayable  = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP);
114
+        caseApplication.setFeePayable(feePayable);
115
+
108 116
         int rows = caseApplicationMapper.updataCaseApplication(caseApplication);
109 117
         List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
110 118
         if(caseAffiliates!=null&&caseAffiliates.size()>0){
111 119
             for (CaseAffiliate caseAffiliate : caseAffiliates){
120
+                caseAffiliate.setCaseAppliId(caseApplication.getId());
112 121
                 caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
113 122
             }
114 123
         }
124
+        List<CaseAttach> caseAttachList = caseApplication.getCaseAttachList();
125
+        if(caseAttachList!=null&&caseAttachList.size()>0){
126
+            for (CaseAttach caseAttach : caseAttachList){
127
+                caseAttach.setCaseAppliId(caseApplication.getId());
128
+                caseAttachMapper.updateCaseAttach(caseAttach);
129
+            }
130
+
131
+        }
115 132
 
116 133
         return rows;
117 134
     }
@@ -191,38 +208,49 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
191 208
     @Override
192 209
     @Transactional
193 210
     public String importCaseApplication(List<CaseApplication> caseApplicationList,  String operName) {
194
-        StringBuilder successMsg = new StringBuilder();
195 211
         StringBuilder failureMsg = new StringBuilder();
212
+        StringBuilder successMsg = new StringBuilder();
196 213
         int successNum = 0;
197 214
         int failureNum = 0;
198 215
         if(caseApplicationList!=null&&caseApplicationList.size()>0){
199 216
             List<CaseApplication> caseApplicationListinsert = new ArrayList<>();
200 217
             for (int i = 0; i < caseApplicationList.size(); i++){
201 218
                 CaseApplication caseApplication = caseApplicationList.get(i);
219
+                //根据仲裁费用计费规则计算应缴费用
220
+                //暂时设置计费比率为0.01
221
+                BigDecimal feeRate = new BigDecimal(0.01);
222
+                BigDecimal feePayable  = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP);
223
+                caseApplication.setFeePayable(feePayable);
224
+
202 225
                 //赋值CaseApplication的案件关联人信息
203 226
                 List<CaseAffiliate> caseAffiliatesnew  = new ArrayList<>();
204 227
                 assignmentCaseAffiliates(caseApplication,caseAffiliatesnew);
205 228
 
206
-                int caseApplicationCount = selectCaseApplicationCount(caseApplication);
207
-                if(caseApplicationCount>0){
208
-                    failureNum++;
209
-                    failureMsg.append("<br/>" + failureNum + "、立案编号 " + caseApplication.getCaseNum() + " 已存在");
210
-                }else {
211
-                    caseApplicationListinsert.add(caseApplication);
212
-                }
229
+//                int caseApplicationCount = selectCaseApplicationCount(caseApplication);
230
+//                if(caseApplicationCount>0){
231
+//                    failureNum++;
232
+//                    failureMsg.append("<br/>" + failureNum + "、立案编号 " + caseApplication.getCaseNum() + " 已存在");
233
+//                }else {
234
+//                    caseApplicationListinsert.add(caseApplication);
235
+//                }
236
+                caseApplicationListinsert.add(caseApplication);
213 237
             }
238
+
214 239
             if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){
215
-                List<CaseApplication> caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect(
216
-                        collectingAndThen(
217
-                                toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))),
218
-                                ArrayList::new));
240
+//                List<CaseApplication> caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect(
241
+//                        collectingAndThen(
242
+//                                toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))),
243
+//                                ArrayList::new));
219 244
 
220 245
 
221 246
                 //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息
222
-                if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){
223
-                    List<CaseApplication> caseApplicationNewList = new ArrayList<>();
224
-                    for (int i = 0; i < caseApplicationListinsertDiffer.size(); i++){
225
-                        CaseApplication caseApplicationinsertDiffer = caseApplicationListinsertDiffer.get(i);
247
+//                if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){
248
+                    List<CaseApplication> caseApplicationNewList = null;
249
+                    for (int i = 0; i < caseApplicationListinsert.size(); i++){
250
+                        caseApplicationNewList = new ArrayList<>();
251
+                        CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i);
252
+                        // 设置自动编码
253
+                        caseApplicationinsertDiffer.setCaseNum(generateCaseNum());
226 254
                         List<CaseAffiliate> caseAffiliatesnew =  new ArrayList<>();
227 255
                         CaseApplication caseApplicationNew = new CaseApplication();
228 256
                         copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew);
@@ -244,6 +272,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
244 272
                             CaseApplication caseApplicationItera = caseApplicationNewList.get(k);
245 273
                             // 新增立案信息
246 274
                             caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
275
+
247 276
                             int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera);
248 277
                             List<CaseAffiliate> caseAffiliates = caseApplicationItera.getCaseAffiliates();
249 278
                             if(caseAffiliates!=null&&caseAffiliates.size()>0){
@@ -256,7 +285,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
256 285
                             successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
257 286
                         }
258 287
 
259
-                    }
288
+//                    }
260 289
 
261 290
                 }
262 291
 
@@ -265,8 +294,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
265 294
         }else {
266 295
             throw new ServiceException("导入立案申请数据不能为空!");
267 296
         }
297
+        // 编号存在不导入
298
+        if(StringUtils.isNotEmpty(failureMsg)){
299
+            return failureMsg.append(successMsg).toString();
300
+        }else {
268 301
 
269
-        return  successMsg.toString();
302
+            return successMsg.toString();
303
+        }
270 304
     }
271 305
 
272 306
     @Override
@@ -362,7 +396,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
362 396
     @Override
363 397
     public CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication) {
364 398
         CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplicationConfirm(caseApplication);
399
+        CaseAffiliate caseAffiliate = new CaseAffiliate();
400
+        caseAffiliate.setCaseAppliId(caseApplication.getId());
401
+        List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
402
+        if(caseAffiliatListeselect!=null){
403
+            StringBuffer applicantName = new StringBuffer();
404
+            for (int i = 0; i < caseAffiliatListeselect.size(); i++){
405
+                CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
406
+                int identityType = caseAffiliateselect.getIdentityType();
407
+                if(identityType==1){
408
+                    applicantName.append(caseAffiliateselect.getName()).append(",");;
409
+                }
410
+            }
411
+            caseApplicationselect.setApplicantName(applicantName.toString());
412
+
365 413
 
414
+        }
366 415
         return caseApplicationselect;
367 416
     }
368 417
 
@@ -374,7 +423,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
374 423
 
375 424
         //发送短信通知
376 425
         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
377
-        request.setTemplateId("1931000");
426
+        request.setTemplateId("1947342");
378 427
 
379 428
         CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
380 429
         String caseNum = caseApplicationselect.getCaseNum();
@@ -398,7 +447,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
398 447
                     Arbitrator arbitratorselect = arbitratorList.get(i);
399 448
                     //给仲裁员发送短信通知
400 449
                     request.setPhone(arbitratorselect.getTelephone());
401
-                    // 1931000 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
450
+                    // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
402 451
                     String name = arbitratorselect.getArbitratorName();
403 452
                     request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
404 453
                     SmsUtils.sendSms(request);
@@ -415,7 +464,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
415 464
                 int identityType = caseAffiliateselect.getIdentityType();
416 465
                 //给申请人、被申请人发送短信通知
417 466
                 request.setPhone(caseAffiliateselect.getContactTelphone());
418
-                // 1931000 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
467
+                // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
419 468
                 String name = caseAffiliateselect.getName();
420 469
                 request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
421 470
                 SmsUtils.sendSms(request);
@@ -462,12 +511,41 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
462 511
 
463 512
     private void assignmentCaseAffiliates(CaseApplication caseApplication, List<CaseAffiliate> caseAffiliatesnew) {
464 513
         CaseAffiliate caseAffiliate = new CaseAffiliate();
514
+
465 515
 //        BeanUtils.copyBeanProp(caseApplication,caseAffiliate);
466 516
         BeanUtils.copyBeanProp(caseAffiliate,caseApplication);
517
+        caseAffiliate.setIdentityType(1);
467 518
         caseAffiliatesnew.add(caseAffiliate);
519
+
520
+        // 组装被申请人信息
521
+        caseAffiliatesnew.add( buildDebtorInfo(caseApplication));
468 522
         caseApplication.setCaseAffiliates(caseAffiliatesnew);
469 523
     }
470 524
 
525
+    /**
526
+     * 组装被申请人信息
527
+     * @param caseApplication
528
+     * @return
529
+     */
530
+
531
+    private CaseAffiliate buildDebtorInfo(CaseApplication caseApplication) {
532
+        // 被申请人信息
533
+        CaseAffiliate debtorCaseAffiliate = new CaseAffiliate();
534
+        debtorCaseAffiliate.setCaseAppliId(caseApplication.getId());
535
+        debtorCaseAffiliate.setIdentityType(2);
536
+        debtorCaseAffiliate.setName(caseApplication.getDebtorName());
537
+        debtorCaseAffiliate.setIdentityNum(caseApplication.getDebtorIdentityNum());
538
+        debtorCaseAffiliate.setContactTelphone(caseApplication.getDebtorContactTelphone());
539
+        debtorCaseAffiliate.setContactAddress(caseApplication.getDebtorContactAddress());
540
+        debtorCaseAffiliate.setWorkTelphone(caseApplication.getDebtorWorkTelphone());
541
+        debtorCaseAffiliate.setWorkAddress(caseApplication.getDebtorWorkAddress());
542
+        debtorCaseAffiliate.setNameAgent(caseApplication.getDebtorNameAgent());
543
+        debtorCaseAffiliate.setIdentityNumAgent(caseApplication.getDebtorIdentityNumAgent());
544
+        debtorCaseAffiliate.setContactTelphoneAgent(caseApplication.getDebtorContactTelphoneAgent());
545
+        debtorCaseAffiliate.setContactAddressAgent(caseApplication.getDebtorContactAddressAgent());
546
+        return debtorCaseAffiliate;
547
+    }
548
+
471 549
     private void copyCaseApplication(CaseApplication caseApplicationinsertDiffer, CaseApplication caseApplicationNew) {
472 550
         caseApplicationNew.setArbitratClaims(caseApplicationinsertDiffer.getArbitratClaims());
473 551
         caseApplicationNew.setCaseNum(caseApplicationinsertDiffer.getCaseNum());
@@ -478,6 +556,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
478 556
         caseApplicationNew.setClaimInterestOwed(caseApplicationinsertDiffer.getClaimInterestOwed());
479 557
         caseApplicationNew.setClaimPrinciOwed(caseApplicationinsertDiffer.getClaimPrinciOwed());
480 558
         caseApplicationNew.setClaimLiquidDamag(caseApplicationinsertDiffer.getClaimLiquidDamag());
559
+        caseApplicationNew.setFeePayable(caseApplicationinsertDiffer.getFeePayable());
481 560
     }
482 561
 
483 562
 

+ 4
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml Ver arquivo

@@ -18,12 +18,14 @@
18 18
         <result property="identityNumAgent"      column="identity_num_agent"     />
19 19
         <result property="contactTelphoneAgent"      column="contact_telphone_agent"     />
20 20
         <result property="contactAddressAgent"    column="contact_address_agent"   />
21
+        <result property="trackNum"    column="track_num"   />
21 22
 
22 23
     </resultMap>
23 24
 
24 25
     <select id="selectCaseAffiliate" parameterType="CaseAffiliate" resultMap="CaseAffiliateResult">
25 26
         select c.id ,c.case_appli_id ,c.identity_type ,c.name ,c.identity_num ,c.contact_telphone ,c.contact_address ,
26
-        c.work_address ,c.work_telphone ,c.name_agent, c.identity_num_agent ,c.contact_telphone_agent ,c.contact_address_agent
27
+        c.work_address ,c.work_telphone ,c.name_agent, c.identity_num_agent ,c.contact_telphone_agent ,c.contact_address_agent,
28
+        c.track_num
27 29
         from case_affiliate c
28 30
         <where>
29 31
             <if test="caseAppliId != null ">
@@ -49,6 +51,7 @@
49 51
     <update id="updataCaseAffiliate" parameterType="CaseAffiliate">
50 52
         update case_affiliate
51 53
         set
54
+        case_appli_id=#{caseAppliId},
52 55
         identity_type= #{identityType},
53 56
         name = #{name},
54 57
         identity_num = #{identityNum},

+ 5
- 4
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Ver arquivo

@@ -71,7 +71,7 @@
71 71
                 </foreach>
72 72
             </if>
73 73
         </where>
74
-        order by c.create_time desc
74
+        order by c.create_time desc,c.case_num desc
75 75
     </select>
76 76
 
77 77
     <select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">
@@ -237,9 +237,10 @@
237 237
             AND c.id = #{id}
238 238
 
239 239
     </select>
240
-
241
-
242
-
240
+    <select id="selectCaseNumLike" resultType="java.lang.Integer">
241
+        select max(substring(case_num, #{length}+1,12)+1) as maxCaseNum
242
+        from case_application where case_num like CONCAT(#{caseNum},'%') ;
243
+    </select>
243 244
 
244 245
 
245 246
 </mapper>