|
|
@@ -1,394 +0,0 @@
|
|
1
|
|
-package com.ruoyi.web.controller.wisdomarbitrate;
|
|
2
|
|
-
|
|
3
|
|
-import cn.hutool.core.io.resource.ClassPathResource;
|
|
4
|
|
-import com.deepoove.poi.XWPFTemplate;
|
|
5
|
|
-import com.deepoove.poi.data.PictureRenderData;
|
|
6
|
|
-import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
7
|
|
-import com.ruoyi.common.core.domain.AjaxResult;
|
|
8
|
|
-import com.ruoyi.common.core.redis.RedisCache;
|
|
9
|
|
-import com.ruoyi.common.utils.EmailOutUtil;
|
|
10
|
|
-import com.ruoyi.common.utils.WordUtil;
|
|
11
|
|
-import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
|
|
12
|
|
-import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
|
13
|
|
-import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
|
14
|
|
-import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
|
15
|
|
-import com.ruoyi.wisdomarbitrate.mapper.*;
|
|
16
|
|
-import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
|
17
|
|
-import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService;
|
|
18
|
|
-import org.apache.poi.util.Units;
|
|
19
|
|
-import org.apache.poi.xwpf.usermodel.Document;
|
|
20
|
|
-import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
21
|
|
-import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
|
22
|
|
-import org.apache.poi.xwpf.usermodel.XWPFRun;
|
|
23
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
24
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
25
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
26
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
27
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
28
|
|
-
|
|
29
|
|
-import javax.imageio.ImageIO;
|
|
30
|
|
-import java.awt.image.BufferedImage;
|
|
31
|
|
-import java.io.*;
|
|
32
|
|
-import java.nio.file.Files;
|
|
33
|
|
-import java.nio.file.Path;
|
|
34
|
|
-import java.nio.file.StandardCopyOption;
|
|
35
|
|
-import java.text.SimpleDateFormat;
|
|
36
|
|
-import java.time.LocalDate;
|
|
37
|
|
-import java.util.*;
|
|
38
|
|
-import java.util.regex.Pattern;
|
|
39
|
|
-
|
|
40
|
|
-@RestController
|
|
41
|
|
-@RequestMapping
|
|
42
|
|
-public class TestPOIController {
|
|
43
|
|
-
|
|
44
|
|
- @Autowired
|
|
45
|
|
- private CaseApplicationMapper caseApplicationMapper;
|
|
46
|
|
- @Autowired
|
|
47
|
|
- private CaseAffiliateMapper caseAffiliateMapper;
|
|
48
|
|
- @Autowired
|
|
49
|
|
- private ArbitrateRecordMapper arbitrateRecordMapper;
|
|
50
|
|
- @Autowired
|
|
51
|
|
- private CaseAttachMapper caseAttachMapper;
|
|
52
|
|
- @Autowired
|
|
53
|
|
- private RedisCache redisCache;
|
|
54
|
|
- @Autowired
|
|
55
|
|
- private SendMailRecordMapper sendMailRecordMapper;
|
|
56
|
|
- @Autowired
|
|
57
|
|
- private ICaseApplicationService caseApplicationService;
|
|
58
|
|
-
|
|
59
|
|
- @GetMapping("/test")
|
|
60
|
|
- public AjaxResult createDocument(@RequestBody CaseApplication caseApplication) {
|
|
61
|
|
- try {
|
|
62
|
|
- Map<String, Object> datas = new HashMap<>();
|
|
63
|
|
- Long id = caseApplication.getId();
|
|
64
|
|
- if (id == null) {
|
|
65
|
|
- return null;
|
|
66
|
|
- }
|
|
67
|
|
- //获取案件详细信息
|
|
68
|
|
- CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
69
|
|
- //生成编码
|
|
70
|
|
- String equipmentNo = getNewEquipmentNo();
|
|
71
|
|
- datas.put("num", equipmentNo);
|
|
72
|
|
- //获取仲裁记录表里的相关信息
|
|
73
|
|
- ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
|
|
74
|
|
- arbitrateRecord.setCaseAppliId(id);
|
|
75
|
|
- ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
|
76
|
|
- //获取案件关联人信息
|
|
77
|
|
- CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
78
|
|
- caseAffiliate.setCaseAppliId(id);
|
|
79
|
|
- List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
80
|
|
- List<String> nameAgentList = new ArrayList<>();
|
|
81
|
|
- if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
|
82
|
|
- for (CaseAffiliate affiliate : caseAffiliates) {
|
|
83
|
|
- //获取身份类型
|
|
84
|
|
- int identityType = affiliate.getIdentityType();
|
|
85
|
|
- if (identityType == 1) { //申请人
|
|
86
|
|
- datas.put("appName", affiliate.getName());
|
|
87
|
|
- datas.put("appAddress", affiliate.getResidenAffili());
|
|
88
|
|
- datas.put("appContactAddress", affiliate.getContactAddress());
|
|
89
|
|
- datas.put("appLegalPerson", affiliate.getCompLegalPerson());
|
|
90
|
|
- datas.put("appLegalPersonTitle", affiliate.getCompLegalperPost());
|
|
91
|
|
- datas.put("appAgentName", affiliate.getNameAgent());
|
|
92
|
|
- datas.put("appAgentTitle", affiliate.getAppliAgentTitle());
|
|
93
|
|
- nameAgentList.add(affiliate.getNameAgent());
|
|
94
|
|
- } else if (identityType == 2) { //被申请人
|
|
95
|
|
- datas.put("resName", affiliate.getName());
|
|
96
|
|
- datas.put("resAddress", affiliate.getResidenAffili());
|
|
97
|
|
- String responSex = affiliate.getResponSex();
|
|
98
|
|
- if (responSex.equals("0")) {
|
|
99
|
|
- datas.put("resSex", "男");
|
|
100
|
|
- } else {
|
|
101
|
|
- datas.put("resSex", "女");
|
|
102
|
|
- }
|
|
103
|
|
- Date responBirth = affiliate.getResponBirth();
|
|
104
|
|
- if (responBirth != null) {
|
|
105
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
106
|
|
- String responBirthStr = sdf.format(responBirth);
|
|
107
|
|
- datas.put("resDateOfBirth", responBirthStr);
|
|
108
|
|
-
|
|
109
|
|
- }
|
|
110
|
|
- datas.put("resContactAddress", affiliate.getContactAddress());
|
|
111
|
|
- nameAgentList.add(affiliate.getNameAgent());
|
|
112
|
|
- }
|
|
113
|
|
- }
|
|
114
|
|
- }
|
|
115
|
|
- Date createTime = caseApplication1.getCreateTime();
|
|
116
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
117
|
|
- // 将日期格式化为字符串
|
|
118
|
|
- String createTimeStr = sdf.format(createTime);
|
|
119
|
|
- datas.put("submissionDate", createTimeStr);
|
|
120
|
|
- Date registerDate = caseApplication1.getRegisterDate();
|
|
121
|
|
- String registerDateStr = sdf.format(registerDate);
|
|
122
|
|
- datas.put("acceptDate", registerDateStr);
|
|
123
|
|
- //反请求
|
|
124
|
|
- Integer adjudicaCounter = caseApplication1.getAdjudicaCounter();
|
|
125
|
|
- String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
|
|
126
|
|
- "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" +
|
|
127
|
|
- "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
|
|
128
|
|
- if (adjudicaCounter == null) {
|
|
129
|
|
- datas.put("counterclaim", null);
|
|
130
|
|
- } else if (adjudicaCounter == 1) {
|
|
131
|
|
- datas.put("counterclaim", counterclaim);
|
|
132
|
|
- } else {
|
|
133
|
|
- datas.put("counterclaim", null);
|
|
134
|
|
- }
|
|
135
|
|
- //财产保全
|
|
136
|
|
- Integer properPreser = caseApplication1.getProperPreser();
|
|
137
|
|
- String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" +
|
|
138
|
|
- "第二十八条之规定,将该申请提交至法院。";
|
|
139
|
|
- if (properPreser == null) {
|
|
140
|
|
- datas.put("preservation", null);
|
|
141
|
|
- } else if (properPreser == 1) {
|
|
142
|
|
- datas.put("preservation", preservation);
|
|
143
|
|
- } else {
|
|
144
|
|
- datas.put("preservation", null);
|
|
145
|
|
- }
|
|
146
|
|
- //管辖权异议
|
|
147
|
|
- Integer objectiJuris = caseApplication1.getObjectiJuris();
|
|
148
|
|
- String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《XX管辖异议申请书》,认为XXXXXX" +
|
|
149
|
|
- ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
|
|
150
|
|
- if (objectiJuris == null) {
|
|
151
|
|
- datas.put("jurisdictionalObjection", null);
|
|
152
|
|
- } else if (objectiJuris == 1) {
|
|
153
|
|
- datas.put("jurisdictionalObjection", jurisdictionalObjection);
|
|
154
|
|
- } else {
|
|
155
|
|
- datas.put("jurisdictionalObjection", null);
|
|
156
|
|
- }
|
|
157
|
|
- String arbitratorName = caseApplication1.getArbitratorName();
|
|
158
|
|
- datas.put("arbitratorName", arbitratorName);
|
|
159
|
|
- Integer arbitratMethod = caseApplication1.getArbitratMethod();
|
|
160
|
|
- Date hearDate = caseApplication1.getHearDate();
|
|
161
|
|
- if (hearDate != null) {
|
|
162
|
|
- String hearDateStr = sdf.format(hearDate);
|
|
163
|
|
- //线上开庭时
|
|
164
|
|
- if (arbitratMethod == 1) {
|
|
165
|
|
- String onLine1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于";
|
|
166
|
|
- String onLine2 = "通过仲裁委智慧仲裁平台开庭审理了本案。";
|
|
167
|
|
- datas.put("onLine1", onLine1);
|
|
168
|
|
- datas.put("hearDate", hearDateStr);
|
|
169
|
|
- datas.put("onLine2", onLine2);
|
|
170
|
|
- } else {
|
|
171
|
|
- //书面仲裁时
|
|
172
|
|
- String written1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于";
|
|
173
|
|
- String written2 = "在仲裁委所在地开庭审理了本案。";
|
|
174
|
|
- datas.put("written1", written1);
|
|
175
|
|
- datas.put("hearDate1", hearDateStr);
|
|
176
|
|
- datas.put("written2", written2);
|
|
177
|
|
- }
|
|
178
|
|
- }
|
|
179
|
|
- Integer isAbsence = caseApplication1.getIsAbsence();
|
|
180
|
|
- if (isAbsence == null) {
|
|
181
|
|
- datas.put("absent1", null);
|
|
182
|
|
- datas.put("absent2", null);
|
|
183
|
|
- datas.put("absent3", null);
|
|
184
|
|
- datas.put("absent4", null);
|
|
185
|
|
- datas.put("absent5", null);
|
|
186
|
|
- datas.put("attend1", null);
|
|
187
|
|
- datas.put("attend2", null);
|
|
188
|
|
- datas.put("attend3", null);
|
|
189
|
|
- datas.put("attend4", null);
|
|
190
|
|
- datas.put("attend5", null);
|
|
191
|
|
- datas.put("attend6", null);
|
|
192
|
|
- datas.put("attend7", null);
|
|
193
|
|
- datas.put("appAgentName1", null);
|
|
194
|
|
- datas.put("appAgentName2", null);
|
|
195
|
|
- datas.put("resAgentName", null);
|
|
196
|
|
- } else if (isAbsence == 1) {
|
|
197
|
|
- //缺席审理
|
|
198
|
|
- String absent1 = "申请人的特别授权委托代理人";
|
|
199
|
|
- String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
|
|
200
|
|
- "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。";
|
|
201
|
|
- String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," +
|
|
202
|
|
- "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。";
|
|
203
|
|
- String absent4 = "(二/三)当事人提供的证据材料\n" +
|
|
204
|
|
- "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
|
|
205
|
|
- String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
|
|
206
|
|
- "第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
|
|
207
|
|
- datas.put("absent1", absent1);
|
|
208
|
|
- datas.put("absent2", absent2);
|
|
209
|
|
- datas.put("absent3", absent3);
|
|
210
|
|
- datas.put("absent4", absent4);
|
|
211
|
|
- datas.put("absent5", absent5);
|
|
212
|
|
- datas.put("appAgentName1", nameAgentList.get(0));
|
|
213
|
|
- } else {
|
|
214
|
|
- //出席审理
|
|
215
|
|
- String attend1 = "申请人的特别授权委托代理人";
|
|
216
|
|
- String attend2 = "和被申请人本人/的特别授权委托代理人";
|
|
217
|
|
- String attend3 = "出席了庭审。";
|
|
218
|
|
- String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" +
|
|
219
|
|
- "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," +
|
|
220
|
|
- "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," +
|
|
221
|
|
- "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。";
|
|
222
|
|
- String attend5 = "(二)被申请人的答辩意见";
|
|
223
|
|
- String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" +
|
|
224
|
|
- "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
|
|
225
|
|
- String attend7 = "被申请人对上述材料的质证意见为:";
|
|
226
|
|
- datas.put("attend1", attend1);
|
|
227
|
|
- datas.put("attend2", attend2);
|
|
228
|
|
- datas.put("attend3", attend3);
|
|
229
|
|
- datas.put("attend4", attend4);
|
|
230
|
|
- datas.put("attend5", attend5);
|
|
231
|
|
- datas.put("attend6", attend6);
|
|
232
|
|
- datas.put("attend7", attend7);
|
|
233
|
|
- datas.put("responCrossOpin", caseApplication1.getResponCrossOpin());
|
|
234
|
|
- datas.put("appAgentName2", nameAgentList.get(0));
|
|
235
|
|
- datas.put("resAgentName", nameAgentList.get(1));
|
|
236
|
|
- if (arbitratMethod == 1) {
|
|
237
|
|
- //被申出席+开庭
|
|
238
|
|
- String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
|
|
239
|
|
- "第五十一条的规定,裁决如下:";
|
|
240
|
|
- datas.put("attend8", attend8);
|
|
241
|
|
- } else {
|
|
242
|
|
- //被申出席+书面
|
|
243
|
|
- String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
|
|
244
|
|
- "第五十一条、第五十八条的规定,裁决如下:";
|
|
245
|
|
- datas.put("attend9", attend9);
|
|
246
|
|
- }
|
|
247
|
|
- }
|
|
248
|
|
- datas.put("claims", caseApplication1.getArbitratClaims());
|
|
249
|
|
- datas.put("request", caseApplication1.getRequestRule());
|
|
250
|
|
- CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication);
|
|
251
|
|
- List<CaseAttach> caseAttachList1 = caseApplication2.getCaseAttachList();
|
|
252
|
|
- if (caseAttachList1 != null && caseAttachList1.size() > 0) {
|
|
253
|
|
- for (CaseAttach caseAttach : caseAttachList1) {
|
|
254
|
|
- if (caseAttach.getAnnexType() == 6) { //被申请人证据材料
|
|
255
|
|
- String annexName = caseAttach.getAnnexName();
|
|
256
|
|
- boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
|
|
257
|
|
- if (isImageFile) {
|
|
258
|
|
- String prefix = "/profile";
|
|
259
|
|
- int startIndex = annexName.indexOf(prefix);
|
|
260
|
|
- startIndex += prefix.length();
|
|
261
|
|
- String annexPath = "/uploadPath" + annexName.substring(startIndex);
|
|
262
|
|
- System.out.println("路径是===========" + annexPath);
|
|
263
|
|
- PictureRenderData pictureRenderData = WordUtil
|
|
264
|
|
- .rebuildImageContent(100, 100, null, annexPath);
|
|
265
|
|
- datas.put("resEvidenceMaterial", pictureRenderData);
|
|
266
|
|
- }
|
|
267
|
|
- } else if (caseAttach.getAnnexType() == 2) { //申请人证据材料
|
|
268
|
|
- String annexName = caseAttach.getAnnexName();
|
|
269
|
|
- boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
|
|
270
|
|
- if (isImageFile) {
|
|
271
|
|
- String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath();
|
|
272
|
|
- System.out.println("路径是===========" + annexPath);
|
|
273
|
|
- PictureRenderData pictureRenderData = WordUtil
|
|
274
|
|
- .rebuildImageContent(100, 100, null, annexPath);
|
|
275
|
|
- //申请人证据材料
|
|
276
|
|
- datas.put("appEvidenceMaterial", pictureRenderData);
|
|
277
|
|
- }
|
|
278
|
|
- }
|
|
279
|
|
- }
|
|
280
|
|
- }
|
|
281
|
|
- datas.put("applicaCrossOpin", caseApplication1.getApplicaCrossOpin());
|
|
282
|
|
- if (arbitrateRecord1 != null) {
|
|
283
|
|
- datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
|
|
284
|
|
- datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink());
|
|
285
|
|
- datas.put("rulingFollows", arbitrateRecord1.getRulingFollows());
|
|
286
|
|
- }
|
|
287
|
|
- LocalDate now = LocalDate.now();
|
|
288
|
|
- String year = Integer.toString(now.getYear());
|
|
289
|
|
- datas.put("year", year);
|
|
290
|
|
- String month = String.format("%02d", now.getMonthValue());
|
|
291
|
|
- String day = String.format("%02d", now.getDayOfMonth());
|
|
292
|
|
- String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx";
|
|
293
|
|
- // String modalFilePath = "D:/develop/新裁决书模板.docx";
|
|
294
|
|
- String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
295
|
|
- // String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day;
|
|
296
|
|
- String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
|
|
297
|
|
- String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
298
|
|
- String resultFilePath = saveFolderPath + "/" + fileName;
|
|
299
|
|
- // 创建日期目录
|
|
300
|
|
- File saveFolder = new File(saveFolderPath);
|
|
301
|
|
- if (!saveFolder.exists()) {
|
|
302
|
|
- saveFolder.mkdirs();
|
|
303
|
|
- }
|
|
304
|
|
- Path sourcePath = new File(modalFilePath).toPath();
|
|
305
|
|
- Path destinationPath = new File(resultFilePath).toPath();
|
|
306
|
|
- Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
|
|
307
|
|
- String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
|
|
308
|
|
- File file = new File(docFilePath);
|
|
309
|
|
- if (file.exists()) {
|
|
310
|
|
- InputStream in = new FileInputStream(file);
|
|
311
|
|
- XWPFDocument xwpfDocument = new XWPFDocument(in);
|
|
312
|
|
- WordUtil.changeText(xwpfDocument);
|
|
313
|
|
- }
|
|
314
|
|
- String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
|
|
315
|
|
- CaseAttach caseAttach = CaseAttach.builder()
|
|
316
|
|
- .caseAppliId(id)
|
|
317
|
|
- .annexName(saveName)
|
|
318
|
|
- .annexPath(savePath)
|
|
319
|
|
- .annexType(3)
|
|
320
|
|
- .build();
|
|
321
|
|
- //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
|
|
322
|
|
- List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
|
|
323
|
|
- if (caseAttachList != null && caseAttachList.size() > 0) {
|
|
324
|
|
- //之前已经生成过了,更新
|
|
325
|
|
- int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
|
326
|
|
- } else {
|
|
327
|
|
- //之前没生成过,新增
|
|
328
|
|
- int i = caseAttachMapper.save(caseAttach);
|
|
329
|
|
- if (i > 0) {
|
|
330
|
|
- if (arbitrateRecord1 != null) {
|
|
331
|
|
- Integer annexId = caseAttach.getAnnexId();
|
|
332
|
|
- //将附件id保存到仲裁记录表里面
|
|
333
|
|
- arbitrateRecord1.setAnnexId(annexId);
|
|
334
|
|
- arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
|
|
335
|
|
- }
|
|
336
|
|
- }
|
|
337
|
|
- }
|
|
338
|
|
- //修改案件状态
|
|
339
|
|
- caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
|
|
340
|
|
- caseApplicationMapper.submitCaseApplication(caseApplication1);
|
|
341
|
|
- return AjaxResult.success("裁决书已生成");
|
|
342
|
|
- } catch(IOException e)
|
|
343
|
|
- {
|
|
344
|
|
- return AjaxResult.error(e + "请检查文件路径是否有误");
|
|
345
|
|
- }
|
|
346
|
|
-
|
|
347
|
|
-}
|
|
348
|
|
-
|
|
349
|
|
- public String getNewEquipmentNo() {
|
|
350
|
|
- Object awardNum = redisCache.getCacheObject("awardNum");
|
|
351
|
|
- if (awardNum == null) {
|
|
352
|
|
- redisCache.setCacheObject("awardNum", "00001");
|
|
353
|
|
- String s = redisCache.getCacheObject("awardNum").toString();
|
|
354
|
|
- // 字符串数字解析为整数
|
|
355
|
|
- int no = Integer.parseInt(s);
|
|
356
|
|
- // 最新设备编号自增1
|
|
357
|
|
- int newEquipment = ++no;
|
|
358
|
|
- // 将整数格式化为5位数字
|
|
359
|
|
- s = String.format("%05d", newEquipment);
|
|
360
|
|
- redisCache.setCacheObject("awardNum", s);
|
|
361
|
|
- return s;
|
|
362
|
|
- } else {
|
|
363
|
|
- String s = awardNum.toString();
|
|
364
|
|
- // 字符串数字解析为整数
|
|
365
|
|
- int no = Integer.parseInt(s);
|
|
366
|
|
- // 最新设备编号自增1
|
|
367
|
|
- int newEquipment = ++no;
|
|
368
|
|
- // 将整数格式化为5位数字
|
|
369
|
|
- s = String.format("%05d", newEquipment);
|
|
370
|
|
- redisCache.setCacheObject("awardNum", s);
|
|
371
|
|
- return s;
|
|
372
|
|
- }
|
|
373
|
|
- }
|
|
374
|
|
-
|
|
375
|
|
- public static void main(String[] args) throws Exception {
|
|
376
|
|
- Map<String, Object> datas = new HashMap<String, Object>() {
|
|
377
|
|
- {
|
|
378
|
|
- //本地图片
|
|
379
|
|
- put("resEvidenceMaterial", new PictureRenderData(100, 120, "D:\\develop\\Snipaste_2023-10-27_09-59-23.jpg"));
|
|
380
|
|
- //网路图片
|
|
381
|
|
- // put("urlPicture", new PictureRenderData(100, 100, ".png", BytePictureUtils.getUrlByteArray("https://avatars3.githubusercontent.com/u/1394854?v=3&s=40")));
|
|
382
|
|
- }
|
|
383
|
|
- };
|
|
384
|
|
-
|
|
385
|
|
- XWPFTemplate template = XWPFTemplate.compile("D:\\develop\\新裁决书模板.docx")
|
|
386
|
|
- .render(datas);
|
|
387
|
|
-
|
|
388
|
|
- FileOutputStream out = new FileOutputStream("D:\\develop\\out_picture.docx");
|
|
389
|
|
- template.write(out);
|
|
390
|
|
- out.flush();
|
|
391
|
|
- out.close();
|
|
392
|
|
- template.close();
|
|
393
|
|
- }
|
|
394
|
|
-}
|