|
|
@@ -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) {
|