Procházet zdrojové kódy

获取证据目录列表

hejinbo před 2 roky
rodič
revize
16cbd67b01

+ 4
- 0
pom.xml Zobrazit soubor

@@ -194,6 +194,10 @@
194 194
                     <source>${java.version}</source>
195 195
                     <target>${java.version}</target>
196 196
                     <encoding>${project.build.sourceEncoding}</encoding>
197
+                    <excludes>
198
+                        <exclude>ruoyi-system/**</exclude>
199
+                        <exclude>ruoyi-common/**</exclude>
200
+                    </excludes>
197 201
                 </configuration>
198 202
             </plugin>
199 203
         </plugins>

+ 10
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java Zobrazit soubor

@@ -6,6 +6,7 @@ import com.ruoyi.common.core.controller.BaseController;
6 6
 import com.ruoyi.common.core.domain.AjaxResult;
7 7
 import com.ruoyi.common.core.page.TableDataInfo;
8 8
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
9
+import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory;
9 10
 import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO;
10 11
 import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
11 12
 import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService;
@@ -134,4 +135,13 @@ public class CaseEvidenceController extends BaseController {
134 135
     public AjaxResult caseCrossexamination(@Validated @RequestBody CaseEvidenceDTO caseEvidenceDTO) {
135 136
         return caseEvidenceService.caseCrossexamination(caseEvidenceDTO);
136 137
     }
138
+    /**
139
+     * 获取证据目录树列表
140
+     */
141
+    @GetMapping("/evidenceTree")
142
+    public AjaxResult evidenceTree(CaseEvidenceDirectory caseEvidenceDirectory)
143
+    {
144
+        return success(caseEvidenceService.selectEvidenceTreeList(caseEvidenceDirectory)) ;
145
+    }
146
+
137 147
 }

+ 2
- 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java Zobrazit soubor

@@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
7 7
 import com.ruoyi.common.core.domain.entity.SysDept;
8 8
 import com.ruoyi.common.core.domain.entity.SysMenu;
9 9
 
10
+
10 11
 /**
11 12
  * Treeselect树结构实体类
12 13
  * 
@@ -38,6 +39,7 @@ public class TreeSelect implements Serializable
38 39
         this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
39 40
     }
40 41
 
42
+
41 43
     public TreeSelect(SysMenu menu)
42 44
     {
43 45
         this.id = menu.getMenuId();

+ 9
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseEvidenceDirectory.java Zobrazit soubor

@@ -6,6 +6,9 @@ import lombok.Builder;
6 6
 import lombok.Data;
7 7
 import lombok.NoArgsConstructor;
8 8
 
9
+import java.util.ArrayList;
10
+import java.util.List;
11
+
9 12
 @Data
10 13
 @Builder
11 14
 @AllArgsConstructor
@@ -16,12 +19,12 @@ public class CaseEvidenceDirectory extends BaseEntity {
16 19
     /**
17 20
      * id
18 21
      */
19
-    private Integer id;
22
+    private Long id;
20 23
 
21 24
     /**
22 25
      * 父id
23 26
      */
24
-    private Integer parentId;
27
+    private Long parentId;
25 28
 
26 29
     /**
27 30
      * 证据名称
@@ -41,5 +44,8 @@ public class CaseEvidenceDirectory extends BaseEntity {
41 44
     /**
42 45
      * 案件id
43 46
      */
44
-    private Integer caseId;
47
+    private Long caseId;
48
+
49
+    /** 子目录 */
50
+    private List<CaseEvidenceDirectory> children = new ArrayList<>();
45 51
 }

+ 176
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceDirectoryVO.java Zobrazit soubor

@@ -0,0 +1,176 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo;
2
+
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import com.fasterxml.jackson.annotation.JsonInclude;
5
+import com.ruoyi.common.core.domain.BaseEntity;
6
+import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory;
7
+import java.io.Serializable;
8
+import java.util.Date;
9
+import java.util.List;
10
+
11
+/**
12
+ * 目录查询返回类
13
+ */
14
+public class CaseEvidenceDirectoryVO implements Serializable {
15
+    private static final long serialVersionUID = 1L;
16
+    /**
17
+     * id
18
+     */
19
+    private Long id;
20
+    /**
21
+     * 父id
22
+     */
23
+    private Long parentId;
24
+
25
+    /**
26
+     * 证据名称
27
+     */
28
+    private String evidenceName;
29
+
30
+    /**
31
+     * 附件id
32
+     */
33
+    private Integer annexId;
34
+
35
+    /**
36
+     * 级数
37
+     */
38
+    private Integer series;
39
+
40
+    /**
41
+     * 案件id
42
+     */
43
+    private Long caseId;
44
+
45
+    /** 子目录 */
46
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
47
+    private List<CaseEvidenceDirectory> children;
48
+
49
+    /**
50
+     * 创建时间
51
+     */
52
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
53
+    private Date createTime;
54
+    /**
55
+     * 创建者
56
+     */
57
+    private String createBy;
58
+    /**
59
+     * 更新者
60
+     */
61
+    private String updateBy;
62
+
63
+    /**
64
+     * 更新时间
65
+     */
66
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
67
+    private Date updateTime;
68
+    public CaseEvidenceDirectoryVO(){
69
+    }
70
+
71
+    public static long getSerialVersionUID() {
72
+        return serialVersionUID;
73
+    }
74
+
75
+    public Long getId() {
76
+        return id;
77
+    }
78
+
79
+    public void setId(Long id) {
80
+        this.id = id;
81
+    }
82
+
83
+    public Long getParentId() {
84
+        return parentId;
85
+    }
86
+
87
+    public void setParentId(Long parentId) {
88
+        this.parentId = parentId;
89
+    }
90
+
91
+    public String getEvidenceName() {
92
+        return evidenceName;
93
+    }
94
+
95
+    public void setEvidenceName(String evidenceName) {
96
+        this.evidenceName = evidenceName;
97
+    }
98
+
99
+    public Integer getAnnexId() {
100
+        return annexId;
101
+    }
102
+
103
+    public void setAnnexId(Integer annexId) {
104
+        this.annexId = annexId;
105
+    }
106
+
107
+    public Integer getSeries() {
108
+        return series;
109
+    }
110
+
111
+    public void setSeries(Integer series) {
112
+        this.series = series;
113
+    }
114
+
115
+    public Long getCaseId() {
116
+        return caseId;
117
+    }
118
+
119
+    public void setCaseId(Long caseId) {
120
+        this.caseId = caseId;
121
+    }
122
+
123
+    public List<CaseEvidenceDirectory> getChildren() {
124
+        return children;
125
+    }
126
+
127
+    public void setChildren(List<CaseEvidenceDirectory> children) {
128
+        this.children = children;
129
+    }
130
+
131
+    public Date getCreateTime() {
132
+        return createTime;
133
+    }
134
+
135
+    public void setCreateTime(Date createTime) {
136
+        this.createTime = createTime;
137
+    }
138
+
139
+    public String getCreateBy() {
140
+        return createBy;
141
+    }
142
+
143
+    public void setCreateBy(String createBy) {
144
+        this.createBy = createBy;
145
+    }
146
+
147
+    public String getUpdateBy() {
148
+        return updateBy;
149
+    }
150
+
151
+    public void setUpdateBy(String updateBy) {
152
+        this.updateBy = updateBy;
153
+    }
154
+
155
+    public Date getUpdateTime() {
156
+        return updateTime;
157
+    }
158
+
159
+    public void setUpdateTime(Date updateTime) {
160
+        this.updateTime = updateTime;
161
+    }
162
+
163
+    public CaseEvidenceDirectoryVO(CaseEvidenceDirectory caseEvidenceDirectory) {
164
+        this.id = caseEvidenceDirectory.getId();
165
+        this.parentId = caseEvidenceDirectory.getParentId();
166
+        this.evidenceName = caseEvidenceDirectory.getEvidenceName();
167
+        this.annexId = caseEvidenceDirectory.getAnnexId();
168
+        this.series = caseEvidenceDirectory.getSeries();
169
+        this.caseId = caseEvidenceDirectory.getCaseId();
170
+        this.children = caseEvidenceDirectory.getChildren();
171
+        this.createTime = caseEvidenceDirectory.getCreateTime();
172
+        this.createBy = caseEvidenceDirectory.getCreateBy();
173
+        this.updateBy = caseEvidenceDirectory.getUpdateBy();
174
+        this.updateTime = caseEvidenceDirectory.getUpdateTime();
175
+    }
176
+}

+ 30
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java Zobrazit soubor

@@ -3,7 +3,9 @@ package com.ruoyi.wisdomarbitrate.service;
3 3
 
4 4
 import com.ruoyi.common.core.domain.AjaxResult;
5 5
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
6
+import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory;
6 7
 import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO;
8
+import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO;
7 9
 import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
8 10
 import org.springframework.web.multipart.MultipartFile;
9 11
 
@@ -35,4 +37,32 @@ public interface ICaseEvidenceService {
35 37
     AjaxResult fileList(Long caseAppliId,  List<Integer> annexTypeList);
36 38
 
37 39
     int deleteFile( List<Integer> fileIds);
40
+
41
+    List<CaseEvidenceDirectoryVO> selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory);
42
+
43
+
44
+    /**
45
+     * 查询证据目录数据
46
+     *
47
+     * @param caseEvidenceDirectory 证据目录信息
48
+     * @return 证据目录信息集合
49
+     */
50
+    List<CaseEvidenceDirectory> selectCaseEvidenceList(CaseEvidenceDirectory caseEvidenceDirectory);
51
+
52
+
53
+    /**
54
+     * 构建前端所需要树结构
55
+     *
56
+     * @param caseEvidenceDirectorys 证据列表
57
+     * @return 树结构列表
58
+     */
59
+    List<CaseEvidenceDirectory> buildCaseEvidenceTree(List<CaseEvidenceDirectory> caseEvidenceDirectorys);
60
+
61
+    /**
62
+     * 构建前端所需要下拉树结构
63
+     *
64
+     * @param caseEvidenceDirectorys 证据目录列表
65
+     * @return 下拉树结构列表
66
+     */
67
+    List<CaseEvidenceDirectoryVO> buildCaseEvidenceTreeSelect(List<CaseEvidenceDirectory> caseEvidenceDirectorys);
38 68
 }

+ 110
- 34
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java Zobrazit soubor

@@ -7,6 +7,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
7 7
 import com.ruoyi.common.core.domain.model.LoginUser;
8 8
 import com.ruoyi.common.utils.SecurityUtils;
9 9
 import com.ruoyi.common.utils.StringUtils;
10
+import com.ruoyi.common.utils.spring.SpringUtils;
11
+import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO;
10 12
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
11 13
 import com.ruoyi.common.utils.file.FileUploadUtils;
12 14
 import com.ruoyi.wisdomarbitrate.domain.*;
@@ -24,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
24 26
 import java.io.IOException;
25 27
 import java.util.ArrayList;
26 28
 import java.util.Arrays;
29
+import java.util.Iterator;
27 30
 import java.util.List;
28 31
 import java.util.stream.Collectors;
29 32
 
@@ -39,6 +42,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
39 42
     private CaseAttachMapper caseAttachMapper;
40 43
     @Autowired
41 44
     private CaseLogRecordMapper caseLogRecordMapper;
45
+    @Autowired
46
+    private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper;
42 47
 
43 48
     @Override
44 49
     @Transactional
@@ -103,8 +108,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
103 108
                     .userName(userName)
104 109
                     .build();
105 110
             int count = caseAttachMapper.save(caseAttach);
106
-            if (count > 0 && annexType!=null && annexType!=8) {
107
-                if(id!=null){
111
+            if (count > 0 && annexType != null && annexType != 8) {
112
+                if (id != null) {
108 113
                     //修改案件状态
109 114
                     CaseApplication caseApplication = new CaseApplication();
110 115
                     caseApplication.setId(id);
@@ -115,7 +120,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
115 120
                 caseAttachselect.setAnnexId(caseAttach.getAnnexId());
116 121
                 caseAttachselect.setAnnexName(caseAttach.getAnnexName());
117 122
                 caseAttachselect.setAnnexType(caseAttach.getAnnexType());
118
-                return AjaxResult.success("上传成功",caseAttachselect);
123
+                return AjaxResult.success("上传成功", caseAttachselect);
119 124
             }
120 125
         } catch (IOException e) {
121 126
             e.printStackTrace();
@@ -125,19 +130,19 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
125 130
     }
126 131
 
127 132
 
128
-@Autowired
129
-IdentityAuthenticationMapper identityAuthenticationMapper;
133
+    @Autowired
134
+    IdentityAuthenticationMapper identityAuthenticationMapper;
130 135
 
131 136
     @Override
132 137
     public List<CaseEvidenceVO> getCaseListAll(String identityNum) {
133
-        if(StringUtils.isBlank(identityNum)){
138
+        if (StringUtils.isBlank(identityNum)) {
134 139
             LoginUser loginUser = SecurityUtils.getLoginUser();
135 140
             String username = loginUser.getUsername();
136
-            IdentityAuthentication authentication=new IdentityAuthentication();
141
+            IdentityAuthentication authentication = new IdentityAuthentication();
137 142
             authentication.setUserName(username);
138 143
             IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication);
139
-            if(authentication1!=null){
140
-                 identityNum = authentication1.getIdentityNo();
144
+            if (authentication1 != null) {
145
+                identityNum = authentication1.getIdentityNo();
141 146
             }
142 147
         }
143 148
         List<Integer> caseStatusList = Arrays.asList(CaseApplicationConstants.CASE_CROSSEXAMI);
@@ -150,7 +155,7 @@ IdentityAuthenticationMapper identityAuthenticationMapper;
150 155
         int i = caseApplicationMapper.submitCaseApplication(caseApplication);
151 156
         if (i > 0) {
152 157
             // 新增日志
153
-            CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_TRIAL,"");
158
+            CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_TRIAL, "");
154 159
 
155 160
             return AjaxResult.success("证据确认成功");
156 161
         }
@@ -182,25 +187,26 @@ IdentityAuthenticationMapper identityAuthenticationMapper;
182 187
             //修改案件状态
183 188
             caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT);
184 189
             //选择仲裁方式
185
-            if (caseEvidenceDTO.getOpenCourtHear()==1){   //开庭审理
190
+            if (caseEvidenceDTO.getOpenCourtHear() == 1) {   //开庭审理
186 191
                 caseApplication1.setArbitratMethod(1);
187
-            }else {
192
+            } else {
188 193
                 caseApplication1.setArbitratMethod(2);  //书面审理
189 194
             }
190 195
             int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
191 196
             if (i > 0) {
192 197
                 // 新增日志
193
-                CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT,"");
198
+                CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT, "");
194 199
 
195 200
                 return AjaxResult.success("提交成功");
196 201
             }
197 202
         }
198 203
         return null;
199 204
     }
205
+
200 206
     @Transactional
201 207
     @Override
202 208
     public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id, String userName, Long userId) {
203
-        List<CaseAttach> successList= new ArrayList<>();
209
+        List<CaseAttach> successList = new ArrayList<>();
204 210
         try {
205 211
             String filePath = RuoYiConfig.getUploadPath();
206 212
             for (MultipartFile file : files) {
@@ -214,8 +220,8 @@ IdentityAuthenticationMapper identityAuthenticationMapper;
214 220
                         .userName(userName)
215 221
                         .build();
216 222
                 int count = caseAttachMapper.save(caseAttach);
217
-                if (count > 0 && annexType!=null && annexType!=8) {
218
-                    if(id!=null){
223
+                if (count > 0 && annexType != null && annexType != 8) {
224
+                    if (id != null) {
219 225
                         //修改案件状态
220 226
                         CaseApplication caseApplication = new CaseApplication();
221 227
                         caseApplication.setId(id);
@@ -236,41 +242,111 @@ IdentityAuthenticationMapper identityAuthenticationMapper;
236 242
             return AjaxResult.error("上传失败");
237 243
         }
238 244
 
239
-        return AjaxResult.success("上传成功",successList);
245
+        return AjaxResult.success("上传成功", successList);
240 246
 
241 247
     }
242 248
 
243 249
     @Override
244
-    public AjaxResult fileList(Long caseAppliId,  List<Integer> annexTypeList) {
250
+    public AjaxResult fileList(Long caseAppliId, List<Integer> annexTypeList) {
245 251
         CaseApplication caseApplication = new CaseApplication();
246 252
         caseApplication.setId(caseAppliId);
247 253
         caseApplication.setAnnexTypeList(annexTypeList);
248 254
         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
-                    }
255
+        if (CollectionUtil.isNotEmpty(caseAttachList)) {
256
+            for (CaseAttach caseAttach : caseAttachList) {
257
+                String annexName = caseAttach.getAnnexName();
258
+                String prefix = "/profile";
259
+                int startIndex = annexName.indexOf(prefix);
260
+                startIndex += prefix.length();
261
+                String annexPath = "/uploadPath" + annexName.substring(startIndex);
262
+                caseAttach.setAnnexPath(annexPath);
263
+                int startIndexnew = annexName.lastIndexOf("/");
264
+                if (startIndexnew != -1) {
265
+                    String annexNamenew = annexName.substring(startIndexnew + 1);
266
+                    caseAttach.setAnnexName(annexNamenew);
262 267
                 }
263
-                return AjaxResult.success(caseAttachList);
268
+            }
269
+            return AjaxResult.success(caseAttachList);
264 270
         }
265 271
         return null;
266 272
     }
267 273
 
268 274
     @Override
269
-    public int deleteFile( List<Integer> fileIds) {
270
-
275
+    public int deleteFile(List<Integer> fileIds) {
271 276
         return caseAttachMapper.deleteByFileIds(fileIds);
272 277
     }
273 278
 
279
+    @Override
280
+    public List<CaseEvidenceDirectoryVO> selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory) {
281
+        List<CaseEvidenceDirectory> caseEvidenceDirectorys = SpringUtils.getAopProxy(this).selectCaseEvidenceList(caseEvidenceDirectory);
282
+        return buildCaseEvidenceTreeSelect(caseEvidenceDirectorys);
283
+    }
284
+
285
+    @Override
286
+    public List<CaseEvidenceDirectory> selectCaseEvidenceList(CaseEvidenceDirectory caseEvidenceDirectory) {
287
+        return caseEvidenceDirectoryMapper.selectList(caseEvidenceDirectory);
288
+    }
289
+
290
+    @Override
291
+    public List<CaseEvidenceDirectory> buildCaseEvidenceTree(List<CaseEvidenceDirectory> caseEvidenceDirectorys) {
292
+        List<CaseEvidenceDirectory> returnList = new ArrayList<>();
293
+        List<Long> tempList = caseEvidenceDirectorys.stream().map(CaseEvidenceDirectory::getId).collect(Collectors.toList());
294
+        for (CaseEvidenceDirectory caseEvidenceDirectory : caseEvidenceDirectorys) {
295
+            // 如果是顶级节点, 遍历该父节点的所有子节点
296
+            if (!tempList.contains(caseEvidenceDirectory.getParentId())) {
297
+                recursionFn(caseEvidenceDirectorys, caseEvidenceDirectory);
298
+                returnList.add(caseEvidenceDirectory);
299
+            }
300
+        }
301
+        if (returnList.isEmpty())
302
+        {
303
+            returnList = caseEvidenceDirectorys;
304
+        }
305
+        return returnList;
306
+    }
307
+
308
+    @Override
309
+    public List<CaseEvidenceDirectoryVO> buildCaseEvidenceTreeSelect(List<CaseEvidenceDirectory> caseEvidenceDirectorys) {
310
+        List<CaseEvidenceDirectory> caseEvidenceDirectories = buildCaseEvidenceTree(caseEvidenceDirectorys);
311
+        return caseEvidenceDirectories.stream().map(CaseEvidenceDirectoryVO::new).collect(Collectors.toList());
312
+    }
313
+
314
+    /**
315
+     * 递归列表
316
+     */
317
+    private void recursionFn(List<CaseEvidenceDirectory> list, CaseEvidenceDirectory t) {
318
+        // 得到子节点列表
319
+        List<CaseEvidenceDirectory> childList = getChildList(list, t);
320
+        t.setChildren(childList);
321
+        for (CaseEvidenceDirectory tChild : childList) {
322
+            if (hasChild(list, tChild)) {
323
+                recursionFn(list, tChild);
324
+            }
325
+        }
326
+    }
327
+
328
+    /**
329
+     * 得到子节点列表
330
+     */
331
+    private List<CaseEvidenceDirectory> getChildList(List<CaseEvidenceDirectory> list, CaseEvidenceDirectory t) {
332
+        List<CaseEvidenceDirectory> tlist = new ArrayList<>();
333
+        Iterator<CaseEvidenceDirectory> it = list.iterator();
334
+        while (it.hasNext()) {
335
+            CaseEvidenceDirectory n = it.next();
336
+            if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue()) {
337
+                tlist.add(n);
338
+            }
339
+        }
340
+        return tlist;
341
+    }
342
+
343
+    /**
344
+     * 判断是否有子节点
345
+     */
346
+    private boolean hasChild(List<CaseEvidenceDirectory> list, CaseEvidenceDirectory t) {
347
+        return getChildList(list, t).size() > 0;
348
+    }
349
+
274 350
     private List<CaseEvidenceVO> getCaseEvidenceVOList(String identityNum, List<Integer> caseStatusList, Integer identityType) {
275 351
         List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType);
276 352
         if (caseListByRespondent != null && caseListByRespondent.size() > 0) {

+ 2
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceDirectoryMapper.xml Zobrazit soubor

@@ -35,7 +35,7 @@
35 35
         sysdate()
36 36
         )
37 37
     </insert>
38
-    <select id="selectList" resultMap="CaseEvidenceDirectoryResult">
38
+    <select id="selectList" parameterType="CaseEvidenceDirectory" resultMap="CaseEvidenceDirectoryResult">
39 39
         select id,parent_id,evidence_name,annex_id,series,create_time,update_time,case_appli_id,create_by,update_by
40 40
         from case_evidence_directory
41 41
         <where>
@@ -57,6 +57,7 @@
57 57
             <if test="caseId != null ">
58 58
                 AND case_appli_id = #{caseId}
59 59
             </if>
60
+            order by case_evidence_directory.parent_id
60 61
         </where>
61 62
     </select>
62 63