|
|
@@ -15,6 +15,7 @@ import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
|
15
|
15
|
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
|
16
|
16
|
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
|
17
|
17
|
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
|
|
18
|
+import lombok.extern.slf4j.Slf4j;
|
|
18
|
19
|
import org.apache.poi.xwpf.usermodel.*;
|
|
19
|
20
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
20
|
21
|
import org.springframework.mail.MailSendException;
|
|
|
@@ -35,6 +36,7 @@ import java.time.format.DateTimeFormatter;
|
|
35
|
36
|
import java.util.*;
|
|
36
|
37
|
|
|
37
|
38
|
@Service
|
|
|
39
|
+@Slf4j
|
|
38
|
40
|
public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
39
|
41
|
private final String apiUrl = "http://api.cainiaoapi.com/api/exp/v1/index";
|
|
40
|
42
|
|
|
|
@@ -197,7 +199,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
197
|
199
|
for (CaseAttach caseAttach : caseAttachList) {
|
|
198
|
200
|
if (caseAttach.getAnnexType() == 3) {
|
|
199
|
201
|
String annexPath = caseAttach.getAnnexPath();
|
|
200
|
|
- fileList.add(new File(annexPath));
|
|
|
202
|
+ //File file = new File("/home/ruoyi/" + annexPath);
|
|
|
203
|
+ String path = "/home/ruoyi/" + annexPath;
|
|
|
204
|
+ File file = new File(path);
|
|
|
205
|
+ System.out.println("文件是:" + file);
|
|
|
206
|
+ fileList.add(file);
|
|
201
|
207
|
}
|
|
202
|
208
|
}
|
|
203
|
209
|
}
|
|
|
@@ -245,7 +251,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
245
|
251
|
public AjaxResult getLogisticsInfo(CaseApplication caseApplication) {
|
|
246
|
252
|
try {
|
|
247
|
253
|
//快递单号查询
|
|
248
|
|
- String key = "70ba5c7b327f71fccd5924f70e3e7b7f";
|
|
|
254
|
+ String key = "729437f92468910aee6c12dbfeaee3c1";
|
|
249
|
255
|
String com = "auto";
|
|
250
|
256
|
//根据案件id查询单号信息
|
|
251
|
257
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
|
@@ -298,4 +304,68 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
298
|
304
|
}
|
|
299
|
305
|
return null;
|
|
300
|
306
|
}
|
|
|
307
|
+
|
|
|
308
|
+ @Override
|
|
|
309
|
+ public AjaxResult signature(CaseApplication caseApplication) {
|
|
|
310
|
+ //更改案件状态(暂时)
|
|
|
311
|
+ caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
|
|
|
312
|
+ caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
|
313
|
+ return AjaxResult.success("签名成功,案件状态已改为待仲裁文书用印");
|
|
|
314
|
+ }
|
|
|
315
|
+
|
|
|
316
|
+ @Override
|
|
|
317
|
+ public AjaxResult caseFile(CaseApplication caseApplication) {
|
|
|
318
|
+ //更改案件状态(暂时)
|
|
|
319
|
+ caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED);
|
|
|
320
|
+ caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
|
321
|
+ return AjaxResult.success("归档成功,案件状态已改为已归档");
|
|
|
322
|
+ }
|
|
|
323
|
+
|
|
|
324
|
+ @Override
|
|
|
325
|
+ public AjaxResult service(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum) {
|
|
|
326
|
+ CaseApplication caseApplication = new CaseApplication();
|
|
|
327
|
+ caseApplication.setId(id);
|
|
|
328
|
+ CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
|
329
|
+ if (caseApplication1 == null) {
|
|
|
330
|
+ return AjaxResult.error("未查询到相关案件");
|
|
|
331
|
+ }
|
|
|
332
|
+ //修改案件状态
|
|
|
333
|
+ caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
|
|
|
334
|
+ caseApplicationMapper.submitCaseApplication(caseApplication1);
|
|
|
335
|
+ //保存邮箱信息和快递单号到关联人表
|
|
|
336
|
+ CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
|
337
|
+ caseAffiliate.setCaseAppliId(id);
|
|
|
338
|
+ List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
|
339
|
+ if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
|
|
340
|
+ for (CaseAffiliate affiliate : caseAffiliates) {
|
|
|
341
|
+ if (affiliate.getIdentityType() == 1) { //申请人
|
|
|
342
|
+ affiliate.setSendEmail(appEmail);
|
|
|
343
|
+ affiliate.setTrackNum(apptrackingNum);
|
|
|
344
|
+ caseAffiliateMapper.updataCaseAffiliate(affiliate);
|
|
|
345
|
+ } else {
|
|
|
346
|
+ affiliate.setSendEmail(resEmail);
|
|
|
347
|
+ affiliate.setTrackNum(restrackingNum);
|
|
|
348
|
+ caseAffiliateMapper.updataCaseAffiliate(affiliate);
|
|
|
349
|
+ }
|
|
|
350
|
+ }
|
|
|
351
|
+ }
|
|
|
352
|
+ return AjaxResult.success("仲裁文书送达成功");
|
|
|
353
|
+ }
|
|
|
354
|
+
|
|
|
355
|
+ public static void main(String[] args) {
|
|
|
356
|
+ try {
|
|
|
357
|
+ List<File> fileList = new ArrayList<>();
|
|
|
358
|
+ fileList.add(new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\b442880179844a848f1f8b08c29e3d0c.docx"));
|
|
|
359
|
+ File file = fileList.get(0);
|
|
|
360
|
+ //电子邮件送达
|
|
|
361
|
+ EmailOutUtil emailOutUtil = new EmailOutUtil();
|
|
|
362
|
+ JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender();
|
|
|
363
|
+ if (javaMailSender != null) {
|
|
|
364
|
+ emailOutUtil.sendMessageCarryFile("1154956315@qq.com", "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
|
|
|
365
|
+ , "hjbjava@163.com", javaMailSender);
|
|
|
366
|
+ }
|
|
|
367
|
+ } catch (MailSendException e) {
|
|
|
368
|
+ e.printStackTrace();
|
|
|
369
|
+ }
|
|
|
370
|
+ }
|
|
301
|
371
|
}
|