|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+package com.ruoyi.wisdomarbitrate.service.impl;
|
|
|
2
|
+
|
|
|
3
|
+import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
|
4
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
5
|
+import com.ruoyi.common.utils.SmsUtils;
|
|
|
6
|
+import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
|
|
7
|
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
|
|
8
|
+import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
|
|
|
9
|
+import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
|
|
10
|
+import com.ruoyi.wisdomarbitrate.service.ICaseArbitrateService;
|
|
|
11
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
12
|
+import org.springframework.stereotype.Service;
|
|
|
13
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
14
|
+
|
|
|
15
|
+import java.util.List;
|
|
|
16
|
+
|
|
|
17
|
+@Service
|
|
|
18
|
+public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
|
19
|
+ @Autowired
|
|
|
20
|
+ private CaseApplicationMapper caseApplicationMapper;
|
|
|
21
|
+ @Autowired
|
|
|
22
|
+ private CaseAffiliateMapper caseAffiliateMapper;
|
|
|
23
|
+
|
|
|
24
|
+ @Override
|
|
|
25
|
+ @Transactional
|
|
|
26
|
+ public AjaxResult chooseArbitrateMethod(CaseApplication caseApplication, Integer arbitratMethod) {
|
|
|
27
|
+ if (arbitratMethod != null) {
|
|
|
28
|
+ String arbitratMethodStr = arbitratMethod == 1 ? "开庭审理" : "书面审理";
|
|
|
29
|
+ //查询案件详细信息
|
|
|
30
|
+ CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
|
31
|
+ if (caseApplication1 == null) {
|
|
|
32
|
+ return AjaxResult.error();
|
|
|
33
|
+ }
|
|
|
34
|
+ String caseNum = caseApplication1.getCaseNum();
|
|
|
35
|
+ //选择仲裁方式
|
|
|
36
|
+ caseApplication.setArbitratMethod(arbitratMethod);
|
|
|
37
|
+ //修改案件状态为待开庭
|
|
|
38
|
+ caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT);
|
|
|
39
|
+ int i = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
|
40
|
+ if (i > 0) {
|
|
|
41
|
+ //发送短信通知
|
|
|
42
|
+ SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
|
43
|
+ request.setTemplateId("1931000");
|
|
|
44
|
+ CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
|
45
|
+ caseAffiliate.setCaseAppliId(caseApplication1.getId());
|
|
|
46
|
+ List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息
|
|
|
47
|
+ if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
|
|
48
|
+ for (CaseAffiliate affiliate : caseAffiliates) {
|
|
|
49
|
+ //获取身份类型
|
|
|
50
|
+ int identityType = affiliate.getIdentityType();
|
|
|
51
|
+ if (identityType == 1) { //申请人
|
|
|
52
|
+ request.setPhone(affiliate.getContactTelphone());
|
|
|
53
|
+ // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
|
|
|
54
|
+ // 1931000 普通短信 确定仲裁方式通知 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
|
|
55
|
+ String name = affiliate.getName();
|
|
|
56
|
+ request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
|
|
|
57
|
+ SmsUtils.sendSms(request);
|
|
|
58
|
+ } else { //被申请人
|
|
|
59
|
+ request.setPhone(affiliate.getContactTelphone());
|
|
|
60
|
+ // 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。
|
|
|
61
|
+ String name = affiliate.getName();
|
|
|
62
|
+ request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
|
|
|
63
|
+ SmsUtils.sendSms(request);
|
|
|
64
|
+ }
|
|
|
65
|
+ }
|
|
|
66
|
+ }
|
|
|
67
|
+ return AjaxResult.success("选择成功");
|
|
|
68
|
+ }
|
|
|
69
|
+
|
|
|
70
|
+ }
|
|
|
71
|
+ return AjaxResult.error("请选择开庭方式");
|
|
|
72
|
+ }
|
|
|
73
|
+
|
|
|
74
|
+ @Override
|
|
|
75
|
+ public AjaxResult writtenHear(CaseApplication caseApplication, String accidentDescription, String arbitrationResult) {
|
|
|
76
|
+ //提交仲裁结果
|
|
|
77
|
+ // caseApplication.set(accidentDescription); //案情描述
|
|
|
78
|
+ // caseApplication.set(arbitrationResult); //仲裁结果
|
|
|
79
|
+ int i = caseApplicationMapper.updataCaseApplication(caseApplication);
|
|
|
80
|
+ if (i>0){
|
|
|
81
|
+ return AjaxResult.success("提交成功");
|
|
|
82
|
+ }
|
|
|
83
|
+ return AjaxResult.error("暂无需要提交仲裁结果的案件");
|
|
|
84
|
+ }
|
|
|
85
|
+}
|