ソースを参照

Merge branch 'hjb' of SH-Arbitrate/Arbitrate-Backend into dev

hejinbo 2 年 前
コミット
f71c07ab6a
共有1 個のファイルを変更した14 個の追加6 個の削除を含む
  1. 14
    6
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java

+ 14
- 6
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java ファイルの表示

@@ -80,12 +80,20 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
80 80
                 List<CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
81 81
                 if (evidenceMaterialList != null && evidenceMaterialList.size() > 0) {
82 82
                     for (CaseAttach caseAttach : evidenceMaterialList) {
83
-                        String path = caseAttach.getAnnexName();
84
-                        String prefix = "/profile";
85
-                        int startIndex = path.indexOf(prefix);
86
-                        startIndex += prefix.length();
87
-                        String extractedPath = "/uploadPath" + path.substring(startIndex);
88
-                        caseAttach.setAnnexPath(extractedPath);
83
+                        //根据附件类型决定返回的路径
84
+                        Integer annexType = caseAttach.getAnnexType();
85
+                        if (annexType != 1){
86
+                            String path = caseAttach.getAnnexName();
87
+                            String prefix = "/profile";
88
+                            int startIndex = path.indexOf(prefix);
89
+                            startIndex += prefix.length();
90
+                            String extractedPath = "/uploadPath" + path.substring(startIndex);
91
+                            caseAttach.setAnnexPath(extractedPath);
92
+                        }else {
93
+                            String annexPath = caseAttach.getAnnexPath();
94
+                            String result = annexPath.replace("/home/ruoyi", "");
95
+                            caseAttach.setAnnexPath(result);
96
+                        }
89 97
                     }
90 98
                 }
91 99
                 caseDetailVO.setEvidenceMaterialList(evidenceMaterialList);