|
|
@@ -3,21 +3,27 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
|
3
|
3
|
import cn.hutool.core.collection.CollectionUtil;
|
|
4
|
4
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
5
|
5
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
6
|
+import com.ruoyi.common.core.redis.RedisCache;
|
|
6
|
7
|
import com.ruoyi.common.utils.WordUtil;
|
|
7
|
8
|
import com.ruoyi.wisdomarbitrate.domain.*;
|
|
8
|
9
|
import com.ruoyi.wisdomarbitrate.mapper.*;
|
|
|
10
|
+import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
|
9
|
11
|
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
|
10
|
12
|
import com.ruoyi.common.utils.SmsUtils;
|
|
11
|
13
|
import com.ruoyi.wisdomarbitrate.service.ICaseArbitrateService;
|
|
|
14
|
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
12
|
15
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
13
|
16
|
import org.springframework.stereotype.Service;
|
|
14
|
17
|
import org.springframework.transaction.annotation.Transactional;
|
|
15
|
18
|
|
|
16
|
19
|
import java.io.File;
|
|
|
20
|
+import java.io.FileInputStream;
|
|
17
|
21
|
import java.io.IOException;
|
|
|
22
|
+import java.io.InputStream;
|
|
18
|
23
|
import java.nio.file.Files;
|
|
19
|
24
|
import java.nio.file.Path;
|
|
20
|
25
|
import java.nio.file.StandardCopyOption;
|
|
|
26
|
+import java.text.SimpleDateFormat;
|
|
21
|
27
|
import java.time.LocalDate;
|
|
22
|
28
|
import java.time.ZoneId;
|
|
23
|
29
|
import java.util.*;
|
|
|
@@ -40,6 +46,10 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
40
|
46
|
private CaseAttachMapper caseAttachMapper;
|
|
41
|
47
|
@Autowired
|
|
42
|
48
|
private SmsRecordMapper smsRecordMapper;
|
|
|
49
|
+ @Autowired
|
|
|
50
|
+ private IAdjudicationService adjudicationService;
|
|
|
51
|
+ @Autowired
|
|
|
52
|
+ private RedisCache redisCache;
|
|
43
|
53
|
|
|
44
|
54
|
@Override
|
|
45
|
55
|
@Transactional
|
|
|
@@ -155,7 +165,6 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
155
|
165
|
} else {
|
|
156
|
166
|
//提交仲裁结果
|
|
157
|
167
|
int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord);
|
|
158
|
|
-
|
|
159
|
168
|
if (i > 0) {
|
|
160
|
169
|
//案件日志表里添加数据
|
|
161
|
170
|
CaseLogRecord caseLogRecord = new CaseLogRecord();
|
|
|
@@ -167,16 +176,29 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
167
|
176
|
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
|
|
168
|
177
|
// 新增日志
|
|
169
|
178
|
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
|
|
170
|
|
-
|
|
171
|
179
|
}
|
|
172
|
180
|
}
|
|
|
181
|
+ Boolean aBoolean1 = generateAward(arbitrateRecord);
|
|
|
182
|
+ if (aBoolean1) {
|
|
|
183
|
+ //修改案件状态
|
|
|
184
|
+ caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
|
|
|
185
|
+ int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
|
|
|
186
|
+ if (i > 0) {
|
|
|
187
|
+ return AjaxResult.success("审理成功");
|
|
|
188
|
+ }
|
|
|
189
|
+ }
|
|
|
190
|
+ return AjaxResult.error("裁决书生成有误");
|
|
|
191
|
+ }
|
|
|
192
|
+
|
|
173
|
193
|
|
|
174
|
|
- //生成庭审笔录
|
|
|
194
|
+ //生成庭审笔录
|
|
|
195
|
+ private Boolean generateTrialTranscripts(ArbitrateRecord arbitrateRecord) {
|
|
175
|
196
|
try {
|
|
176
|
197
|
Map<String, Object> datas = new HashMap<>();
|
|
177
|
|
- Long id = caseApplication.getId();
|
|
178
|
|
-
|
|
179
|
|
-
|
|
|
198
|
+ Long id = arbitrateRecord.getCaseAppliId();
|
|
|
199
|
+ CaseApplication caseApplication = new CaseApplication();
|
|
|
200
|
+ caseApplication.setId(id);
|
|
|
201
|
+ CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
180
|
202
|
//获取案件关联人信息
|
|
181
|
203
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
182
|
204
|
caseAffiliate.setCaseAppliId(id);
|
|
|
@@ -200,10 +222,10 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
200
|
222
|
}
|
|
201
|
223
|
}
|
|
202
|
224
|
}
|
|
203
|
|
- String arbitratorName = caseApplication.getArbitratorName();
|
|
204
|
|
- datas.put("caseName", caseApplication.getCaseName());
|
|
|
225
|
+ String arbitratorName = caseApplication1.getArbitratorName();
|
|
|
226
|
+ datas.put("caseName", caseApplication1.getCaseName());
|
|
205
|
227
|
datas.put("arbitratorName", arbitratorName);
|
|
206
|
|
- Date hearDate = caseApplication.getHearDate();
|
|
|
228
|
+ Date hearDate = caseApplication1.getHearDate();
|
|
207
|
229
|
if (hearDate != null) {
|
|
208
|
230
|
LocalDate localDate = hearDate.toInstant()
|
|
209
|
231
|
.atZone(ZoneId.systemDefault())
|
|
|
@@ -216,7 +238,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
216
|
238
|
datas.put("hearMonths", null);
|
|
217
|
239
|
datas.put("hearDay", null);
|
|
218
|
240
|
}
|
|
219
|
|
- datas.put("appArbitrationClaims", caseApplication.getArbitratClaims());
|
|
|
241
|
+ datas.put("appArbitrationClaims", caseApplication1.getArbitratClaims());
|
|
220
|
242
|
datas.put("evidenDetermi", arbitrateRecord.getEvidenDetermi());
|
|
221
|
243
|
datas.put("factDetermi", arbitrateRecord.getFactDetermi());
|
|
222
|
244
|
datas.put("caseSketch", arbitrateRecord.getCaseSketch());
|
|
|
@@ -231,9 +253,9 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
231
|
253
|
datas.put("months", month);
|
|
232
|
254
|
datas.put("day", day);
|
|
233
|
255
|
String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
|
|
234
|
|
-// String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
|
|
|
256
|
+ //String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
|
|
235
|
257
|
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
236
|
|
-// String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
|
|
|
258
|
+ //String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
|
|
237
|
259
|
String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
|
|
238
|
260
|
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
239
|
261
|
String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
@@ -247,34 +269,321 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
|
247
|
269
|
Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
|
|
248
|
270
|
String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
|
|
249
|
271
|
String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
|
|
250
|
|
-
|
|
251
|
|
- //修改案件状态
|
|
252
|
|
- caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
|
|
253
|
|
- caseApplicationMapper.submitCaseApplication(caseApplication1);
|
|
254
|
|
-
|
|
255
|
|
- //将裁决书保存到附件表里
|
|
256
|
272
|
CaseAttach caseAttach = CaseAttach.builder()
|
|
257
|
273
|
.caseAppliId(id)
|
|
258
|
274
|
.annexName(saveName)
|
|
259
|
275
|
.annexPath(savePath)
|
|
260
|
|
- .annexType(3)
|
|
|
276
|
+ .annexType(7)
|
|
261
|
277
|
.build();
|
|
262
|
|
- int i = caseAttachMapper.save(caseAttach);
|
|
263
|
|
- if (i > 0) {
|
|
264
|
|
- if (arbitrateRecord1 != null) {
|
|
265
|
|
- Integer annexId = caseAttach.getAnnexId();
|
|
266
|
|
- //将附件id保存到仲裁记录表里面
|
|
267
|
|
- arbitrateRecord1.setAnnexId(annexId);
|
|
268
|
|
- arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
|
|
|
278
|
+ //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
|
|
|
279
|
+ CaseAttach caseAttach1 = new CaseAttach();
|
|
|
280
|
+ caseAttach1.setAnnexType(7);
|
|
|
281
|
+ caseAttach1.setCaseAppliId(id);
|
|
|
282
|
+ List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach1);
|
|
|
283
|
+ if (caseAttachList != null && caseAttachList.size() > 0) {
|
|
|
284
|
+ //之前已经生成过了,更新
|
|
|
285
|
+ caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
|
|
286
|
+ } else {
|
|
|
287
|
+ //之前没生成过,新增
|
|
|
288
|
+ int i = caseAttachMapper.save(caseAttach);
|
|
|
289
|
+ ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
|
|
290
|
+ if (i > 0) {
|
|
|
291
|
+ if (arbitrateRecord1 != null) {
|
|
|
292
|
+ Integer annexId = caseAttach.getAnnexId();
|
|
|
293
|
+ //将附件id保存到仲裁记录表里面
|
|
|
294
|
+ arbitrateRecord1.setAnnexId(annexId);
|
|
|
295
|
+ arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
|
|
|
296
|
+ }
|
|
269
|
297
|
}
|
|
270
|
298
|
}
|
|
271
|
|
- return AjaxResult.success("裁决书已生成");
|
|
|
299
|
+ return Boolean.TRUE;
|
|
272
|
300
|
|
|
273
|
301
|
} catch (IOException e) {
|
|
274
|
302
|
e.printStackTrace();
|
|
275
|
|
- return AjaxResult.error("裁决书生成异常");
|
|
|
303
|
+ return Boolean.FALSE;
|
|
276
|
304
|
}
|
|
|
305
|
+ }
|
|
|
306
|
+
|
|
|
307
|
+ //生成仲裁文书
|
|
|
308
|
+ private Boolean generateAward(ArbitrateRecord arbitrateRecord) {
|
|
|
309
|
+ try {
|
|
|
310
|
+ Map<String, Object> datas = new HashMap<>();
|
|
|
311
|
+ Long id = arbitrateRecord.getCaseAppliId();
|
|
|
312
|
+ if (id == null) {
|
|
|
313
|
+ return null;
|
|
|
314
|
+ }
|
|
|
315
|
+ //获取案件详细信息
|
|
|
316
|
+ CaseApplication caseApplication = new CaseApplication();
|
|
|
317
|
+ caseApplication.setId(id);
|
|
|
318
|
+ CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
|
319
|
+ //生成编码
|
|
|
320
|
+ String equipmentNo = getNewEquipmentNo();
|
|
|
321
|
+ datas.put("num", equipmentNo);
|
|
|
322
|
+ //获取仲裁记录表里的相关信息
|
|
|
323
|
+ ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
|
|
324
|
+ //获取案件关联人信息
|
|
|
325
|
+ CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
|
326
|
+ caseAffiliate.setCaseAppliId(id);
|
|
|
327
|
+ List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
|
328
|
+ List<String> nameAgentList = new ArrayList<>();
|
|
|
329
|
+ if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
|
|
330
|
+ for (CaseAffiliate affiliate : caseAffiliates) {
|
|
|
331
|
+ //获取身份类型
|
|
|
332
|
+ int identityType = affiliate.getIdentityType();
|
|
|
333
|
+ if (identityType == 1) { //申请人
|
|
|
334
|
+ datas.put("appName", affiliate.getName());
|
|
|
335
|
+ datas.put("appAddress", affiliate.getResidenAffili());
|
|
|
336
|
+ datas.put("appContactAddress", affiliate.getContactAddress());
|
|
|
337
|
+ datas.put("appLegalPerson", affiliate.getCompLegalPerson());
|
|
|
338
|
+ datas.put("appLegalPersonTitle", affiliate.getCompLegalperPost());
|
|
|
339
|
+ datas.put("appAgentName", affiliate.getNameAgent());
|
|
|
340
|
+ datas.put("appAgentTitle", affiliate.getAppliAgentTitle());
|
|
|
341
|
+ nameAgentList.add(affiliate.getNameAgent());
|
|
|
342
|
+ } else if (identityType == 2) { //被申请人
|
|
|
343
|
+ datas.put("resName", affiliate.getName());
|
|
|
344
|
+ datas.put("resAddress", affiliate.getResidenAffili());
|
|
|
345
|
+ datas.put("resSex", affiliate.getResponSex());
|
|
|
346
|
+ Date responBirth = affiliate.getResponBirth();
|
|
|
347
|
+ if (responBirth != null) {
|
|
|
348
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
349
|
+ String responBirthStr = sdf.format(responBirth);
|
|
|
350
|
+ datas.put("resDateOfBirth", responBirthStr);
|
|
277
|
351
|
|
|
|
352
|
+ }
|
|
278
|
353
|
|
|
|
354
|
+ datas.put("resContactAddress", affiliate.getContactAddress());
|
|
|
355
|
+ nameAgentList.add(affiliate.getNameAgent());
|
|
|
356
|
+ }
|
|
|
357
|
+ }
|
|
|
358
|
+ }
|
|
|
359
|
+ Date createTime = caseApplication1.getCreateTime();
|
|
|
360
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
361
|
+ // 将日期格式化为字符串
|
|
|
362
|
+ String createTimeStr = sdf.format(createTime);
|
|
|
363
|
+ datas.put("submissionDate", createTimeStr);
|
|
|
364
|
+ Date registerDate = caseApplication1.getRegisterDate();
|
|
|
365
|
+ String registerDateStr = sdf.format(registerDate);
|
|
|
366
|
+ datas.put("acceptDate", registerDateStr);
|
|
|
367
|
+ //反请求
|
|
|
368
|
+ Integer adjudicaCounter = caseApplication1.getAdjudicaCounter();
|
|
|
369
|
+ String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
|
|
|
370
|
+ "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" +
|
|
|
371
|
+ "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
|
|
|
372
|
+ if (adjudicaCounter == null) {
|
|
|
373
|
+ datas.put("counterclaim", null);
|
|
|
374
|
+ } else if (adjudicaCounter == 1) {
|
|
|
375
|
+ datas.put("counterclaim", counterclaim);
|
|
|
376
|
+ } else {
|
|
|
377
|
+ datas.put("counterclaim", null);
|
|
|
378
|
+ }
|
|
|
379
|
+ //财产保全
|
|
|
380
|
+ Integer properPreser = caseApplication1.getProperPreser();
|
|
|
381
|
+ String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" +
|
|
|
382
|
+ "第二十八条之规定,将该申请提交至法院。";
|
|
|
383
|
+ if (properPreser == null) {
|
|
|
384
|
+ datas.put("preservation", null);
|
|
|
385
|
+ } else if (properPreser == 1) {
|
|
|
386
|
+ datas.put("preservation", preservation);
|
|
|
387
|
+ } else {
|
|
|
388
|
+ datas.put("preservation", null);
|
|
|
389
|
+ }
|
|
|
390
|
+ //管辖权异议
|
|
|
391
|
+ Integer objectiJuris = caseApplication1.getObjectiJuris();
|
|
|
392
|
+ String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《XX管辖异议申请书》,认为XXXXXX" +
|
|
|
393
|
+ ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
|
|
|
394
|
+ if (objectiJuris == null) {
|
|
|
395
|
+ datas.put("jurisdictionalObjection", null);
|
|
|
396
|
+ } else if (objectiJuris == 1) {
|
|
|
397
|
+ datas.put("jurisdictionalObjection", jurisdictionalObjection);
|
|
|
398
|
+ } else {
|
|
|
399
|
+ datas.put("jurisdictionalObjection", null);
|
|
|
400
|
+ }
|
|
|
401
|
+ String arbitratorName = caseApplication1.getArbitratorName();
|
|
|
402
|
+ datas.put("arbitratorName", arbitratorName);
|
|
|
403
|
+ Integer arbitratMethod = caseApplication1.getArbitratMethod();
|
|
|
404
|
+ Date hearDate = caseApplication1.getHearDate();
|
|
|
405
|
+ if (hearDate != null) {
|
|
|
406
|
+ String hearDateStr = sdf.format(hearDate);
|
|
|
407
|
+ //线上开庭时
|
|
|
408
|
+ if (arbitratMethod == 1) {
|
|
|
409
|
+ String onLine1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于";
|
|
|
410
|
+ String onLine2 = "通过仲裁委智慧仲裁平台开庭审理了本案。";
|
|
|
411
|
+ datas.put("onLine1", onLine1);
|
|
|
412
|
+ datas.put("hearDate", hearDateStr);
|
|
|
413
|
+ datas.put("onLine2", onLine2);
|
|
|
414
|
+ } else {
|
|
|
415
|
+ //书面仲裁时
|
|
|
416
|
+ String written1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于";
|
|
|
417
|
+ String written2 = "在仲裁委所在地开庭审理了本案。";
|
|
|
418
|
+ datas.put("written1", written1);
|
|
|
419
|
+ datas.put("hearDate1", hearDateStr);
|
|
|
420
|
+ datas.put("written2", written2);
|
|
|
421
|
+ }
|
|
|
422
|
+ }
|
|
|
423
|
+ Integer isAbsence = caseApplication1.getIsAbsence();
|
|
|
424
|
+ if (isAbsence == null) {
|
|
|
425
|
+ datas.put("absent1", null);
|
|
|
426
|
+ datas.put("absent2", null);
|
|
|
427
|
+ datas.put("absent3", null);
|
|
|
428
|
+ datas.put("absent4", null);
|
|
|
429
|
+ datas.put("absent5", null);
|
|
|
430
|
+ datas.put("attend1", null);
|
|
|
431
|
+ datas.put("attend2", null);
|
|
|
432
|
+ datas.put("attend3", null);
|
|
|
433
|
+ datas.put("attend4", null);
|
|
|
434
|
+ datas.put("attend5", null);
|
|
|
435
|
+ datas.put("attend6", null);
|
|
|
436
|
+ datas.put("attend7", null);
|
|
|
437
|
+ datas.put("appAgentName1", null);
|
|
|
438
|
+ datas.put("appAgentName2", null);
|
|
|
439
|
+ datas.put("resAgentName", null);
|
|
|
440
|
+ } else if (isAbsence == 1) {
|
|
|
441
|
+ //缺席审理
|
|
|
442
|
+ String absent1 = "申请人的特别授权委托代理人";
|
|
|
443
|
+ String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
|
|
|
444
|
+ "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。";
|
|
|
445
|
+ String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," +
|
|
|
446
|
+ "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。";
|
|
|
447
|
+ String absent4 = "(二/三)当事人提供的证据材料\n" +
|
|
|
448
|
+ "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
|
|
|
449
|
+ String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
|
|
|
450
|
+ "第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
|
|
|
451
|
+ datas.put("absent1", absent1);
|
|
|
452
|
+ datas.put("absent2", absent2);
|
|
|
453
|
+ datas.put("absent3", absent3);
|
|
|
454
|
+ datas.put("absent4", absent4);
|
|
|
455
|
+ datas.put("absent5", absent5);
|
|
|
456
|
+ datas.put("appAgentName1", nameAgentList.get(0));
|
|
|
457
|
+ } else {
|
|
|
458
|
+ //出席审理
|
|
|
459
|
+ String attend1 = "申请人的特别授权委托代理人";
|
|
|
460
|
+ String attend2 = "和被申请人本人/的特别授权委托代理人";
|
|
|
461
|
+ String attend3 = "出席了庭审。";
|
|
|
462
|
+ String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" +
|
|
|
463
|
+ "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," +
|
|
|
464
|
+ "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," +
|
|
|
465
|
+ "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。";
|
|
|
466
|
+ String attend5 = "(二)被申请人的答辩意见";
|
|
|
467
|
+ String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" +
|
|
|
468
|
+ "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
|
|
|
469
|
+ String attend7 = "被申请人对上述材料的质证意见为:";
|
|
|
470
|
+ datas.put("attend1", attend1);
|
|
|
471
|
+ datas.put("attend2", attend2);
|
|
|
472
|
+ datas.put("attend3", attend3);
|
|
|
473
|
+ datas.put("attend4", attend4);
|
|
|
474
|
+ datas.put("attend5", attend5);
|
|
|
475
|
+ datas.put("attend6", attend6);
|
|
|
476
|
+ datas.put("attend7", attend7);
|
|
|
477
|
+ datas.put("responCrossOpin", caseApplication1.getResponCrossOpin());
|
|
|
478
|
+ datas.put("appAgentName2", nameAgentList.get(0));
|
|
|
479
|
+ datas.put("resAgentName", nameAgentList.get(1));
|
|
|
480
|
+ if (arbitratMethod == 1) {
|
|
|
481
|
+ //被申出席+开庭
|
|
|
482
|
+ String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
|
|
|
483
|
+ "第五十一条的规定,裁决如下:";
|
|
|
484
|
+ datas.put("attend8", attend8);
|
|
|
485
|
+ } else {
|
|
|
486
|
+ //被申出席+书面
|
|
|
487
|
+ String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
|
|
|
488
|
+ "第五十一条、第五十八条的规定,裁决如下:";
|
|
|
489
|
+ datas.put("attend9", attend9);
|
|
|
490
|
+ }
|
|
|
491
|
+ }
|
|
|
492
|
+ datas.put("claims", caseApplication1.getArbitratClaims());
|
|
|
493
|
+ datas.put("request", caseApplication1.getRequestRule());
|
|
|
494
|
+ //申请人证据材料
|
|
|
495
|
+ datas.put("appEvidenceMaterial", null);
|
|
|
496
|
+ //被申请人证据材料
|
|
|
497
|
+ datas.put("resEvidenceMaterial", null);
|
|
|
498
|
+ datas.put("applicaCrossOpin", caseApplication1.getApplicaCrossOpin());
|
|
|
499
|
+ if (arbitrateRecord1 != null) {
|
|
|
500
|
+ datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
|
|
|
501
|
+ datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink());
|
|
|
502
|
+ datas.put("rulingFollows", arbitrateRecord1.getRulingFollows());
|
|
|
503
|
+ }
|
|
|
504
|
+ LocalDate now = LocalDate.now();
|
|
|
505
|
+ String year = Integer.toString(now.getYear());
|
|
|
506
|
+ datas.put("year", year);
|
|
|
507
|
+ String month = String.format("%02d", now.getMonthValue());
|
|
|
508
|
+ String day = String.format("%02d", now.getDayOfMonth());
|
|
|
509
|
+ String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx";
|
|
|
510
|
+ //String modalFilePath = "D:/develop/新裁决书模板.docx";
|
|
|
511
|
+ String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
512
|
+ //String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day;
|
|
|
513
|
+ String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
|
|
|
514
|
+ String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
515
|
+ String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
516
|
+ // 创建日期目录
|
|
|
517
|
+ File saveFolder = new File(saveFolderPath);
|
|
|
518
|
+ if (!saveFolder.exists()) {
|
|
|
519
|
+ saveFolder.mkdirs();
|
|
|
520
|
+ }
|
|
|
521
|
+ Path sourcePath = new File(modalFilePath).toPath();
|
|
|
522
|
+ Path destinationPath = new File(resultFilePath).toPath();
|
|
|
523
|
+ Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
|
|
|
524
|
+ String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
|
|
|
525
|
+ File file = new File(docFilePath);
|
|
|
526
|
+ if (file.exists()) {
|
|
|
527
|
+ InputStream in = new FileInputStream(file);
|
|
|
528
|
+ XWPFDocument xwpfDocument = new XWPFDocument(in);
|
|
|
529
|
+ WordUtil.changeText(xwpfDocument);
|
|
|
530
|
+ }
|
|
|
531
|
+ String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
|
|
|
532
|
+ CaseAttach caseAttach = CaseAttach.builder()
|
|
|
533
|
+ .caseAppliId(id)
|
|
|
534
|
+ .annexName(saveName)
|
|
|
535
|
+ .annexPath(savePath)
|
|
|
536
|
+ .annexType(3)
|
|
|
537
|
+ .build();
|
|
|
538
|
+ //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
|
|
|
539
|
+ CaseAttach caseAttach1 = new CaseAttach();
|
|
|
540
|
+ caseAttach1.setAnnexType(3);
|
|
|
541
|
+ caseAttach1.setCaseAppliId(id);
|
|
|
542
|
+ List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach1);
|
|
|
543
|
+ if (caseAttachList != null && caseAttachList.size() > 0) {
|
|
|
544
|
+ //之前已经生成过了,更新
|
|
|
545
|
+ caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
|
|
546
|
+ } else {
|
|
|
547
|
+ //之前没生成过,新增
|
|
|
548
|
+ int i = caseAttachMapper.save(caseAttach);
|
|
|
549
|
+ if (i > 0) {
|
|
|
550
|
+ if (arbitrateRecord1 != null) {
|
|
|
551
|
+ Integer annexId = caseAttach.getAnnexId();
|
|
|
552
|
+ //将附件id保存到仲裁记录表里面
|
|
|
553
|
+ arbitrateRecord1.setAnnexId(annexId);
|
|
|
554
|
+ arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
|
|
|
555
|
+ }
|
|
|
556
|
+ }
|
|
|
557
|
+ }
|
|
|
558
|
+ return Boolean.TRUE;
|
|
|
559
|
+ } catch (IOException e) {
|
|
|
560
|
+ return Boolean.FALSE;
|
|
|
561
|
+ }
|
|
|
562
|
+ }
|
|
|
563
|
+
|
|
|
564
|
+ public String getNewEquipmentNo() {
|
|
|
565
|
+ Object awardNum = redisCache.getCacheObject("awardNum");
|
|
|
566
|
+ if (awardNum == null) {
|
|
|
567
|
+ redisCache.setCacheObject("awardNum", "00001");
|
|
|
568
|
+ String s = redisCache.getCacheObject("awardNum").toString();
|
|
|
569
|
+ // 字符串数字解析为整数
|
|
|
570
|
+ int no = Integer.parseInt(s);
|
|
|
571
|
+ // 最新设备编号自增1
|
|
|
572
|
+ int newEquipment = ++no;
|
|
|
573
|
+ // 将整数格式化为5位数字
|
|
|
574
|
+ s = String.format("%05d", newEquipment);
|
|
|
575
|
+ redisCache.setCacheObject("awardNum", s);
|
|
|
576
|
+ return s;
|
|
|
577
|
+ } else {
|
|
|
578
|
+ String s = awardNum.toString();
|
|
|
579
|
+ // 字符串数字解析为整数
|
|
|
580
|
+ int no = Integer.parseInt(s);
|
|
|
581
|
+ // 最新设备编号自增1
|
|
|
582
|
+ int newEquipment = ++no;
|
|
|
583
|
+ // 将整数格式化为5位数字
|
|
|
584
|
+ s = String.format("%05d", newEquipment);
|
|
|
585
|
+ redisCache.setCacheObject("awardNum", s);
|
|
|
586
|
+ return s;
|
|
|
587
|
+ }
|
|
279
|
588
|
}
|
|
280
|
589
|
}
|