hejinbo 2 лет назад
Родитель
Сommit
80e9814cd6

+ 2
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bestsign/RegisterController.java Просмотреть файл

26
     public AjaxResult createDocument(@Validated @RequestBody PersonRegisterVO personRegisterVO) {
26
     public AjaxResult createDocument(@Validated @RequestBody PersonRegisterVO personRegisterVO) {
27
         return signRegisterService.registerPerson(personRegisterVO);
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 Просмотреть файл

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