|
|
@@ -1,6 +1,8 @@
|
|
1
|
1
|
package com.ruoyi.wisdomarbitrate.service.mscase.impl;
|
|
2
|
2
|
|
|
3
|
3
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
4
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
5
|
+import cn.hutool.core.util.StrUtil;
|
|
4
|
6
|
import com.alibaba.fastjson.JSONArray;
|
|
5
|
7
|
import com.alibaba.fastjson.JSONObject;
|
|
6
|
8
|
import com.google.gson.Gson;
|
|
|
@@ -8,12 +10,16 @@ import com.google.gson.JsonObject;
|
|
8
|
10
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
9
|
11
|
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
|
10
|
12
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
13
|
+import com.ruoyi.common.enums.YesOrNoEnum;
|
|
11
|
14
|
import com.ruoyi.common.exception.EsignDemoException;
|
|
12
|
15
|
import com.ruoyi.common.exception.ServiceException;
|
|
13
|
16
|
import com.ruoyi.common.utils.SmsUtils;
|
|
14
|
17
|
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
|
|
18
|
+import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
|
|
19
|
+import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
|
|
15
|
20
|
import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
|
|
16
|
21
|
import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
|
|
|
22
|
+import com.ruoyi.wisdomarbitrate.domain.dto.mscase.MsSignSealDTO;
|
|
17
|
23
|
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
|
|
18
|
24
|
import com.ruoyi.wisdomarbitrate.domain.entity.dept.MsSealSignRecord;
|
|
19
|
25
|
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
|
|
|
@@ -26,12 +32,15 @@ import com.ruoyi.wisdomarbitrate.mapper.dept.SealManageMapper;
|
|
26
|
32
|
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAffiliateMapper;
|
|
27
|
33
|
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
|
|
28
|
34
|
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
|
|
|
35
|
+import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
|
|
29
|
36
|
import com.ruoyi.wisdomarbitrate.service.mscase.MsSignSealService;
|
|
|
37
|
+import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
|
30
|
38
|
import com.ruoyi.wisdomarbitrate.utils.SignAward;
|
|
31
|
39
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
32
|
40
|
import org.springframework.stereotype.Service;
|
|
33
|
41
|
import org.springframework.transaction.annotation.Transactional;
|
|
34
|
42
|
|
|
|
43
|
+import javax.annotation.Resource;
|
|
35
|
44
|
import java.util.ArrayList;
|
|
36
|
45
|
import java.util.List;
|
|
37
|
46
|
|
|
|
@@ -48,10 +57,17 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|
48
|
57
|
private DeptIdentifyMapper deptIdentifyMapper;
|
|
49
|
58
|
@Autowired
|
|
50
|
59
|
private SealManageMapper sealManageMapper;
|
|
|
60
|
+ @Autowired
|
|
|
61
|
+ MsCaseFlowMapper caseFlowMapper;
|
|
51
|
62
|
|
|
52
|
63
|
@Autowired
|
|
53
|
64
|
private MsSealSignRecordMapper sealSignRecordMapper;
|
|
54
|
65
|
|
|
|
66
|
+ @Resource
|
|
|
67
|
+ private MsCaseApplicationService applicationService;
|
|
|
68
|
+ @Autowired
|
|
|
69
|
+ private MsCaseApplicationMapper caseApplicationMapper;
|
|
|
70
|
+
|
|
55
|
71
|
|
|
56
|
72
|
@Override
|
|
57
|
73
|
@Transactional
|
|
|
@@ -287,7 +303,41 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|
287
|
303
|
return AjaxResult.success();
|
|
288
|
304
|
}
|
|
289
|
305
|
|
|
|
306
|
+ @Override
|
|
|
307
|
+ @Transactional
|
|
|
308
|
+ public AjaxResult sealApply(MsSignSealDTO dto) {
|
|
|
309
|
+ // 根据流程id查找下一个流程节点
|
|
|
310
|
+ MsCaseFlow nextFlow = caseFlowMapper.nextFlow(dto.getCaseFlowId());
|
|
|
311
|
+ if (nextFlow == null) {
|
|
|
312
|
+ return AjaxResult.error("未找到下一个流程节点");
|
|
|
313
|
+ }
|
|
|
314
|
+ if (StrUtil.isNotEmpty(dto.getBatchNumber())) {
|
|
|
315
|
+ // 批量操作
|
|
|
316
|
+ // 查询该批号下该流程的案件
|
|
|
317
|
+ List<MsCaseApplication> applicationList = applicationService.listByBatchNumber(dto.getBatchNumber(), dto.getCaseFlowId());
|
|
|
318
|
+ if (CollectionUtil.isEmpty(applicationList)) {
|
|
|
319
|
+ return AjaxResult.error("该批号下未找到案件");
|
|
|
320
|
+ }
|
|
|
321
|
+ for (MsCaseApplication application : applicationList) {
|
|
|
322
|
+ application.setCaseFlowId(nextFlow.getId());
|
|
|
323
|
+ application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
|
324
|
+ caseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
|
325
|
+ CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"用印申请");
|
|
|
326
|
+ }
|
|
|
327
|
+ } else {
|
|
|
328
|
+ // 单独
|
|
|
329
|
+ MsCaseApplication application = new MsCaseApplication();
|
|
|
330
|
+ application.setId(dto.getCaseId());
|
|
|
331
|
+ application.setLockStatus(YesOrNoEnum.YES.getCode());
|
|
|
332
|
+ application.setCaseFlowId(nextFlow.getId());
|
|
|
333
|
+ application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
|
334
|
+ caseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
|
335
|
+ CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"用印申请");
|
|
290
|
336
|
|
|
|
337
|
+ }
|
|
|
338
|
+ return AjaxResult.success("用印申请成功");
|
|
|
339
|
+
|
|
|
340
|
+ }
|
|
291
|
341
|
|
|
292
|
342
|
|
|
293
|
343
|
}
|