|
|
@@ -3,8 +3,11 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
|
3
|
3
|
import com.deepoove.poi.config.Configure;
|
|
4
|
4
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
5
|
5
|
import com.ruoyi.common.utils.WordUtil;
|
|
|
6
|
+import com.ruoyi.wisdomarbitrate.domain.Adjudication;
|
|
|
7
|
+import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
|
|
6
|
8
|
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
|
7
|
9
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
|
|
10
|
+import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper;
|
|
8
|
11
|
import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
|
|
9
|
12
|
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
|
10
|
13
|
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
|
|
@@ -16,9 +19,9 @@ import java.io.FileInputStream;
|
|
16
|
19
|
import java.io.FileOutputStream;
|
|
17
|
20
|
import java.io.IOException;
|
|
18
|
21
|
import java.io.InputStream;
|
|
19
|
|
-import java.util.HashMap;
|
|
20
|
|
-import java.util.Map;
|
|
21
|
|
-import java.util.UUID;
|
|
|
22
|
+import java.time.LocalDate;
|
|
|
23
|
+import java.time.ZoneId;
|
|
|
24
|
+import java.util.*;
|
|
22
|
25
|
|
|
23
|
26
|
@Service
|
|
24
|
27
|
public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
|
@@ -26,18 +29,96 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
26
|
29
|
private CaseApplicationMapper caseApplicationMapper;
|
|
27
|
30
|
@Autowired
|
|
28
|
31
|
private CaseAffiliateMapper caseAffiliateMapper;
|
|
|
32
|
+ @Autowired
|
|
|
33
|
+ private ArbitrateRecordMapper arbitrateRecordMapper;
|
|
|
34
|
+
|
|
29
|
35
|
@Override
|
|
30
|
36
|
public AjaxResult createDocument(CaseApplication caseApplication) {
|
|
31
|
|
- CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
32
|
|
-
|
|
33
|
37
|
try {
|
|
34
|
38
|
Map<String, Object> datas = new HashMap<>();
|
|
35
|
|
- datas.put("1", "张三");
|
|
36
|
|
- String modalFilePath = "D:/develop/ceshi.docx";
|
|
|
39
|
+ Adjudication adjudication = new Adjudication();
|
|
|
40
|
+ Long id = caseApplication.getId();
|
|
|
41
|
+ if (id == null){
|
|
|
42
|
+ return null;
|
|
|
43
|
+ }
|
|
|
44
|
+ //获取案件详细信息
|
|
|
45
|
+ CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
|
46
|
+ //获取仲裁记录表里的相关信息
|
|
|
47
|
+ ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
|
|
|
48
|
+ arbitrateRecord.setCaseAppliId(id);
|
|
|
49
|
+ ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
|
|
50
|
+
|
|
|
51
|
+ //获取案件关联人信息
|
|
|
52
|
+ CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
|
53
|
+ caseAffiliate.setCaseAppliId(id);
|
|
|
54
|
+ List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
|
55
|
+ if (caseAffiliates != null && caseAffiliates.size() > 0){
|
|
|
56
|
+ for (CaseAffiliate affiliate : caseAffiliates){
|
|
|
57
|
+ //获取身份类型
|
|
|
58
|
+ int identityType = affiliate.getIdentityType();
|
|
|
59
|
+ if (identityType == 1) { //申请人
|
|
|
60
|
+ datas.put(adjudication.getAppName(), affiliate.getName());
|
|
|
61
|
+ datas.put(adjudication.getAppSex(), null);
|
|
|
62
|
+ datas.put(adjudication.getAppIDNo(), affiliate.getIdentityNum());
|
|
|
63
|
+ datas.put(adjudication.getAppAddress(), affiliate.getContactAddress());
|
|
|
64
|
+ datas.put(adjudication.getAppAgentName(), affiliate.getNameAgent());
|
|
|
65
|
+ datas.put(adjudication.getAppAgentIDNo(),affiliate.getIdentityNumAgent());
|
|
|
66
|
+ }else if (identityType == 2){ //被申请人
|
|
|
67
|
+ datas.put(adjudication.getResName(), affiliate.getName());
|
|
|
68
|
+ datas.put(adjudication.getResSex(), null);
|
|
|
69
|
+ datas.put(adjudication.getResIDNo(), affiliate.getIdentityNum());
|
|
|
70
|
+ datas.put(adjudication.getResAddress(), affiliate.getContactAddress());
|
|
|
71
|
+ datas.put(adjudication.getResAgentName(), affiliate.getNameAgent());
|
|
|
72
|
+ datas.put(adjudication.getResAgentName(),affiliate.getIdentityNumAgent());
|
|
|
73
|
+ }
|
|
|
74
|
+ }
|
|
|
75
|
+ }
|
|
|
76
|
+ String arbitratorName = caseApplication1.getArbitratorName();
|
|
|
77
|
+ datas.put(adjudication.getCaseName(),caseApplication1.getCaseName());
|
|
|
78
|
+ datas.put(adjudication.getArbitratorName(),arbitratorName);
|
|
|
79
|
+ LocalDate localDate = caseApplication1.getHearDate()
|
|
|
80
|
+ .toInstant()
|
|
|
81
|
+ .atZone(ZoneId.systemDefault())
|
|
|
82
|
+ .toLocalDate();
|
|
|
83
|
+ datas.put(adjudication.getHearYear(), localDate.getYear());
|
|
|
84
|
+ datas.put(adjudication.getHearMonths(), localDate.getMonthValue());
|
|
|
85
|
+ datas.put(adjudication.getHearDay(), localDate.getDayOfMonth());
|
|
|
86
|
+ datas.put(adjudication.getAppArbitrationClaims(), null);
|
|
|
87
|
+ datas.put(adjudication.getAppEvidenceName(), null);
|
|
|
88
|
+ datas.put(adjudication.getAppProveFacts(), null);
|
|
|
89
|
+ datas.put(adjudication.getResDefenseContentToApp(), null);
|
|
|
90
|
+ datas.put(adjudication.getResArbitrationClaims(), null);
|
|
|
91
|
+ datas.put(adjudication.getResEvidenceName(), null);
|
|
|
92
|
+ datas.put(adjudication.getResProveFacts(), null);
|
|
|
93
|
+ datas.put(adjudication.getAppDefenseContentToRes(), null);
|
|
|
94
|
+ datas.put(adjudication.getEvidenDetermi(), arbitrateRecord1.getEvidenDetermi());
|
|
|
95
|
+ datas.put(adjudication.getFactDetermi(), arbitrateRecord1.getFactDetermi());
|
|
|
96
|
+ datas.put(adjudication.getCaseSketch(), arbitrateRecord1.getCaseSketch());
|
|
|
97
|
+ datas.put(adjudication.getArbitrateThink(), arbitrateRecord1.getArbitrateThink());
|
|
|
98
|
+ datas.put(adjudication.getLegalProvisions(), null);
|
|
|
99
|
+ datas.put(adjudication.getRulingFollows(), arbitrateRecord1.getRulingFollows());
|
|
|
100
|
+ datas.put(adjudication.getUmpire(), null);
|
|
|
101
|
+ if (arbitratorName.contains(",")){
|
|
|
102
|
+ String[] nameArray = arbitratorName.split(",");
|
|
|
103
|
+ String firstName = nameArray[0];
|
|
|
104
|
+ String secondName = nameArray[1];
|
|
|
105
|
+ datas.put(adjudication.getArbitratorName1(), firstName);
|
|
|
106
|
+ datas.put(adjudication.getArbitratorName2(), secondName);
|
|
|
107
|
+ }else {
|
|
|
108
|
+ String secondName = "";
|
|
|
109
|
+ datas.put(adjudication.getArbitratorName1(), arbitratorName);
|
|
|
110
|
+ datas.put(adjudication.getArbitratorName2(), secondName);
|
|
|
111
|
+ }
|
|
|
112
|
+ LocalDate now = LocalDate.now();
|
|
|
113
|
+ datas.put(adjudication.getYear(), now.getYear());
|
|
|
114
|
+ datas.put(adjudication.getMonths(), now.getMonthValue());
|
|
|
115
|
+ datas.put(adjudication.getDay(), now.getDayOfMonth());
|
|
|
116
|
+ datas.put(adjudication.getClerk(), null);
|
|
|
117
|
+ String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
|
|
37
|
118
|
String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
|
|
38
|
119
|
String resultFilePath = "D:/data/" + fileName;
|
|
39
|
120
|
String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
|
|
40
|
|
- return AjaxResult.success("裁决书保存路径为"+docFilePath);
|
|
|
121
|
+ return AjaxResult.success("裁决书保存路径为" + docFilePath);
|
|
41
|
122
|
} catch (IOException e) {
|
|
42
|
123
|
e.printStackTrace();
|
|
43
|
124
|
}
|