|
|
@@ -1,6 +1,7 @@
|
|
1
|
1
|
package com.ruoyi.wisdomarbitrate.service.impl;
|
|
2
|
2
|
|
|
3
|
3
|
import com.deepoove.poi.config.Configure;
|
|
|
4
|
+import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
4
|
5
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
5
|
6
|
import com.ruoyi.common.utils.WordUtil;
|
|
6
|
7
|
import com.ruoyi.wisdomarbitrate.domain.*;
|
|
|
@@ -37,7 +38,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
37
|
38
|
public AjaxResult createDocument(CaseApplication caseApplication) {
|
|
38
|
39
|
try {
|
|
39
|
40
|
Map<String, Object> datas = new HashMap<>();
|
|
40
|
|
- Adjudication adjudication = new Adjudication();
|
|
41
|
41
|
Long id = caseApplication.getId();
|
|
42
|
42
|
if (id == null){
|
|
43
|
43
|
return null;
|
|
|
@@ -59,14 +59,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
59
|
59
|
int identityType = affiliate.getIdentityType();
|
|
60
|
60
|
if (identityType == 1) { //申请人
|
|
61
|
61
|
datas.put("appName", affiliate.getName());
|
|
62
|
|
- datas.put("appSex", null);
|
|
63
|
62
|
datas.put("appIDNo", affiliate.getIdentityNum());
|
|
64
|
63
|
datas.put("appAddress", affiliate.getContactAddress());
|
|
65
|
64
|
datas.put("appAgentName", affiliate.getNameAgent());
|
|
66
|
65
|
datas.put("appAgentIDNo",affiliate.getIdentityNumAgent());
|
|
67
|
66
|
}else if (identityType == 2){ //被申请人
|
|
68
|
67
|
datas.put("resName", affiliate.getName());
|
|
69
|
|
- datas.put("resSex", null);
|
|
70
|
68
|
datas.put("resIDNo", affiliate.getIdentityNum());
|
|
71
|
69
|
datas.put("resAddress", affiliate.getContactAddress());
|
|
72
|
70
|
datas.put("resAgentName", affiliate.getNameAgent());
|
|
|
@@ -77,35 +75,38 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
77
|
75
|
String arbitratorName = caseApplication1.getArbitratorName();
|
|
78
|
76
|
datas.put("caseName",caseApplication1.getCaseName());
|
|
79
|
77
|
datas.put("arbitratorName",arbitratorName);
|
|
80
|
|
- LocalDate localDate = caseApplication1.getHearDate()
|
|
81
|
|
- .toInstant()
|
|
82
|
|
- .atZone(ZoneId.systemDefault())
|
|
83
|
|
- .toLocalDate();
|
|
84
|
|
- datas.put("hearYear", localDate.getYear());
|
|
85
|
|
- datas.put("hearMonths", localDate.getMonthValue());
|
|
86
|
|
- datas.put("hearDay", localDate.getDayOfMonth());
|
|
87
|
|
- datas.put("appArbitrationClaims", null);
|
|
88
|
|
- datas.put("appEvidenceName", null);
|
|
89
|
|
- datas.put("appProveFacts", null);
|
|
90
|
|
- datas.put("resDefenseContentToApp", null);
|
|
91
|
|
- datas.put("resArbitrationClaims", null);
|
|
92
|
|
- datas.put("resEvidenceName", null);
|
|
93
|
|
- datas.put("resProveFacts", null);
|
|
94
|
|
- datas.put("appDefenseContentToRes", null);
|
|
95
|
|
- datas.put("evidenDetermi", arbitrateRecord1.getEvidenDetermi());
|
|
96
|
|
- datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
|
|
97
|
|
- datas.put("caseSketch", arbitrateRecord1.getCaseSketch());
|
|
98
|
|
- datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink());
|
|
99
|
|
- datas.put("legalProvisions", null);
|
|
100
|
|
- datas.put("rulingFollows", arbitrateRecord1.getRulingFollows());
|
|
101
|
|
- datas.put("umpire", null);
|
|
102
|
|
- if (arbitratorName.contains(",")){
|
|
|
78
|
+ Date hearDate = caseApplication1.getHearDate();
|
|
|
79
|
+ if (hearDate != null) {
|
|
|
80
|
+ LocalDate localDate = hearDate.toInstant()
|
|
|
81
|
+ .atZone(ZoneId.systemDefault())
|
|
|
82
|
+ .toLocalDate();
|
|
|
83
|
+ datas.put("hearYear", localDate.getYear());
|
|
|
84
|
+ datas.put("hearMonths", localDate.getMonthValue());
|
|
|
85
|
+ datas.put("hearDay", localDate.getDayOfMonth());
|
|
|
86
|
+ }else {
|
|
|
87
|
+ datas.put("hearYear", null);
|
|
|
88
|
+ datas.put("hearMonths", null);
|
|
|
89
|
+ datas.put("hearDay", null);
|
|
|
90
|
+ }
|
|
|
91
|
+ datas.put("appArbitrationClaims", caseApplication1.getArbitratClaims());
|
|
|
92
|
+ if (arbitrateRecord1!=null){
|
|
|
93
|
+ datas.put("evidenDetermi", arbitrateRecord1.getEvidenDetermi());
|
|
|
94
|
+ datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
|
|
|
95
|
+ datas.put("caseSketch", arbitrateRecord1.getCaseSketch());
|
|
|
96
|
+ datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink());
|
|
|
97
|
+ datas.put("rulingFollows", arbitrateRecord1.getRulingFollows());
|
|
|
98
|
+ }
|
|
|
99
|
+ datas.put("legalProvisions", "仲裁法");
|
|
|
100
|
+ if (arbitratorName==null){
|
|
|
101
|
+ datas.put("arbitratorName1", null);
|
|
|
102
|
+ datas.put("arbitratorName2", null);
|
|
|
103
|
+ }else if (arbitratorName.contains(",")){
|
|
103
|
104
|
String[] nameArray = arbitratorName.split(",");
|
|
104
|
105
|
String firstName = nameArray[0];
|
|
105
|
106
|
String secondName = nameArray[1];
|
|
106
|
107
|
datas.put("arbitratorName1", firstName);
|
|
107
|
108
|
datas.put("arbitratorName2", secondName);
|
|
108
|
|
- }else {
|
|
|
109
|
+ } else {
|
|
109
|
110
|
String secondName = "";
|
|
110
|
111
|
datas.put("arbitratorName1", arbitratorName);
|
|
111
|
112
|
datas.put("arbitratorName2", secondName);
|
|
|
@@ -114,19 +115,24 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
114
|
115
|
datas.put("year", now.getYear());
|
|
115
|
116
|
datas.put("months", now.getMonthValue());
|
|
116
|
117
|
datas.put("day", now.getDayOfMonth());
|
|
117
|
|
- datas.put("clerk", null);
|
|
118
|
118
|
String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
|
|
119
|
|
-
|
|
120
|
|
- String currentDateStr = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
121
|
|
- String saveFolderPath = "/data/arbitrate-document/formal/" + currentDateStr;
|
|
|
119
|
+ //String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
|
|
|
120
|
+ String saveFolderPath = "/data/arbitrate-document/formal/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
|
|
|
121
|
+ //String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
|
|
|
122
|
+ String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
|
|
|
123
|
+ String resultFilePath = saveFolderPath + "/" + fileName;
|
|
122
|
124
|
// 创建日期目录
|
|
123
|
125
|
File saveFolder = new File(saveFolderPath);
|
|
124
|
126
|
if (!saveFolder.exists()) {
|
|
125
|
127
|
saveFolder.mkdirs();
|
|
126
|
128
|
}
|
|
127
|
|
- String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
|
|
128
|
|
- String resultFilePath = saveFolderPath+ fileName;
|
|
129
|
|
- String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
|
|
|
129
|
+ Path sourcePath = new File(modalFilePath).toPath();
|
|
|
130
|
+ Path destinationPath = new File(resultFilePath).toPath();
|
|
|
131
|
+ Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
|
|
|
132
|
+ String docFilePath = WordUtil.getDocFilePath(datas,modalFilePath,resultFilePath);
|
|
|
133
|
+ //修改案件状态
|
|
|
134
|
+ caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
|
|
|
135
|
+ caseApplicationMapper.submitCaseApplication(caseApplication1);
|
|
130
|
136
|
//将裁决书保存到附件表里
|
|
131
|
137
|
CaseAttach caseAttach = CaseAttach.builder()
|
|
132
|
138
|
.caseAppliId(id)
|
|
|
@@ -136,12 +142,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
136
|
142
|
.build();
|
|
137
|
143
|
int i = caseAttachMapper.save(caseAttach);
|
|
138
|
144
|
if (i>0){
|
|
139
|
|
- Integer annexId = caseAttach.getAnnexId();
|
|
140
|
|
- //将附件id保存到仲裁记录表里面
|
|
141
|
|
- arbitrateRecord1.setAnnexId(annexId);
|
|
142
|
|
- arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
|
|
|
145
|
+ if (arbitrateRecord1!=null){
|
|
|
146
|
+ Integer annexId = caseAttach.getAnnexId();
|
|
|
147
|
+ //将附件id保存到仲裁记录表里面
|
|
|
148
|
+ arbitrateRecord1.setAnnexId(annexId);
|
|
|
149
|
+ arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
|
|
|
150
|
+ }
|
|
143
|
151
|
}
|
|
144
|
|
- return AjaxResult.success("裁决书保存路径为" + docFilePath);
|
|
|
152
|
+ return AjaxResult.success("裁决书已生成");
|
|
145
|
153
|
} catch (IOException e) {
|
|
146
|
154
|
e.printStackTrace();
|
|
147
|
155
|
}
|