|
|
@@ -24,6 +24,8 @@ import java.util.*;
|
|
24
|
24
|
import java.util.function.Function;
|
|
25
|
25
|
import java.util.stream.Collectors;
|
|
26
|
26
|
|
|
|
27
|
+import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
|
|
28
|
+
|
|
27
|
29
|
@Service
|
|
28
|
30
|
public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
29
|
31
|
@Autowired
|
|
|
@@ -36,6 +38,8 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
36
|
38
|
private ArbitrateRecordMapper arbitrateRecordMapper;
|
|
37
|
39
|
@Autowired
|
|
38
|
40
|
private CaseAttachMapper caseAttachMapper;
|
|
|
41
|
+ @Autowired
|
|
|
42
|
+ private SmsRecordMapper smsRecordMapper;
|
|
39
|
43
|
|
|
40
|
44
|
@Override
|
|
41
|
45
|
@Transactional
|
|
|
@@ -46,117 +50,79 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
46
|
50
|
return AjaxResult.success();
|
|
47
|
51
|
}
|
|
48
|
52
|
Integer arbitratMethod = caseApplication1.getArbitratMethod();
|
|
49
|
|
- if(arbitratMethod==null) {
|
|
|
53
|
+ if (arbitratMethod == null) {
|
|
50
|
54
|
return AjaxResult.error("请先指定仲裁方式");
|
|
51
|
55
|
}
|
|
52
|
|
- String caseNum = caseApplication1.getCaseNum();
|
|
53
|
|
- if (opinion == 0) { //拒绝
|
|
54
|
|
- if (arbitratMethod == 2) {
|
|
55
|
|
- caseApplication1.setArbitratMethod(1); // 更改仲裁方式
|
|
56
|
|
- //修改案件状态为待开庭审理
|
|
|
56
|
+ String caseNum = caseApplication1.getCaseNum();
|
|
|
57
|
+ if (opinion == 0) { //拒绝
|
|
|
58
|
+ if (arbitratMethod == 2) {
|
|
|
59
|
+ caseApplication1.setArbitratMethod(1); // 更改仲裁方式
|
|
|
60
|
+ //修改案件状态为待开庭审理
|
|
57
|
61
|
// caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
|
|
58
|
|
- //修改案件状态为待修改开庭时间
|
|
59
|
|
- caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
|
|
60
|
|
- // 新增日志
|
|
61
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
|
|
62
|
|
-
|
|
63
|
|
- } else {
|
|
64
|
|
- caseApplication1.setArbitratMethod(2);
|
|
65
|
|
- //修改案件状态为待书面审理
|
|
66
|
|
- caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
|
|
67
|
|
- // 新增日志
|
|
68
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
|
|
|
62
|
+ //修改案件状态为待修改开庭时间
|
|
|
63
|
+ caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
|
|
|
64
|
+ // 新增日志
|
|
|
65
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
|
|
69
|
66
|
|
|
70
|
|
- }
|
|
71
|
67
|
} else {
|
|
72
|
|
- if (arbitratMethod == 2) {
|
|
73
|
|
- //修改案件状态为待书面审理
|
|
74
|
|
- caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
|
|
75
|
|
- // 新增日志
|
|
76
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
|
|
|
68
|
+ caseApplication1.setArbitratMethod(2);
|
|
|
69
|
+ //修改案件状态为待书面审理
|
|
|
70
|
+ caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
|
|
|
71
|
+ // 新增日志
|
|
|
72
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
|
|
77
|
73
|
|
|
78
|
|
- } else {
|
|
79
|
|
- //修改案件状态为待开庭审理
|
|
|
74
|
+ }
|
|
|
75
|
+ } else {
|
|
|
76
|
+ if (arbitratMethod == 2) {
|
|
|
77
|
+ //修改案件状态为待书面审理
|
|
|
78
|
+ caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
|
|
|
79
|
+ // 新增日志
|
|
|
80
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
|
|
|
81
|
+
|
|
|
82
|
+ } else {
|
|
|
83
|
+ //修改案件状态为待开庭审理
|
|
80
|
84
|
// caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
|
|
81
|
|
- //修改案件状态为待修改开庭时间
|
|
82
|
|
- caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
|
|
83
|
|
- // 新增日志
|
|
84
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
|
|
|
85
|
+ //修改案件状态为待修改开庭时间
|
|
|
86
|
+ caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
|
|
|
87
|
+ // 新增日志
|
|
|
88
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
|
|
85
|
89
|
|
|
86
|
|
- }
|
|
87
|
90
|
}
|
|
88
|
|
- int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
|
|
89
|
|
- if (i > 0) {
|
|
90
|
|
- String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理";
|
|
91
|
|
- //发送短信通知
|
|
92
|
|
- SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
|
91
|
+ }
|
|
|
92
|
+ int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
|
|
|
93
|
+ if (i > 0) {
|
|
|
94
|
+ String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理";
|
|
|
95
|
+ //发送短信通知
|
|
|
96
|
+ SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
93
|
97
|
|
|
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
|
|
- }
|
|
|
98
|
+ CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
|
99
|
+ caseAffiliate.setCaseAppliId(caseApplication1.getId());
|
|
|
100
|
+ List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息
|
|
|
101
|
+ if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
|
|
102
|
+ for (CaseAffiliate affiliate : caseAffiliates) {
|
|
|
103
|
+ request.setTemplateId("1931000");
|
|
|
104
|
+ request.setPhone(affiliate.getContactTelphone());
|
|
|
105
|
+ // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
|
|
|
106
|
+ // 1931000 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
|
|
107
|
+ String name = affiliate.getName();
|
|
|
108
|
+ request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
|
|
|
109
|
+ if (SmsUtils.sendSms(request)) {
|
|
|
110
|
+ //保存短信发送记录
|
|
|
111
|
+ SmsSendRecord smsSendRecord = new SmsSendRecord();
|
|
|
112
|
+ smsSendRecord.setCaseId(caseApplication.getId());
|
|
|
113
|
+ smsSendRecord.setPhone(request.getPhone());
|
|
|
114
|
+ smsSendRecord.setSendTime(new Date());
|
|
|
115
|
+ String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,仲裁方式已确定为" + arbitratMethodStr + ",请知晓,如非本人操作,请忽略本短信。";
|
|
|
116
|
+ smsSendRecord.setSendContent(content);
|
|
|
117
|
+ smsSendRecord.setCreateBy(getUsername());
|
|
|
118
|
+ smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
|
117
|
119
|
}
|
|
118
|
120
|
}
|
|
119
|
|
-
|
|
120
|
|
- return AjaxResult.success("审核成功");
|
|
121
|
121
|
}
|
|
122
|
|
- return AjaxResult.success();
|
|
123
|
|
- }
|
|
124
|
122
|
|
|
125
|
|
- /**
|
|
126
|
|
- * 发送短信
|
|
127
|
|
- * @param caseApplicationById
|
|
128
|
|
- * @param request
|
|
129
|
|
- * @param caseNum
|
|
130
|
|
- */
|
|
131
|
|
- private void sendArbitratMethodMes(CaseApplication caseApplicationById, SmsUtils.SendSmsRequest request, String caseNum) {
|
|
132
|
|
- String arbitratMethodStr = caseApplicationById.getArbitratMethod() == 1 ? "开庭审理" : "书面审理";
|
|
133
|
|
-
|
|
134
|
|
- CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
135
|
|
- caseAffiliate.setCaseAppliId(caseApplicationById.getId());
|
|
136
|
|
- List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息
|
|
137
|
|
- if (CollectionUtil.isEmpty(caseAffiliates)) {
|
|
138
|
|
- return;
|
|
139
|
|
- }
|
|
140
|
|
- for (CaseAffiliate affiliate : caseAffiliates) {
|
|
141
|
|
- //获取身份类型
|
|
142
|
|
- int identityType = affiliate.getIdentityType();
|
|
143
|
|
- if (identityType == 1) { //申请人
|
|
144
|
|
- request.setTemplateId("1931000");
|
|
145
|
|
- request.setPhone(affiliate.getContactTelphone());
|
|
146
|
|
- // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
|
|
147
|
|
- // 1931000 普通短信 确定仲裁方式通知 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
|
148
|
|
- String name = affiliate.getName();
|
|
149
|
|
- request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
|
|
150
|
|
- SmsUtils.sendSms(request);
|
|
151
|
|
- } else { //被申请人
|
|
152
|
|
- request.setTemplateId("1928006");
|
|
153
|
|
- request.setPhone(affiliate.getContactTelphone());
|
|
154
|
|
- // 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。
|
|
155
|
|
- String name = affiliate.getName();
|
|
156
|
|
- request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
|
|
157
|
|
- SmsUtils.sendSms(request);
|
|
158
|
|
- }
|
|
|
123
|
+ return AjaxResult.success("审核成功");
|
|
159
|
124
|
}
|
|
|
125
|
+ return AjaxResult.success();
|
|
160
|
126
|
}
|
|
161
|
127
|
|
|
162
|
128
|
@Override
|
|
|
@@ -170,36 +136,36 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
170
|
136
|
|
|
171
|
137
|
//先判断案件是否已经提交过仲裁结果
|
|
172
|
138
|
ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
|
173
|
|
- if (arbitrateRecord1!=null){
|
|
|
139
|
+ if (arbitrateRecord1 != null) {
|
|
174
|
140
|
int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
|
|
175
|
|
- if (i>0){
|
|
|
141
|
+ if (i > 0) {
|
|
176
|
142
|
//案件日志表里添加数据
|
|
177
|
143
|
CaseLogRecord caseLogRecord = new CaseLogRecord();
|
|
178
|
144
|
caseLogRecord.setCaseAppliId(caseApplication1.getId());
|
|
179
|
145
|
caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
|
|
180
|
|
- if (createBy!=null){
|
|
|
146
|
+ if (createBy != null) {
|
|
181
|
147
|
caseLogRecord.setCreateBy(createBy);
|
|
182
|
148
|
}
|
|
183
|
149
|
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
|
|
184
|
150
|
// 新增日志
|
|
185
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.GENERATED_ARBITRATION,"");
|
|
|
151
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
|
|
186
|
152
|
|
|
187
|
153
|
}
|
|
188
|
|
- }else {
|
|
|
154
|
+ } else {
|
|
189
|
155
|
//提交仲裁结果
|
|
190
|
|
- int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord);
|
|
|
156
|
+ int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord);
|
|
191
|
157
|
|
|
192
|
|
- if (i>0){
|
|
|
158
|
+ if (i > 0) {
|
|
193
|
159
|
//案件日志表里添加数据
|
|
194
|
160
|
CaseLogRecord caseLogRecord = new CaseLogRecord();
|
|
195
|
161
|
caseLogRecord.setCaseAppliId(caseApplication1.getId());
|
|
196
|
162
|
caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
|
|
197
|
|
- if (createBy!=null){
|
|
|
163
|
+ if (createBy != null) {
|
|
198
|
164
|
caseLogRecord.setCreateBy(createBy);
|
|
199
|
165
|
}
|
|
200
|
166
|
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
|
|
201
|
167
|
// 新增日志
|
|
202
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.GENERATED_ARBITRATION,"");
|
|
|
168
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
|
|
203
|
169
|
|
|
204
|
170
|
}
|
|
205
|
171
|
}
|