|
|
@@ -4,16 +4,14 @@ import com.alibaba.fastjson.JSON;
|
|
4
|
4
|
import com.alibaba.fastjson.JSONObject;
|
|
5
|
5
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
6
|
6
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
7
|
+import com.ruoyi.common.core.redis.RedisCache;
|
|
|
8
|
+import com.ruoyi.wisdomarbitrate.mapper.*;
|
|
7
|
9
|
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
|
8
|
10
|
import com.ruoyi.common.utils.EmailOutUtil;
|
|
9
|
11
|
import com.ruoyi.common.utils.WordUtil;
|
|
10
|
12
|
import com.ruoyi.wisdomarbitrate.domain.*;
|
|
11
|
13
|
import com.ruoyi.wisdomarbitrate.domain.vo.ArchivesDetailVO;
|
|
12
|
14
|
import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
|
|
13
|
|
-import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper;
|
|
14
|
|
-import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
|
|
15
|
|
-import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
|
16
|
|
-import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
|
17
|
15
|
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
|
18
|
16
|
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
|
19
|
17
|
import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService;
|
|
|
@@ -31,6 +29,7 @@ import java.net.URLEncoder;
|
|
31
|
29
|
import java.nio.file.Files;
|
|
32
|
30
|
import java.nio.file.Path;
|
|
33
|
31
|
import java.nio.file.StandardCopyOption;
|
|
|
32
|
+import java.text.SimpleDateFormat;
|
|
34
|
33
|
import java.time.LocalDate;
|
|
35
|
34
|
import java.time.ZoneId;
|
|
36
|
35
|
import java.util.*;
|
|
|
@@ -54,6 +53,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
54
|
53
|
private ICaseApplicationService caseApplicationService;
|
|
55
|
54
|
@Autowired
|
|
56
|
55
|
private ICaseLogRecordService caseLogRecordService;
|
|
|
56
|
+ @Autowired
|
|
|
57
|
+ private CasePaymentRecordMapper casePaymentRecordMapper;
|
|
|
58
|
+ @Autowired
|
|
|
59
|
+ private RedisCache redisCache;
|
|
57
|
60
|
|
|
58
|
61
|
@Override
|
|
59
|
62
|
@Transactional
|
|
|
@@ -66,11 +69,13 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
66
|
69
|
}
|
|
67
|
70
|
//获取案件详细信息
|
|
68
|
71
|
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
|
72
|
+ //生成编码
|
|
|
73
|
+ String equipmentNo = getNewEquipmentNo();
|
|
|
74
|
+ datas.put("num",equipmentNo);
|
|
69
|
75
|
//获取仲裁记录表里的相关信息
|
|
70
|
76
|
ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
|
|
71
|
77
|
arbitrateRecord.setCaseAppliId(id);
|
|
72
|
78
|
ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
|
73
|
|
-
|
|
74
|
79
|
//获取案件关联人信息
|
|
75
|
80
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
76
|
81
|
caseAffiliate.setCaseAppliId(id);
|
|
|
@@ -84,60 +89,175 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
84
|
89
|
datas.put("appAddress", affiliate.getContactAddress());
|
|
85
|
90
|
datas.put("appContactAddress", null);
|
|
86
|
91
|
datas.put("appLegalPerson", null);
|
|
87
|
|
- datas.put("appLegalPersonTitle",null);
|
|
88
|
|
- datas.put("appAgentName",affiliate.getNameAgent());
|
|
89
|
|
- datas.put("appAgentTitle",null);
|
|
|
92
|
+ datas.put("appLegalPersonTitle", null);
|
|
|
93
|
+ datas.put("appAgentName", affiliate.getNameAgent());
|
|
|
94
|
+ datas.put("appAgentTitle", null);
|
|
90
|
95
|
} else if (identityType == 2) { //被申请人
|
|
91
|
96
|
datas.put("resName", affiliate.getName());
|
|
92
|
97
|
datas.put("resAddress", affiliate.getContactAddress());
|
|
93
|
|
- datas.put("resSex",null);
|
|
94
|
|
- datas.put("resDateOfBirth",null);
|
|
95
|
|
- datas.put("resContactAddress",null);
|
|
|
98
|
+ datas.put("resSex", null);
|
|
|
99
|
+ datas.put("resDateOfBirth", null);
|
|
|
100
|
+ datas.put("resContactAddress", null);
|
|
96
|
101
|
}
|
|
97
|
102
|
}
|
|
98
|
103
|
}
|
|
99
|
|
- datas.put("submissionDate", caseApplication1.getCreateTime());
|
|
|
104
|
+ Date createTime = caseApplication1.getCreateTime();
|
|
|
105
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
106
|
+ // 将日期格式化为字符串
|
|
|
107
|
+ String createTimeStr = sdf.format(createTime);
|
|
|
108
|
+ datas.put("submissionDate", createTimeStr);
|
|
100
|
109
|
datas.put("qutsider", null);
|
|
101
|
110
|
datas.put("signingDate", null);
|
|
|
111
|
+ datas.put("agreementNumber", null);
|
|
|
112
|
+ CasePaymentRecord casePaymentRecord = casePaymentRecordMapper.selectRecordByCaseId(id);
|
|
|
113
|
+ //受理时间取得是支付时间
|
|
|
114
|
+ if (casePaymentRecord != null) {
|
|
|
115
|
+ Date paymentTime = casePaymentRecord.getPaymentTime();
|
|
|
116
|
+ String paymentTimeStr = sdf.format(paymentTime);
|
|
|
117
|
+ datas.put("acceptDate",paymentTimeStr);
|
|
|
118
|
+ }
|
|
102
|
119
|
|
|
|
120
|
+ //反请求
|
|
|
121
|
+ Integer adjudicaCounter = caseApplication1.getAdjudicaCounter();
|
|
|
122
|
+ String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
|
|
|
123
|
+ "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" +
|
|
|
124
|
+ "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
|
|
|
125
|
+ if (adjudicaCounter == null){
|
|
|
126
|
+ datas.put("counterclaim", null);
|
|
|
127
|
+ }else if (adjudicaCounter == 1){
|
|
|
128
|
+ datas.put("counterclaim", counterclaim);
|
|
|
129
|
+ } else {
|
|
|
130
|
+ datas.put("counterclaim", null);
|
|
|
131
|
+ }
|
|
|
132
|
+ //财产保全
|
|
|
133
|
+ Integer properPreser = caseApplication1.getProperPreser();
|
|
|
134
|
+ String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" +
|
|
|
135
|
+ "第二十八条之规定,将该申请提交至XXX市XXX区法院。";
|
|
|
136
|
+ if (properPreser == null) {
|
|
|
137
|
+ datas.put("preservation", null);
|
|
|
138
|
+ } else if(properPreser == 1) {
|
|
|
139
|
+ datas.put("preservation", preservation);
|
|
|
140
|
+ } else {
|
|
|
141
|
+ datas.put("preservation", null);
|
|
|
142
|
+ }
|
|
|
143
|
+ //管辖权异议
|
|
|
144
|
+ Integer objectiJuris = caseApplication1.getObjectiJuris();
|
|
|
145
|
+ String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《XX管辖异议申请书》,认为XXXXXX" +
|
|
|
146
|
+ ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
|
|
|
147
|
+ if (objectiJuris == null){
|
|
|
148
|
+ datas.put("jurisdictionalObjection", null);
|
|
|
149
|
+ }
|
|
|
150
|
+ else if (objectiJuris == 1) {
|
|
|
151
|
+ datas.put("jurisdictionalObjection", jurisdictionalObjection);
|
|
|
152
|
+ } else {
|
|
|
153
|
+ datas.put("jurisdictionalObjection", null);
|
|
|
154
|
+ }
|
|
103
|
155
|
String arbitratorName = caseApplication1.getArbitratorName();
|
|
104
|
|
- datas.put("caseName", caseApplication1.getCaseName());
|
|
105
|
156
|
datas.put("arbitratorName", arbitratorName);
|
|
|
157
|
+ Integer arbitratMethod = caseApplication1.getArbitratMethod();
|
|
106
|
158
|
Date hearDate = caseApplication1.getHearDate();
|
|
107
|
|
- if (hearDate != null) {
|
|
108
|
|
- LocalDate localDate = hearDate.toInstant()
|
|
109
|
|
- .atZone(ZoneId.systemDefault())
|
|
110
|
|
- .toLocalDate();
|
|
111
|
|
- datas.put("hearYear", localDate.getYear());
|
|
112
|
|
- datas.put("hearMonths", localDate.getMonthValue());
|
|
113
|
|
- datas.put("hearDay", localDate.getDayOfMonth());
|
|
|
159
|
+ String hearDateStr = sdf.format(hearDate);
|
|
|
160
|
+ //线上开庭时
|
|
|
161
|
+ if (arbitratMethod == 1) {
|
|
|
162
|
+ String onLine1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于";
|
|
|
163
|
+ String onLine2 = "通过仲裁委智慧仲裁平台开庭审理了本案。";
|
|
|
164
|
+ datas.put("onLine1", onLine1);
|
|
|
165
|
+ datas.put("hearDate", hearDateStr);
|
|
|
166
|
+ datas.put("onLine2", onLine2);
|
|
|
167
|
+ } else {
|
|
|
168
|
+ //书面仲裁时
|
|
|
169
|
+ String written1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于";
|
|
|
170
|
+ String written2 = "在仲裁委所在地开庭审理了本案。";
|
|
|
171
|
+ datas.put("written1", written1);
|
|
|
172
|
+ datas.put("hearDate1", hearDateStr);
|
|
|
173
|
+ datas.put("written2", written2);
|
|
|
174
|
+ }
|
|
|
175
|
+ Integer isAbsence = caseApplication1.getIsAbsence();
|
|
|
176
|
+ if (isAbsence==null){
|
|
|
177
|
+ datas.put("onLine1", null);
|
|
|
178
|
+ datas.put("absent2", null);
|
|
|
179
|
+ datas.put("absent3", null);
|
|
|
180
|
+ datas.put("absent4", null);
|
|
|
181
|
+ datas.put("absent5", null);
|
|
|
182
|
+ datas.put("attend1", null);
|
|
|
183
|
+ datas.put("attend2", null);
|
|
|
184
|
+ datas.put("attend3", null);
|
|
|
185
|
+ datas.put("attend4", null);
|
|
|
186
|
+ datas.put("attend5", null);
|
|
|
187
|
+ datas.put("attend6", null);
|
|
|
188
|
+ datas.put("attend7", null);
|
|
|
189
|
+ datas.put("responCrossOpin", null);
|
|
|
190
|
+ }
|
|
|
191
|
+ else if (isAbsence == 1) {
|
|
|
192
|
+ //缺席审理
|
|
|
193
|
+ String absent1 = "申请人的特别授权委托代理人";
|
|
|
194
|
+ String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
|
|
|
195
|
+ "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。";
|
|
|
196
|
+ String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," +
|
|
|
197
|
+ "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。";
|
|
|
198
|
+ String absent4 = "(二/三)当事人提供的证据材料\n" +
|
|
|
199
|
+ "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
|
|
|
200
|
+ String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
|
|
|
201
|
+ "第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
|
|
|
202
|
+ datas.put("onLine1", absent1);
|
|
|
203
|
+ datas.put("absent2", absent2);
|
|
|
204
|
+ datas.put("absent3", absent3);
|
|
|
205
|
+ datas.put("absent4", absent4);
|
|
|
206
|
+ datas.put("absent5", absent5);
|
|
114
|
207
|
} else {
|
|
115
|
|
- datas.put("hearYear", null);
|
|
116
|
|
- datas.put("hearMonths", null);
|
|
117
|
|
- datas.put("hearDay", null);
|
|
|
208
|
+ //出席审理
|
|
|
209
|
+ String attend1 = "申请人的特别授权委托代理人";
|
|
|
210
|
+ String attend2 = "和被申请人本人/的特别授权委托代理人";
|
|
|
211
|
+ String attend3 = "出席了庭审。";
|
|
|
212
|
+ String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" +
|
|
|
213
|
+ "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," +
|
|
|
214
|
+ "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," +
|
|
|
215
|
+ "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。";
|
|
|
216
|
+ String attend5 = "(二)被申请人的答辩意见";
|
|
|
217
|
+ String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" +
|
|
|
218
|
+ "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
|
|
|
219
|
+ String attend7 = "被申请人对上述材料的质证意见为:";
|
|
|
220
|
+ datas.put("attend1", attend1);
|
|
|
221
|
+ datas.put("attend2", attend2);
|
|
|
222
|
+ datas.put("attend3", attend3);
|
|
|
223
|
+ datas.put("attend4", attend4);
|
|
|
224
|
+ datas.put("attend5", attend5);
|
|
|
225
|
+ datas.put("attend6", attend6);
|
|
|
226
|
+ datas.put("attend7", attend7);
|
|
|
227
|
+ datas.put("responCrossOpin", caseApplication1.getResponCrossOpin());
|
|
|
228
|
+ if (arbitratMethod == 1) {
|
|
|
229
|
+ //被申出席+开庭
|
|
|
230
|
+ String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
|
|
|
231
|
+ "第五十一条的规定,裁决如下:";
|
|
|
232
|
+ datas.put("attend8", attend8);
|
|
|
233
|
+ } else {
|
|
|
234
|
+ //被申出席+书面
|
|
|
235
|
+ String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
|
|
|
236
|
+ "第五十一条、第五十八条的规定,裁决如下:";
|
|
|
237
|
+ datas.put("attend9", attend9);
|
|
|
238
|
+ }
|
|
118
|
239
|
}
|
|
119
|
|
- datas.put("appArbitrationClaims", caseApplication1.getArbitratClaims());
|
|
|
240
|
+ datas.put("claims", caseApplication1.getArbitratClaims());
|
|
|
241
|
+ datas.put("request", caseApplication1.getRequestRule());
|
|
|
242
|
+ //申请人证据材料
|
|
|
243
|
+ datas.put("appEvidenceMaterial", null);
|
|
|
244
|
+ //被申请人证据材料
|
|
|
245
|
+ datas.put("resEvidenceMaterial", null);
|
|
|
246
|
+ datas.put("applicaCrossOpin", caseApplication1.getApplicaCrossOpin());
|
|
120
|
247
|
if (arbitrateRecord1 != null) {
|
|
121
|
|
- datas.put("evidenDetermi", arbitrateRecord1.getEvidenDetermi());
|
|
122
|
248
|
datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
|
|
123
|
|
- datas.put("caseSketch", arbitrateRecord1.getCaseSketch());
|
|
124
|
249
|
datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink());
|
|
125
|
250
|
datas.put("rulingFollows", arbitrateRecord1.getRulingFollows());
|
|
126
|
251
|
}
|
|
127
|
|
- datas.put("legalProvisions", "仲裁法");
|
|
128
|
252
|
LocalDate now = LocalDate.now();
|
|
129
|
253
|
String year = Integer.toString(now.getYear());
|
|
|
254
|
+ datas.put("year", year);
|
|
130
|
255
|
String month = String.format("%02d", now.getMonthValue());
|
|
131
|
256
|
String day = String.format("%02d", now.getDayOfMonth());
|
|
132
|
|
- datas.put("year", year);
|
|
133
|
|
- datas.put("months", month);
|
|
134
|
|
- datas.put("day", day);
|
|
135
|
|
-
|
|
136
|
|
-
|
|
137
|
|
- String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
|
|
138
|
|
-// String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
|
|
|
257
|
+ String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx";
|
|
|
258
|
+ //String modalFilePath = "D:/develop/新裁决书模板.docx";
|
|
139
|
259
|
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
140
|
|
-// String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
|
|
|
260
|
+ //String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day;
|
|
141
|
261
|
String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
|
|
142
|
262
|
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
143
|
263
|
String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
@@ -432,22 +552,29 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
432
|
552
|
}
|
|
433
|
553
|
return AjaxResult.success(archivesDetailVO);
|
|
434
|
554
|
}
|
|
435
|
|
-
|
|
436
|
|
- public static void main(String[] args) {
|
|
437
|
|
- try {
|
|
438
|
|
-// List<File> fileList = new ArrayList<>();
|
|
439
|
|
-// fileList.add(new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\b442880179844a848f1f8b08c29e3d0c.docx"));
|
|
440
|
|
- // File file = fileList.get(0);//System.out.println("这是文件"+file);
|
|
441
|
|
- //电子邮件送达
|
|
442
|
|
-// EmailOutUtil emailOutUtil = new EmailOutUtil();
|
|
443
|
|
-// JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender();
|
|
444
|
|
-// if (javaMailSender != null) {
|
|
445
|
|
-// emailOutUtil.sendMessageCarryFile("1154956315@qq.com", "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
|
|
446
|
|
-// , "hjbjava@163.com", javaMailSender);
|
|
447
|
|
-// }
|
|
448
|
|
- } catch (MailSendException e) {
|
|
449
|
|
- e.printStackTrace();
|
|
|
555
|
+ public String getNewEquipmentNo() {
|
|
|
556
|
+ Object awardNum = redisCache.getCacheObject("awardNum");
|
|
|
557
|
+ if (awardNum == null) {
|
|
|
558
|
+ redisCache.setCacheObject("awardNum", "00001");
|
|
|
559
|
+ String s = redisCache.getCacheObject("awardNum").toString();
|
|
|
560
|
+ // 字符串数字解析为整数
|
|
|
561
|
+ int no = Integer.parseInt(s);
|
|
|
562
|
+ // 最新设备编号自增1
|
|
|
563
|
+ int newEquipment = ++no;
|
|
|
564
|
+ // 将整数格式化为5位数字
|
|
|
565
|
+ s = String.format("%05d", newEquipment);
|
|
|
566
|
+ redisCache.setCacheObject("awardNum", s);
|
|
|
567
|
+ return s;
|
|
|
568
|
+ } else {
|
|
|
569
|
+ String s = awardNum.toString();
|
|
|
570
|
+ // 字符串数字解析为整数
|
|
|
571
|
+ int no = Integer.parseInt(s);
|
|
|
572
|
+ // 最新设备编号自增1
|
|
|
573
|
+ int newEquipment = ++no;
|
|
|
574
|
+ // 将整数格式化为5位数字
|
|
|
575
|
+ s = String.format("%05d", newEquipment);
|
|
|
576
|
+ redisCache.setCacheObject("awardNum", s);
|
|
|
577
|
+ return s;
|
|
450
|
578
|
}
|
|
451
|
579
|
}
|
|
452
|
|
-
|
|
453
|
580
|
}
|