|
|
@@ -244,7 +244,7 @@ public class FixSelectFlowDetailUtils {
|
|
244
|
244
|
/*
|
|
245
|
245
|
定时查询签署流程详情
|
|
246
|
246
|
*/
|
|
247
|
|
-// @Scheduled(cron = "0/10 * * * * ?")
|
|
|
247
|
+ @Scheduled(cron = "0/10 * * * * ?")
|
|
248
|
248
|
@Transactional
|
|
249
|
249
|
public void fixExecuteSelectFlowDetailUtils() {
|
|
250
|
250
|
Gson gson = new Gson();
|
|
|
@@ -319,12 +319,55 @@ public class FixSelectFlowDetailUtils {
|
|
319
|
319
|
application.setCaseFlowId(nextFlow.getId());
|
|
320
|
320
|
application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
321
|
321
|
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
|
322
|
+
|
|
|
323
|
+ //下载审核完成的调解书
|
|
|
324
|
+ String signFlowId = sealSignRecord.getSignFlowid();
|
|
|
325
|
+ EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
|
|
326
|
+ JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
|
|
|
327
|
+ JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
|
|
328
|
+ JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
|
|
|
329
|
+ if (filesArray != null && filesArray.size() > 0) {
|
|
|
330
|
+ JsonObject fileObject = (JsonObject) filesArray.get(0);
|
|
|
331
|
+ String fileDownloadUrl = fileObject.get("downloadUrl").toString();
|
|
|
332
|
+ LocalDate now = LocalDate.now();
|
|
|
333
|
+ String year = Integer.toString(now.getYear());
|
|
|
334
|
+ String month = String.format("%02d", now.getMonthValue());
|
|
|
335
|
+ String day = String.format("%02d", now.getDayOfMonth());
|
|
|
336
|
+ String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
337
|
+ String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
|
338
|
+ String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
339
|
+ String savePath = "/home/ruoyi/uploadPath/upload/";
|
|
|
340
|
+
|
|
|
341
|
+ // 创建日期目录
|
|
|
342
|
+ File saveFolder = new File(saveFolderPath);
|
|
|
343
|
+ if (!saveFolder.exists()) {
|
|
|
344
|
+ saveFolder.mkdirs();
|
|
|
345
|
+ }
|
|
|
346
|
+ String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
347
|
+ File resultFilePathFile = new File(resultFilePath);
|
|
|
348
|
+ if (!resultFilePathFile.exists()) {
|
|
|
349
|
+ resultFilePathFile.createNewFile();
|
|
|
350
|
+ }
|
|
|
351
|
+
|
|
|
352
|
+ String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
|
|
353
|
+ boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
|
|
354
|
+ if (downLoadFile) {
|
|
|
355
|
+ Long caseAppliId = sealSignRecord.getCaseAppliId();
|
|
|
356
|
+ MsCaseAttach caseAttach = new MsCaseAttach();
|
|
|
357
|
+ caseAttach.setCaseAppliId(caseAppliId);
|
|
|
358
|
+ caseAttach.setAnnexType(3);
|
|
|
359
|
+ caseAttach.setAnnexPath(savePath);
|
|
|
360
|
+ caseAttach.setAnnexName(saveName);
|
|
|
361
|
+ caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
|
|
362
|
+ }
|
|
|
363
|
+
|
|
|
364
|
+ }
|
|
322
|
365
|
}
|
|
323
|
366
|
}
|
|
324
|
367
|
}
|
|
325
|
368
|
|
|
326
|
369
|
}
|
|
327
|
|
- } catch (EsignDemoException e) {
|
|
|
370
|
+ } catch (EsignDemoException | IOException e) {
|
|
328
|
371
|
e.printStackTrace();
|
|
329
|
372
|
}
|
|
330
|
373
|
|