|
|
@@ -39,75 +39,86 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
39
|
39
|
|
|
40
|
40
|
@Override
|
|
41
|
41
|
@Transactional
|
|
42
|
|
- public AjaxResult examineArbitrateMethod(List<Long> ids, Integer opinion) {
|
|
43
|
|
- // 批量查询案件信息组装成map
|
|
44
|
|
- List<CaseApplication> caseApplicationList = caseApplicationMapper.listCaseApplicationByIds(ids);
|
|
45
|
|
- if (CollectionUtil.isEmpty(caseApplicationList)) {
|
|
|
42
|
+ public AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion) {
|
|
|
43
|
+ //查询案件详细信息
|
|
|
44
|
+ CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
|
45
|
+ if (caseApplication1 == null) {
|
|
46
|
46
|
return AjaxResult.success();
|
|
47
|
47
|
}
|
|
48
|
|
- Map<Long, CaseApplication> caseApplicationMap = caseApplicationList.stream().collect(Collectors.toMap(CaseApplication::getId, Function.identity(), (n1, n2) -> n2));
|
|
49
|
|
-
|
|
50
|
|
- //发送短信通知
|
|
51
|
|
- SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
52
|
|
-
|
|
53
|
|
- for (Long id : ids) {
|
|
54
|
|
-
|
|
55
|
|
- CaseApplication caseApplication = new CaseApplication();
|
|
56
|
|
- caseApplication.setId(id);
|
|
57
|
|
- //查询案件详细信息
|
|
58
|
|
- CaseApplication caseApplicationById = caseApplicationMap.get(id);
|
|
59
|
|
- if (caseApplicationById == null) {
|
|
60
|
|
- continue;
|
|
61
|
|
- }
|
|
62
|
|
- // 获取该案件仲裁方式
|
|
63
|
|
- Integer arbitratMethod = caseApplicationById.getArbitratMethod();
|
|
64
|
|
- if(arbitratMethod!=null) {
|
|
65
|
|
- String caseNum = caseApplicationById.getCaseNum();
|
|
66
|
|
- // 日志节点的状态
|
|
67
|
|
- int caseLogStatus;
|
|
68
|
|
- if (opinion == 0) { //拒绝
|
|
69
|
|
- if (arbitratMethod == 2) {
|
|
70
|
|
- caseApplicationById.setArbitratMethod(1); // 更改仲裁方式
|
|
71
|
|
- //修改案件状态为待开庭审理
|
|
|
48
|
+ Integer arbitratMethod = caseApplication1.getArbitratMethod();
|
|
|
49
|
+ if(arbitratMethod==null) {
|
|
|
50
|
+ return AjaxResult.error("请先指定仲裁方式");
|
|
|
51
|
+ }
|
|
|
52
|
+ String caseNum = caseApplication1.getCaseNum();
|
|
|
53
|
+ if (opinion == 0) { //拒绝
|
|
|
54
|
+ if (arbitratMethod == 2) {
|
|
|
55
|
+ caseApplication1.setArbitratMethod(1); // 更改仲裁方式
|
|
|
56
|
+ //修改案件状态为待开庭审理
|
|
72
|
57
|
// caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
|
|
73
|
|
- //修改案件状态为待修改开庭时间
|
|
74
|
|
- caseApplicationById.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
|
|
75
|
|
- // 新增日志
|
|
76
|
|
- caseLogStatus = CaseApplicationConstants.MODIFY_HEARDATE;
|
|
77
|
|
-
|
|
78
|
|
- } else {
|
|
79
|
|
- caseApplicationById.setArbitratMethod(2);
|
|
80
|
|
- //修改案件状态为待书面审理
|
|
81
|
|
- caseApplicationById.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
|
|
82
|
|
- caseLogStatus = CaseApplicationConstants.PENDING_WRIITEN_HEAR;
|
|
|
58
|
+ //修改案件状态为待修改开庭时间
|
|
|
59
|
+ caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
|
|
|
60
|
+ // 新增日志
|
|
|
61
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
|
|
83
|
62
|
|
|
84
|
|
- }
|
|
85
|
63
|
} else {
|
|
86
|
|
- if (arbitratMethod == 2) {
|
|
87
|
|
- //修改案件状态为待书面审理
|
|
88
|
|
- caseApplicationById.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
|
|
89
|
|
- caseLogStatus = CaseApplicationConstants.PENDING_WRIITEN_HEAR;
|
|
|
64
|
+ caseApplication1.setArbitratMethod(2);
|
|
|
65
|
+ //修改案件状态为待书面审理
|
|
|
66
|
+ caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
|
|
|
67
|
+ // 新增日志
|
|
|
68
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
|
|
90
|
69
|
|
|
91
|
|
- } else {
|
|
92
|
|
- //修改案件状态为待开庭审理
|
|
|
70
|
+ }
|
|
|
71
|
+ } else {
|
|
|
72
|
+ if (arbitratMethod == 2) {
|
|
|
73
|
+ //修改案件状态为待书面审理
|
|
|
74
|
+ caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
|
|
|
75
|
+ // 新增日志
|
|
|
76
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
|
|
|
77
|
+
|
|
|
78
|
+ } else {
|
|
|
79
|
+ //修改案件状态为待开庭审理
|
|
93
|
80
|
// caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
|
|
94
|
|
- //修改案件状态为待修改开庭时间
|
|
95
|
|
- caseApplicationById.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
|
|
96
|
|
- caseLogStatus = CaseApplicationConstants.MODIFY_HEARDATE;
|
|
|
81
|
+ //修改案件状态为待修改开庭时间
|
|
|
82
|
+ caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
|
|
|
83
|
+ // 新增日志
|
|
|
84
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
|
|
97
|
85
|
|
|
|
86
|
+ }
|
|
|
87
|
+ }
|
|
|
88
|
+ int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
|
|
|
89
|
+ if (i > 0) {
|
|
|
90
|
+ String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理";
|
|
|
91
|
+ //发送短信通知
|
|
|
92
|
+ SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
98
|
93
|
|
|
|
94
|
+ CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
|
95
|
+ caseAffiliate.setCaseAppliId(caseApplication1.getId());
|
|
|
96
|
+ List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息
|
|
|
97
|
+ if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
|
|
98
|
+ for (CaseAffiliate affiliate : caseAffiliates) {
|
|
|
99
|
+ //获取身份类型
|
|
|
100
|
+ int identityType = affiliate.getIdentityType();
|
|
|
101
|
+ if (identityType == 1) { //申请人
|
|
|
102
|
+ request.setTemplateId("1931000");
|
|
|
103
|
+ request.setPhone(affiliate.getContactTelphone());
|
|
|
104
|
+ // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
|
|
|
105
|
+ // 1931000 普通短信 确定仲裁方式通知 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
|
|
106
|
+ String name = affiliate.getName();
|
|
|
107
|
+ request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
|
|
|
108
|
+ SmsUtils.sendSms(request);
|
|
|
109
|
+ } else { //被申请人
|
|
|
110
|
+ request.setTemplateId("1928006");
|
|
|
111
|
+ request.setPhone(affiliate.getContactTelphone());
|
|
|
112
|
+ // 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。
|
|
|
113
|
+ String name = affiliate.getName();
|
|
|
114
|
+ request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
|
|
|
115
|
+ SmsUtils.sendSms(request);
|
|
|
116
|
+ }
|
|
99
|
117
|
}
|
|
100
|
118
|
}
|
|
101
|
|
- // 更改案件状态
|
|
102
|
|
- int i = caseApplicationMapper.submitCaseApplication(caseApplicationById);
|
|
103
|
|
- if (i > 0) {
|
|
104
|
|
- // 新增日志
|
|
105
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), caseLogStatus, "");
|
|
106
|
|
- // 发送短信
|
|
107
|
|
- sendArbitratMethodMes(caseApplicationById, request, caseNum);
|
|
108
|
|
- }
|
|
|
119
|
+
|
|
|
120
|
+ return AjaxResult.success("审核成功");
|
|
109
|
121
|
}
|
|
110
|
|
- }
|
|
111
|
122
|
return AjaxResult.success();
|
|
112
|
123
|
}
|
|
113
|
124
|
|