hejinbo 2 anni fa
parent
commit
80e9814cd6

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

@@ -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
 }

+ 18
- 10
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Vedi File

@@ -11,6 +11,7 @@ import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
11 11
 import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
12 12
 import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
13 13
 import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
14
+import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
14 15
 import org.apache.poi.xwpf.usermodel.*;
15 16
 import org.springframework.beans.factory.annotation.Autowired;
16 17
 import org.springframework.mail.MailSendException;
@@ -44,7 +45,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
44 45
     private CaseAttachMapper caseAttachMapper;
45 46
     @Autowired
46 47
     private EmailOutUtil emailOutUtil;
47
-
48
+    @Autowired
49
+    private ICaseApplicationService caseApplicationService;
48 50
     @Override
49 51
     public AjaxResult createDocument(CaseApplication caseApplication) {
50 52
         try {
@@ -123,14 +125,18 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
123 125
                 datas.put("arbitratorName2", secondName);
124 126
             }
125 127
             LocalDate now = LocalDate.now();
126
-            datas.put("year", now.getYear());
127
-            datas.put("months", now.getMonthValue());
128
-            datas.put("day", now.getDayOfMonth());
128
+            String year = Integer.toString(now.getYear());
129
+            String month = String.format("%02d", now.getMonthValue());
130
+            String day = String.format("%02d", now.getDayOfMonth());
131
+            datas.put("year", year);
132
+            datas.put("months", month);
133
+            datas.put("day", day);
129 134
             String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
130 135
             //String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
131
-            String saveFolderPath = "/data/arbitrate-document/formal/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
136
+            String saveFolderPath = "/home/ruoyi/uploadPath/upload/" +year + "/" + month + "/" + day;
132 137
             //String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
133 138
             String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
139
+            String saveName = "/profile/upload/"+year + "/" + month + "/" + day +"/" +fileName;
134 140
             String resultFilePath = saveFolderPath + "/" + fileName;
135 141
             // 创建日期目录
136 142
             File saveFolder = new File(saveFolderPath);
@@ -141,14 +147,15 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
141 147
             Path destinationPath = new File(resultFilePath).toPath();
142 148
             Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
143 149
             String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
150
+            String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
144 151
             //修改案件状态
145 152
             caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
146 153
             caseApplicationMapper.submitCaseApplication(caseApplication1);
147 154
             //将裁决书保存到附件表里
148 155
             CaseAttach caseAttach = CaseAttach.builder()
149 156
                     .caseAppliId(id)
150
-                    .annexName(fileName)
151
-                    .annexPath(docFilePath)
157
+                    .annexName(saveName)
158
+                    .annexPath(savePath)
152 159
                     .annexType(3)
153 160
                     .build();
154 161
             int i = caseAttachMapper.save(caseAttach);
@@ -180,10 +187,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
180 187
         //根据案件id查询裁决书
181 188
         try {
182 189
             List<File> fileList = new ArrayList<>();
183
-            List<CaseAttach> caseAttachList = caseAttachMapper.queryAnnexPathByCaseId(id);
184
-            if (caseAttachList != null && caseAttachList.size() > 0) {
190
+            CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication);
191
+            List<CaseAttach> caseAttachList = caseApplication2.getCaseAttachList();
192
+            if (caseAttachList!=null&& caseAttachList.size()>0){
185 193
                 for (CaseAttach caseAttach : caseAttachList) {
186
-                    if (caseAttach.getAnnexType() == 3) {
194
+                    if (caseAttach.getAnnexType() == 3){
187 195
                         String annexPath = caseAttach.getAnnexPath();
188 196
                         fileList.add(new File(annexPath));
189 197
                     }