Преглед изворни кода

小程序立案申请书展示

hejinbo пре 2 година
родитељ
комит
630b455790

+ 14
- 6
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java Прегледај датотеку

80
                 List<CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
80
                 List<CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
81
                 if (evidenceMaterialList != null && evidenceMaterialList.size() > 0) {
81
                 if (evidenceMaterialList != null && evidenceMaterialList.size() > 0) {
82
                     for (CaseAttach caseAttach : evidenceMaterialList) {
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
                 caseDetailVO.setEvidenceMaterialList(evidenceMaterialList);
99
                 caseDetailVO.setEvidenceMaterialList(evidenceMaterialList);