|
|
@@ -2,11 +2,14 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
|
2
|
2
|
|
|
3
|
3
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
4
|
4
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
5
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
6
|
+import com.ruoyi.common.utils.SmsUtils;
|
|
5
|
7
|
import com.ruoyi.common.utils.StringUtils;
|
|
6
|
8
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
|
7
|
9
|
import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
|
|
8
|
10
|
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
|
9
|
11
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
|
|
12
|
+import com.ruoyi.wisdomarbitrate.mapper.ArbitratorMapper;
|
|
10
|
13
|
import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
|
|
11
|
14
|
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
|
12
|
15
|
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
|
|
@@ -15,10 +18,8 @@ import org.springframework.stereotype.Service;
|
|
15
|
18
|
import org.springframework.transaction.annotation.Transactional;
|
|
16
|
19
|
|
|
17
|
20
|
import java.lang.reflect.Field;
|
|
18
|
|
-import java.util.ArrayList;
|
|
19
|
|
-import java.util.Comparator;
|
|
20
|
|
-import java.util.List;
|
|
21
|
|
-import java.util.TreeSet;
|
|
|
21
|
+import java.text.SimpleDateFormat;
|
|
|
22
|
+import java.util.*;
|
|
22
|
23
|
import java.util.stream.Collectors;
|
|
23
|
24
|
|
|
24
|
25
|
import static com.ruoyi.common.core.domain.AjaxResult.error;
|
|
|
@@ -33,6 +34,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
33
|
34
|
@Autowired
|
|
34
|
35
|
private CaseAffiliateMapper caseAffiliateMapper;
|
|
35
|
36
|
|
|
|
37
|
+ @Autowired
|
|
|
38
|
+ private ArbitratorMapper arbitratorMapper;
|
|
|
39
|
+
|
|
36
|
40
|
|
|
37
|
41
|
@Override
|
|
38
|
42
|
public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
|
|
|
@@ -99,7 +103,20 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
99
|
103
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
100
|
104
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
101
|
105
|
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
102
|
|
- if(caseApplicationselect!=null){
|
|
|
106
|
+ if(caseAffiliatListeselect!=null){
|
|
|
107
|
+ StringBuffer applicantName = new StringBuffer();
|
|
|
108
|
+ StringBuffer respondentName = new StringBuffer();
|
|
|
109
|
+ for (int i = 0; i < caseAffiliatListeselect.size(); i++){
|
|
|
110
|
+ CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
|
|
|
111
|
+ int identityType = caseAffiliateselect.getIdentityType();
|
|
|
112
|
+ if(identityType==1){
|
|
|
113
|
+ applicantName.append(caseAffiliateselect.getName()).append(",");;
|
|
|
114
|
+ }else if(identityType==2){
|
|
|
115
|
+ respondentName.append(caseAffiliateselect.getName()).append(",");;
|
|
|
116
|
+ }
|
|
|
117
|
+ }
|
|
|
118
|
+ caseApplicationselect.setApplicantName(applicantName.toString());
|
|
|
119
|
+ caseApplicationselect.setRespondentName(respondentName.toString());
|
|
103
|
120
|
caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect);
|
|
104
|
121
|
}
|
|
105
|
122
|
return caseApplicationselect;
|
|
|
@@ -231,6 +248,66 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
231
|
248
|
return rows;
|
|
232
|
249
|
}
|
|
233
|
250
|
|
|
|
251
|
+ @Override
|
|
|
252
|
+ @Transactional
|
|
|
253
|
+ public int pendTralSure(CaseApplication caseApplication) {
|
|
|
254
|
+ caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD);
|
|
|
255
|
+ int rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
|
256
|
+
|
|
|
257
|
+ //发送短信通知
|
|
|
258
|
+ SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
|
259
|
+ request.setTemplateId("1931000");
|
|
|
260
|
+
|
|
|
261
|
+ CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
|
262
|
+ String caseNum = caseApplicationselect.getCaseNum();
|
|
|
263
|
+ Date hearDate = caseApplicationselect.getHearDate();
|
|
|
264
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
265
|
+ String hearDatestr = dateFormat.format(hearDate);
|
|
|
266
|
+
|
|
|
267
|
+ String arbitratorId = caseApplicationselect.getArbitratorId();
|
|
|
268
|
+ List<Arbitrator> arbitratorList = new ArrayList<>();
|
|
|
269
|
+ if(StringUtils.isNotEmpty(arbitratorId)){
|
|
|
270
|
+ String[] idStrList = arbitratorId.split(",");
|
|
|
271
|
+ List<Long> idList = new ArrayList<>();
|
|
|
272
|
+ for(int i = 0;i < idStrList.length;i ++ ){
|
|
|
273
|
+ idList.add(Long.parseLong(idStrList[i]));
|
|
|
274
|
+ }
|
|
|
275
|
+ Arbitrator arbitrator = new Arbitrator();
|
|
|
276
|
+ arbitrator.setIdList(idList);
|
|
|
277
|
+ arbitratorList = arbitratorMapper.selectArbitratorList(arbitrator);
|
|
|
278
|
+ if(arbitratorList!=null) {
|
|
|
279
|
+ for (int i = 0; i < arbitratorList.size(); i++) {
|
|
|
280
|
+ Arbitrator arbitratorselect = arbitratorList.get(i);
|
|
|
281
|
+ //给仲裁员发送短信通知
|
|
|
282
|
+ request.setPhone(arbitratorselect.getTelephone());
|
|
|
283
|
+ // 1931000 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
|
|
284
|
+ String name = arbitratorselect.getArbitratorName();
|
|
|
285
|
+ request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
|
|
|
286
|
+ SmsUtils.sendSms(request);
|
|
|
287
|
+ }
|
|
|
288
|
+ }
|
|
|
289
|
+ }
|
|
|
290
|
+
|
|
|
291
|
+ CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
|
292
|
+ caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
|
293
|
+ List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
|
294
|
+ if(caseAffiliatListeselect!=null) {
|
|
|
295
|
+ for (int j = 0; j < caseAffiliatListeselect.size(); j++) {
|
|
|
296
|
+ CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j);
|
|
|
297
|
+ int identityType = caseAffiliateselect.getIdentityType();
|
|
|
298
|
+ //给申请人、被申请人发送短信通知
|
|
|
299
|
+ request.setPhone(caseAffiliateselect.getContactTelphone());
|
|
|
300
|
+ // 1931000 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
|
|
301
|
+ String name = caseAffiliateselect.getName();
|
|
|
302
|
+ request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
|
|
|
303
|
+ SmsUtils.sendSms(request);
|
|
|
304
|
+ }
|
|
|
305
|
+ }
|
|
|
306
|
+
|
|
|
307
|
+ return rows;
|
|
|
308
|
+
|
|
|
309
|
+ }
|
|
|
310
|
+
|
|
234
|
311
|
@Override
|
|
235
|
312
|
@Transactional
|
|
236
|
313
|
public int pendingAppointArbotrar(CaseApplication caseApplication) {
|