hejinbo 2 vuotta sitten
vanhempi
commit
b4549fa2cc

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java Näytä tiedosto

@@ -26,7 +26,7 @@ public class ArbitrateRecord     extends BaseEntity {
26 26
     /** 审核裁决书意见 */
27 27
     private String checkOpinion;
28 28
     /** 裁决书附件id */
29
-    private Long annexId;
29
+    private Integer annexId;
30 30
 
31 31
 
32 32
 

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java Näytä tiedosto

@@ -9,7 +9,7 @@ import lombok.NoArgsConstructor;
9 9
 @Builder
10 10
 @AllArgsConstructor
11 11
 @NoArgsConstructor
12
-public class CaseAttach {
12
+public class  CaseAttach {
13 13
     /**
14 14
      *  附件id
15 15
      */

+ 73
- 50
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Näytä tiedosto

@@ -3,24 +3,23 @@ package com.ruoyi.wisdomarbitrate.service.impl;
3 3
 import com.deepoove.poi.config.Configure;
4 4
 import com.ruoyi.common.core.domain.AjaxResult;
5 5
 import com.ruoyi.common.utils.WordUtil;
6
-import com.ruoyi.wisdomarbitrate.domain.Adjudication;
7
-import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
8
-import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
9
-import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
6
+import com.ruoyi.wisdomarbitrate.domain.*;
10 7
 import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper;
11 8
 import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
12 9
 import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
10
+import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
13 11
 import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
14 12
 import org.apache.poi.xwpf.usermodel.*;
15 13
 import org.springframework.beans.factory.annotation.Autowired;
16 14
 import org.springframework.stereotype.Service;
17 15
 
18
-import java.io.FileInputStream;
19
-import java.io.FileOutputStream;
20
-import java.io.IOException;
21
-import java.io.InputStream;
16
+import java.io.*;
17
+import java.nio.file.Files;
18
+import java.nio.file.Path;
19
+import java.nio.file.StandardCopyOption;
22 20
 import java.time.LocalDate;
23 21
 import java.time.ZoneId;
22
+import java.time.format.DateTimeFormatter;
24 23
 import java.util.*;
25 24
 
26 25
 @Service
@@ -31,6 +30,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
31 30
     private CaseAffiliateMapper caseAffiliateMapper;
32 31
     @Autowired
33 32
     private ArbitrateRecordMapper arbitrateRecordMapper;
33
+    @Autowired
34
+    private CaseAttachMapper caseAttachMapper;
34 35
 
35 36
     @Override
36 37
     public AjaxResult createDocument(CaseApplication caseApplication) {
@@ -57,67 +58,89 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
57 58
                     //获取身份类型
58 59
                     int identityType = affiliate.getIdentityType();
59 60
                     if (identityType == 1) {    //申请人
60
-                        datas.put(adjudication.getAppName(), affiliate.getName());
61
-                        datas.put(adjudication.getAppSex(), null);
62
-                        datas.put(adjudication.getAppIDNo(), affiliate.getIdentityNum());
63
-                        datas.put(adjudication.getAppAddress(), affiliate.getContactAddress());
64
-                        datas.put(adjudication.getAppAgentName(), affiliate.getNameAgent());
65
-                        datas.put(adjudication.getAppAgentIDNo(),affiliate.getIdentityNumAgent());
61
+                        datas.put("appName", affiliate.getName());
62
+                        datas.put("appSex", null);
63
+                        datas.put("appIDNo", affiliate.getIdentityNum());
64
+                        datas.put("appAddress", affiliate.getContactAddress());
65
+                        datas.put("appAgentName", affiliate.getNameAgent());
66
+                        datas.put("appAgentIDNo",affiliate.getIdentityNumAgent());
66 67
                     }else if (identityType == 2){  //被申请人
67
-                        datas.put(adjudication.getResName(), affiliate.getName());
68
-                        datas.put(adjudication.getResSex(), null);
69
-                        datas.put(adjudication.getResIDNo(), affiliate.getIdentityNum());
70
-                        datas.put(adjudication.getResAddress(), affiliate.getContactAddress());
71
-                        datas.put(adjudication.getResAgentName(), affiliate.getNameAgent());
72
-                        datas.put(adjudication.getResAgentName(),affiliate.getIdentityNumAgent());
68
+                        datas.put("resName", affiliate.getName());
69
+                        datas.put("resSex", null);
70
+                        datas.put("resIDNo", affiliate.getIdentityNum());
71
+                        datas.put("resAddress", affiliate.getContactAddress());
72
+                        datas.put("resAgentName", affiliate.getNameAgent());
73
+                        datas.put("resAgentIDNo",affiliate.getIdentityNumAgent());
73 74
                     }
74 75
                 }
75 76
             }
76 77
             String arbitratorName = caseApplication1.getArbitratorName();
77
-            datas.put(adjudication.getCaseName(),caseApplication1.getCaseName());
78
-            datas.put(adjudication.getArbitratorName(),arbitratorName);
78
+            datas.put("caseName",caseApplication1.getCaseName());
79
+            datas.put("arbitratorName",arbitratorName);
79 80
             LocalDate localDate = caseApplication1.getHearDate()
80 81
                     .toInstant()
81 82
                     .atZone(ZoneId.systemDefault())
82 83
                     .toLocalDate();
83
-            datas.put(adjudication.getHearYear(),  localDate.getYear());
84
-            datas.put(adjudication.getHearMonths(),  localDate.getMonthValue());
85
-            datas.put(adjudication.getHearDay(),  localDate.getDayOfMonth());
86
-            datas.put(adjudication.getAppArbitrationClaims(), null);
87
-            datas.put(adjudication.getAppEvidenceName(), null);
88
-            datas.put(adjudication.getAppProveFacts(), null);
89
-            datas.put(adjudication.getResDefenseContentToApp(), null);
90
-            datas.put(adjudication.getResArbitrationClaims(), null);
91
-            datas.put(adjudication.getResEvidenceName(), null);
92
-            datas.put(adjudication.getResProveFacts(), null);
93
-            datas.put(adjudication.getAppDefenseContentToRes(), null);
94
-            datas.put(adjudication.getEvidenDetermi(), arbitrateRecord1.getEvidenDetermi());
95
-            datas.put(adjudication.getFactDetermi(), arbitrateRecord1.getFactDetermi());
96
-            datas.put(adjudication.getCaseSketch(), arbitrateRecord1.getCaseSketch());
97
-            datas.put(adjudication.getArbitrateThink(), arbitrateRecord1.getArbitrateThink());
98
-            datas.put(adjudication.getLegalProvisions(), null);
99
-            datas.put(adjudication.getRulingFollows(), arbitrateRecord1.getRulingFollows());
100
-            datas.put(adjudication.getUmpire(), null);
84
+            datas.put("hearYear",  localDate.getYear());
85
+            datas.put("hearMonths",  localDate.getMonthValue());
86
+            datas.put("hearDay",  localDate.getDayOfMonth());
87
+            datas.put("appArbitrationClaims", null);
88
+            datas.put("appEvidenceName", null);
89
+            datas.put("appProveFacts", null);
90
+            datas.put("resDefenseContentToApp", null);
91
+            datas.put("resArbitrationClaims", null);
92
+            datas.put("resEvidenceName", null);
93
+            datas.put("resProveFacts", null);
94
+            datas.put("appDefenseContentToRes", null);
95
+            datas.put("evidenDetermi", arbitrateRecord1.getEvidenDetermi());
96
+            datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
97
+            datas.put("caseSketch", arbitrateRecord1.getCaseSketch());
98
+            datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink());
99
+            datas.put("legalProvisions", null);
100
+            datas.put("rulingFollows", arbitrateRecord1.getRulingFollows());
101
+            datas.put("umpire", null);
101 102
             if (arbitratorName.contains(",")){
102 103
                 String[] nameArray = arbitratorName.split(",");
103 104
                 String firstName = nameArray[0];
104 105
                 String secondName = nameArray[1];
105
-                datas.put(adjudication.getArbitratorName1(), firstName);
106
-                datas.put(adjudication.getArbitratorName2(), secondName);
106
+                datas.put("arbitratorName1", firstName);
107
+                datas.put("arbitratorName2", secondName);
107 108
             }else {
108 109
                 String secondName = "";
109
-                datas.put(adjudication.getArbitratorName1(), arbitratorName);
110
-                datas.put(adjudication.getArbitratorName2(), secondName);
110
+                datas.put("arbitratorName1", arbitratorName);
111
+                datas.put("arbitratorName2", secondName);
111 112
             }
112 113
             LocalDate now = LocalDate.now();
113
-            datas.put(adjudication.getYear(), now.getYear());
114
-            datas.put(adjudication.getMonths(), now.getMonthValue());
115
-            datas.put(adjudication.getDay(), now.getDayOfMonth());
116
-            datas.put(adjudication.getClerk(), null);
117
-            String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
114
+            datas.put("year", now.getYear());
115
+            datas.put("months", now.getMonthValue());
116
+            datas.put("day", now.getDayOfMonth());
117
+            datas.put("clerk", null);
118
+            String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
119
+
120
+            String currentDateStr = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
121
+            String saveFolderPath = "/data/arbitrate-document/formal/" + currentDateStr;
122
+            // 创建日期目录
123
+            File saveFolder = new File(saveFolderPath);
124
+            if (!saveFolder.exists()) {
125
+                saveFolder.mkdirs();
126
+            }
118 127
             String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
119
-            String resultFilePath = "D:/data/" + fileName;
128
+            String resultFilePath = saveFolderPath+ fileName;
120 129
             String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
130
+            //将裁决书保存到附件表里
131
+            CaseAttach caseAttach = CaseAttach.builder()
132
+                    .caseAppliId(id)
133
+                    .annexName(fileName)
134
+                    .annexPath(docFilePath)
135
+                    .annexType(3)
136
+                    .build();
137
+            int i = caseAttachMapper.save(caseAttach);
138
+            if (i>0){
139
+                Integer annexId = caseAttach.getAnnexId();
140
+                //将附件id保存到仲裁记录表里面
141
+                arbitrateRecord1.setAnnexId(annexId);
142
+                arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
143
+            }
121 144
             return AjaxResult.success("裁决书保存路径为" + docFilePath);
122 145
         } catch (IOException e) {
123 146
             e.printStackTrace();

+ 4
- 9
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java Näytä tiedosto

@@ -40,15 +40,10 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
40 40
         int arbitratMethod = caseApplication1.getArbitratMethod();
41 41
         String caseNum = caseApplication1.getCaseNum();
42 42
         if (opinion==0){   //拒绝
43
-            switch (arbitratMethod) {
44
-                case 1:
45
-                    caseApplication1.setArbitratMethod(2);  // 更改仲裁方式
46
-                    break;
47
-                case 2:
48
-                    caseApplication1.setArbitratMethod(1);
49
-                    break;
50
-                default:
51
-                    return AjaxResult.error();
43
+            if (arbitratMethod == 2){
44
+                caseApplication1.setArbitratMethod(1);  // 更改仲裁方式
45
+            }else {
46
+                caseApplication1.setArbitratMethod(2);
52 47
             }
53 48
         }
54 49
         //修改案件状态为待开庭

+ 1
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml Näytä tiedosto

@@ -13,7 +13,7 @@
13 13
         <result property="userId"     column="use_id"    />
14 14
         <result property="userName"     column="use_account"    />
15 15
     </resultMap>
16
-    <insert id="save">
16
+    <insert id="save" useGeneratedKeys="true" keyProperty="annexId">
17 17
         INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account)
18 18
         VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName})
19 19
     </insert>