|
|
@@ -79,6 +79,7 @@ import java.util.concurrent.ExecutorService;
|
|
79
|
79
|
import java.util.function.Function;
|
|
80
|
80
|
import java.util.stream.Collectors;
|
|
81
|
81
|
|
|
|
82
|
+import static com.google.common.io.Files.getFileExtension;
|
|
82
|
83
|
import static com.ruoyi.common.utils.BookMarkUtil.getBookmarkByDocx;
|
|
83
|
84
|
import static com.ruoyi.common.utils.PageUtils.startPage;
|
|
84
|
85
|
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
|
|
@@ -193,8 +194,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
193
|
194
|
*/
|
|
194
|
195
|
@Override
|
|
195
|
196
|
public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) {
|
|
196
|
|
- // 是否调解员
|
|
197
|
|
- boolean isMediatorRole=false;
|
|
|
197
|
+ // 查询所有流程
|
|
|
198
|
+ Example allFlowExample = new Example(MsCaseFlow.class);
|
|
|
199
|
+ allFlowExample.setOrderByClause("sort asc");
|
|
|
200
|
+ List<MsCaseFlow> allCaseFlows = caseFlowMapper.selectByExample(allFlowExample);
|
|
|
201
|
+ if (CollectionUtil.isEmpty(allCaseFlows)) {
|
|
|
202
|
+ throw new ServiceException("未配置案件流程");
|
|
|
203
|
+ }
|
|
198
|
204
|
// 根据用户查询角色
|
|
199
|
205
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
200
|
206
|
// 根据id查询用户
|
|
|
@@ -205,7 +211,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
205
|
211
|
startPage();
|
|
206
|
212
|
List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null,null);
|
|
207
|
213
|
// 设置申请人被申请人及签名按钮限
|
|
208
|
|
- setAfflicate(isMediatorRole,list,loginUser.getUserId(),roles);
|
|
|
214
|
+ setAfflicate(new HashMap<>(),list,loginUser.getUserId(),roles);
|
|
209
|
215
|
return list;
|
|
210
|
216
|
}
|
|
211
|
217
|
if(CollectionUtil.isEmpty(roles) ){
|
|
|
@@ -227,6 +233,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
227
|
233
|
throw new ServiceException("该角色为绑定案件流程");
|
|
228
|
234
|
}
|
|
229
|
235
|
List<Integer> caseFlowIds = caseFlows.stream().map(MsCaseFlow::getId).collect(Collectors.toList());
|
|
|
236
|
+ // 流程名称分组
|
|
|
237
|
+ Map<String, Integer> flowNameMap = allCaseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getCaseStatusName, MsCaseFlow::getSort, (k1, k2) -> k2));
|
|
|
238
|
+
|
|
230
|
239
|
// 是否查询所有
|
|
231
|
240
|
boolean isSelectAll = false;
|
|
232
|
241
|
|
|
|
@@ -240,7 +249,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
240
|
249
|
roleIds=null;
|
|
241
|
250
|
}
|
|
242
|
251
|
if(StrUtil.equals(role.getRoleName(),"调解员")) {
|
|
243
|
|
- isMediatorRole=true;
|
|
244
|
252
|
req.setMediatorId(String.valueOf(sysUser.getUserId()));
|
|
245
|
253
|
}
|
|
246
|
254
|
}
|
|
|
@@ -257,25 +265,26 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
257
|
265
|
// 查询案件列表
|
|
258
|
266
|
List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, caseFlowIds,roleIds);
|
|
259
|
267
|
// 设置申请人被申请人及签名按钮限
|
|
260
|
|
- setAfflicate(isMediatorRole,list,loginUser.getUserId(),roles);
|
|
|
268
|
+ setAfflicate(flowNameMap,list,loginUser.getUserId(),roles);
|
|
261
|
269
|
return list;
|
|
262
|
270
|
}
|
|
263
|
271
|
|
|
264
|
272
|
/**
|
|
265
|
273
|
* 设置申请人被申请人及签名按钮限
|
|
266
|
|
- * @param isMediatorRole 是否调解员
|
|
|
274
|
+ * @param
|
|
267
|
275
|
* @param list
|
|
268
|
276
|
* @param loginUserId 当前登录用户id
|
|
269
|
277
|
*/
|
|
270
|
|
- private void setAfflicate(boolean isMediatorRole,List<MsCaseApplicationVO> list,Long loginUserId, List<SysRole> roles ) {
|
|
|
278
|
+ private void setAfflicate( Map<String, Integer> flowNameMap,List<MsCaseApplicationVO> list,Long loginUserId, List<SysRole> roles ) {
|
|
271
|
279
|
if(CollectionUtil.isEmpty(list)){
|
|
272
|
280
|
return;
|
|
273
|
281
|
}
|
|
274
|
|
- isMediatorRole=false;
|
|
|
282
|
+ // 是否调解员
|
|
|
283
|
+ boolean isMediatorRole=false;
|
|
275
|
284
|
// 查询申请人和被申请人
|
|
276
|
285
|
List<Long> caseIds = list.stream().map(MsCaseApplicationVO::getId).collect(Collectors.toList());
|
|
277
|
|
-
|
|
278
|
|
-
|
|
|
286
|
+ Integer mediatorSort = flowNameMap.get("待调解");
|
|
|
287
|
+ Integer sendSort = flowNameMap.get("待送达");
|
|
279
|
288
|
List<MsCaseAffiliate> affiliateList = msCaseAffiliateMapper.selectUserRoleByCaseIds(caseIds);
|
|
280
|
289
|
// 根据案件id分组
|
|
281
|
290
|
Map<Long, List<MsCaseAffiliate>> affiliateMap=null;
|
|
|
@@ -362,6 +371,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
362
|
371
|
}else {
|
|
363
|
372
|
vo.setSignButtonFlag(0);
|
|
364
|
373
|
}
|
|
|
374
|
+ // 调解员,并且在待调节后,送达前,显示
|
|
|
375
|
+ if(mediatorSort!=null && sendSort!=null && isMediatorRole
|
|
|
376
|
+ && null!=flowNameMap.get(vo.getCaseStatusName())
|
|
|
377
|
+ && flowNameMap.get(vo.getCaseStatusName())>mediatorSort
|
|
|
378
|
+ && flowNameMap.get(vo.getCaseStatusName())<=sendSort){
|
|
|
379
|
+ vo.setMediationFileFlag(1);
|
|
|
380
|
+ }
|
|
365
|
381
|
for (SysRole role : roles) {
|
|
366
|
382
|
if(StrUtil.isNotEmpty(role.getRoleName())){
|
|
367
|
383
|
if(StrUtil.contains(role.getRoleName(),"财务")
|
|
|
@@ -371,6 +387,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
371
|
387
|
){
|
|
372
|
388
|
vo.setOtherFlag(1);
|
|
373
|
389
|
}
|
|
|
390
|
+ if(role.getRoleName().equals("法律顾问")){
|
|
|
391
|
+ // 顾问可以上传下载调解书
|
|
|
392
|
+ vo.setMediationFileFlag(1);
|
|
|
393
|
+ }
|
|
374
|
394
|
|
|
375
|
395
|
}
|
|
376
|
396
|
}
|
|
|
@@ -413,6 +433,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
413
|
433
|
if (CollectionUtil.isEmpty(allCaseFlows)) {
|
|
414
|
434
|
throw new ServiceException("未配置案件流程");
|
|
415
|
435
|
}
|
|
|
436
|
+
|
|
416
|
437
|
List<MsCaseFlow> caseFlows = allCaseFlows;
|
|
417
|
438
|
MsCaseApplicationReq req = new MsCaseApplicationReq();
|
|
418
|
439
|
if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
|
|
|
@@ -690,6 +711,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
690
|
711
|
if (CollectionUtil.isNotEmpty(caseAttachList)) {
|
|
691
|
712
|
for (MsCaseAttach caseAttach : caseAttachList) {
|
|
692
|
713
|
caseAttach.setCaseAppliId(caseApplication.getId());
|
|
|
714
|
+ if(StrUtil.isNotEmpty(caseAttach.getAnnexPath())){
|
|
|
715
|
+ caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath()));
|
|
|
716
|
+ }
|
|
693
|
717
|
}
|
|
694
|
718
|
if(!caseApplication.isImportFlag()) {
|
|
695
|
719
|
// 修改案件附件
|
|
|
@@ -1522,6 +1546,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
1522
|
1546
|
.annexType(annexType)
|
|
1523
|
1547
|
.useId(SecurityUtils.getUserId())
|
|
1524
|
1548
|
.useAccount(SecurityUtils.getUsername())
|
|
|
1549
|
+ .suffix(getFileExtension(path))
|
|
1525
|
1550
|
.build();
|
|
1526
|
1551
|
int count = msCaseAttachMapper.save(caseAttach);
|
|
1527
|
1552
|
if (count > 0 ) {
|
|
|
@@ -2399,7 +2424,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2399
|
2424
|
@Override
|
|
2400
|
2425
|
public AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach) {
|
|
2401
|
2426
|
if(StrUtil.isEmpty(caseAttach.getAnnexName())) {
|
|
2402
|
|
- caseAttach.setAnnexName("调解书");
|
|
|
2427
|
+ caseAttach.setAnnexName("调解书.docx");
|
|
2403
|
2428
|
}
|
|
2404
|
2429
|
if(StrUtil.isNotEmpty(caseAttach.getAnnexPath())) {
|
|
2405
|
2430
|
String replace = caseAttach.getAnnexPath().replace("/home/ruoyi/uploadPath", "/profile");
|
|
|
@@ -2408,6 +2433,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2408
|
2433
|
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
2409
|
2434
|
caseAttach.setUseId(getUserInfo().getUserId());
|
|
2410
|
2435
|
caseAttach.setUseAccount(getUserInfo().getUserName());
|
|
|
2436
|
+ caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath()));
|
|
2411
|
2437
|
// 先删除之前的在新增
|
|
2412
|
2438
|
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), caseAttach.getAnnexType());
|
|
2413
|
2439
|
msCaseAttachMapper.save(caseAttach);
|
|
|
@@ -2415,6 +2441,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
2415
|
2441
|
return AjaxResult.success();
|
|
2416
|
2442
|
}
|
|
2417
|
2443
|
|
|
|
2444
|
+
|
|
2418
|
2445
|
/**
|
|
2419
|
2446
|
* 查询预约信息
|
|
2420
|
2447
|
* @param id
|
|
|
@@ -3434,6 +3461,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
3434
|
3461
|
}
|
|
3435
|
3462
|
|
|
3436
|
3463
|
}
|
|
|
3464
|
+ caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath()));
|
|
3437
|
3465
|
|
|
3438
|
3466
|
//保存到附件表里,先删除之前的在保存
|
|
3439
|
3467
|
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
|
|
|
@@ -3471,6 +3499,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
3471
|
3499
|
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
|
3472
|
3500
|
}
|
|
3473
|
3501
|
}
|
|
|
3502
|
+ caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath()));
|
|
3474
|
3503
|
msCaseAttachMapper.save(caseAttach);
|
|
3475
|
3504
|
}
|
|
3476
|
3505
|
|
|
|
@@ -3479,6 +3508,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
|
3479
|
3508
|
|
|
3480
|
3509
|
}
|
|
3481
|
3510
|
|
|
|
3511
|
+
|
|
|
3512
|
+
|
|
3482
|
3513
|
/**
|
|
3483
|
3514
|
* 调解书上传到onlyoffice服务器
|
|
3484
|
3515
|
* @param annexPath
|