|
|
@@ -1,5 +1,6 @@
|
|
1
|
1
|
package com.ruoyi.wisdomarbitrate.service.impl;
|
|
2
|
2
|
|
|
|
3
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
3
|
4
|
import com.ruoyi.common.config.RuoYiConfig;
|
|
4
|
5
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
5
|
6
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
@@ -21,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
21
|
22
|
import org.springframework.web.multipart.MultipartFile;
|
|
22
|
23
|
|
|
23
|
24
|
import java.io.IOException;
|
|
|
25
|
+import java.util.ArrayList;
|
|
24
|
26
|
import java.util.Arrays;
|
|
25
|
27
|
import java.util.List;
|
|
26
|
28
|
import java.util.stream.Collectors;
|
|
|
@@ -195,6 +197,73 @@ IdentityAuthenticationMapper identityAuthenticationMapper;
|
|
195
|
197
|
}
|
|
196
|
198
|
return null;
|
|
197
|
199
|
}
|
|
|
200
|
+ @Transactional
|
|
|
201
|
+ @Override
|
|
|
202
|
+ public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id, String userName, Long userId) {
|
|
|
203
|
+ List<CaseAttach> successList= new ArrayList<>();
|
|
|
204
|
+ try {
|
|
|
205
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
206
|
+ for (MultipartFile file : files) {
|
|
|
207
|
+ // 上传
|
|
|
208
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
209
|
+ CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
|
|
|
210
|
+ .annexName(fileName)
|
|
|
211
|
+ .annexPath(filePath)
|
|
|
212
|
+ .annexType(annexType)
|
|
|
213
|
+ .userId(userId)
|
|
|
214
|
+ .userName(userName)
|
|
|
215
|
+ .build();
|
|
|
216
|
+ int count = caseAttachMapper.save(caseAttach);
|
|
|
217
|
+ if (count > 0 && annexType!=null && annexType!=8) {
|
|
|
218
|
+ if(id!=null){
|
|
|
219
|
+ //修改案件状态
|
|
|
220
|
+ CaseApplication caseApplication = new CaseApplication();
|
|
|
221
|
+ caseApplication.setId(id);
|
|
|
222
|
+ caseApplication.setCaseStatus(4);
|
|
|
223
|
+ caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
|
224
|
+ }
|
|
|
225
|
+ CaseAttach caseAttachselect = new CaseAttach();
|
|
|
226
|
+ caseAttachselect.setAnnexId(caseAttach.getAnnexId());
|
|
|
227
|
+ caseAttachselect.setAnnexName(caseAttach.getAnnexName());
|
|
|
228
|
+ caseAttachselect.setAnnexType(caseAttach.getAnnexType());
|
|
|
229
|
+ successList.add(caseAttachselect);
|
|
|
230
|
+ }
|
|
|
231
|
+ }
|
|
|
232
|
+
|
|
|
233
|
+
|
|
|
234
|
+ } catch (IOException e) {
|
|
|
235
|
+ e.printStackTrace();
|
|
|
236
|
+ return AjaxResult.error("上传失败");
|
|
|
237
|
+ }
|
|
|
238
|
+
|
|
|
239
|
+ return AjaxResult.success("上传成功",successList);
|
|
|
240
|
+
|
|
|
241
|
+ }
|
|
|
242
|
+
|
|
|
243
|
+ @Override
|
|
|
244
|
+ public AjaxResult fileList(Long caseAppliId, List<Integer> annexTypeList) {
|
|
|
245
|
+ CaseApplication caseApplication = new CaseApplication();
|
|
|
246
|
+ caseApplication.setId(caseAppliId);
|
|
|
247
|
+ caseApplication.setAnnexTypeList(annexTypeList);
|
|
|
248
|
+ List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication);
|
|
|
249
|
+ if(CollectionUtil.isNotEmpty(caseAttachList)){
|
|
|
250
|
+ for (CaseAttach caseAttach : caseAttachList) {
|
|
|
251
|
+ String annexName = caseAttach.getAnnexName();
|
|
|
252
|
+ String prefix = "/profile";
|
|
|
253
|
+ int startIndex = annexName.indexOf(prefix);
|
|
|
254
|
+ startIndex += prefix.length();
|
|
|
255
|
+ String annexPath = "/uploadPath" + annexName.substring(startIndex);
|
|
|
256
|
+ caseAttach.setAnnexPath(annexPath);
|
|
|
257
|
+ int startIndexnew = annexName.lastIndexOf("/");
|
|
|
258
|
+ if(startIndexnew!=-1){
|
|
|
259
|
+ String annexNamenew = annexName.substring(startIndexnew+1);
|
|
|
260
|
+ caseAttach.setAnnexName(annexNamenew);
|
|
|
261
|
+ }
|
|
|
262
|
+ }
|
|
|
263
|
+ return AjaxResult.success(caseAttachList);
|
|
|
264
|
+ }
|
|
|
265
|
+ return null;
|
|
|
266
|
+ }
|
|
198
|
267
|
|
|
199
|
268
|
private List<CaseEvidenceVO> getCaseEvidenceVOList(String identityNum, List<Integer> caseStatusList, Integer identityType) {
|
|
200
|
269
|
List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType);
|