|
|
@@ -400,6 +400,44 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
|
400
|
400
|
return caseEvidenceDirectories.stream().map(CaseEvidenceDirectoryVO::new).collect(Collectors.toList());
|
|
401
|
401
|
}
|
|
402
|
402
|
|
|
|
403
|
+ @Override
|
|
|
404
|
+ @Transactional
|
|
|
405
|
+ public AjaxResult uploadRecord(MultipartFile file, Integer annexType, Long id, String username, Long userId) {
|
|
|
406
|
+ if (file.isEmpty()) {
|
|
|
407
|
+ return AjaxResult.error("请选择要上传的文件");
|
|
|
408
|
+ }
|
|
|
409
|
+ try {
|
|
|
410
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
411
|
+ // 上传
|
|
|
412
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
413
|
+ CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
|
|
|
414
|
+ .annexName(fileName)
|
|
|
415
|
+ .annexPath(filePath)
|
|
|
416
|
+ .annexType(annexType)
|
|
|
417
|
+ .userId(userId)
|
|
|
418
|
+ .userName(username)
|
|
|
419
|
+ .build();
|
|
|
420
|
+
|
|
|
421
|
+ CaseApplication caseApplicationsel = new CaseApplication();
|
|
|
422
|
+ caseApplicationsel.setId(id);
|
|
|
423
|
+ caseApplicationsel.setAnnexType(7);
|
|
|
424
|
+ List<CaseAttach> caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplicationsel);
|
|
|
425
|
+ if(caseAttachs!=null&&caseAttachs.size()>0){
|
|
|
426
|
+ caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,7);
|
|
|
427
|
+ int count = caseAttachMapper.save(caseAttach);
|
|
|
428
|
+ }else {
|
|
|
429
|
+ int count = caseAttachMapper.save(caseAttach);
|
|
|
430
|
+ }
|
|
|
431
|
+
|
|
|
432
|
+ return AjaxResult.success("上传成功");
|
|
|
433
|
+ } catch (IOException e) {
|
|
|
434
|
+ e.printStackTrace();
|
|
|
435
|
+ }
|
|
|
436
|
+
|
|
|
437
|
+ return AjaxResult.error("上传失败");
|
|
|
438
|
+
|
|
|
439
|
+ }
|
|
|
440
|
+
|
|
403
|
441
|
/**
|
|
404
|
442
|
* 递归列表
|
|
405
|
443
|
*/
|