|
|
@@ -286,86 +286,160 @@ public class FixSelectFlowDetailUtils {
|
|
286
|
286
|
|
|
287
|
287
|
List<Integer> psnsignStatusListnew = psnsignStatusList.stream().distinct().collect(Collectors.toList());
|
|
288
|
288
|
|
|
289
|
|
- if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 1)) {
|
|
290
|
|
- //更新立案申请状态为待用印
|
|
291
|
|
- MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
|
|
292
|
|
- if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 1)) {
|
|
293
|
|
- // 根据流程id查找下一个流程节点
|
|
294
|
|
- MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
|
|
295
|
|
- MsCaseApplication application = new MsCaseApplication();
|
|
296
|
|
- application.setId(caseApplicationselect.getId());
|
|
297
|
|
- application.setCaseFlowId(nextFlow.getId());
|
|
298
|
|
- application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
299
|
|
- caseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
300
|
|
-
|
|
301
|
|
- //修改"签署用印记录表"的状态为待用印
|
|
302
|
|
- mssealSignRecord.setSignFlowStatus(2);
|
|
303
|
|
- sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
|
|
304
|
|
- }
|
|
305
|
|
- }
|
|
306
|
|
- if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 2)) {
|
|
307
|
|
- //更新立案申请状态为待送达
|
|
308
|
|
- MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
|
|
309
|
|
-
|
|
310
|
|
- if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 2)) {
|
|
311
|
|
- //修改"签署用印记录表"的状态为签署完成
|
|
312
|
|
- mssealSignRecord.setSignFlowStatus(3);
|
|
313
|
|
- sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
|
|
314
|
|
-
|
|
315
|
|
- // 根据流程id查找下一个流程节点
|
|
316
|
|
- MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
|
|
317
|
|
- MsCaseApplication application = new MsCaseApplication();
|
|
318
|
|
- application.setId(caseApplicationselect.getId());
|
|
319
|
|
- application.setCaseFlowId(nextFlow.getId());
|
|
320
|
|
- application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
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";
|
|
|
289
|
+ MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
|
|
|
290
|
+ Integer isReconci = caseApplicationselect.getIsReconci();
|
|
|
291
|
+ if(isReconci!=null){
|
|
|
292
|
+ if(isReconci.intValue()==1){
|
|
|
293
|
+ if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2))) {
|
|
|
294
|
+ //更新立案申请状态为待送达
|
|
|
295
|
+// MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
|
|
|
296
|
+ if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 1)) {
|
|
|
297
|
+ MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
|
|
|
298
|
+ MsCaseApplication application = new MsCaseApplication();
|
|
|
299
|
+ application.setId(caseApplicationselect.getId());
|
|
|
300
|
+ application.setCaseFlowId(nextFlow.getId());
|
|
|
301
|
+ application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
|
302
|
+ caseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
|
303
|
+
|
|
|
304
|
+ //修改"签署用印记录表"的状态为完成
|
|
|
305
|
+ mssealSignRecord.setSignFlowStatus(3);
|
|
|
306
|
+ sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
|
|
|
307
|
+
|
|
|
308
|
+ //下载审核完成的调解书
|
|
|
309
|
+ String signFlowId = sealSignRecord.getSignFlowid();
|
|
|
310
|
+ EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
|
|
311
|
+ JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
|
|
|
312
|
+ JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
|
|
313
|
+ JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
|
|
|
314
|
+ if (filesArray != null && filesArray.size() > 0) {
|
|
|
315
|
+ JsonObject fileObject = (JsonObject) filesArray.get(0);
|
|
|
316
|
+ String fileDownloadUrl = fileObject.get("downloadUrl").toString();
|
|
|
317
|
+ LocalDate now = LocalDate.now();
|
|
|
318
|
+ String year = Integer.toString(now.getYear());
|
|
|
319
|
+ String month = String.format("%02d", now.getMonthValue());
|
|
|
320
|
+ String day = String.format("%02d", now.getDayOfMonth());
|
|
|
321
|
+ String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
322
|
+ String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
338
|
323
|
// String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
339
|
324
|
// String savePath = "/home/ruoyi/uploadPath/upload/";
|
|
340
|
|
- String saveName = fileName;
|
|
341
|
|
- String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
325
|
+ String saveName = fileName;
|
|
|
326
|
+ String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
327
|
+
|
|
|
328
|
+ // 创建日期目录
|
|
|
329
|
+ File saveFolder = new File(saveFolderPath);
|
|
|
330
|
+ if (!saveFolder.exists()) {
|
|
|
331
|
+ saveFolder.mkdirs();
|
|
|
332
|
+ }
|
|
|
333
|
+ String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
334
|
+ File resultFilePathFile = new File(resultFilePath);
|
|
|
335
|
+ if (!resultFilePathFile.exists()) {
|
|
|
336
|
+ resultFilePathFile.createNewFile();
|
|
|
337
|
+ }
|
|
|
338
|
+
|
|
|
339
|
+ String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
|
|
340
|
+ boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
|
|
341
|
+ if (downLoadFile) {
|
|
|
342
|
+ Long caseAppliId = sealSignRecord.getCaseAppliId();
|
|
|
343
|
+ MsCaseAttach caseAttach = new MsCaseAttach();
|
|
|
344
|
+ caseAttach.setCaseAppliId(caseAppliId);
|
|
|
345
|
+ caseAttach.setAnnexType(7);
|
|
|
346
|
+ caseAttach.setAnnexPath(savePath);
|
|
|
347
|
+ caseAttach.setAnnexName(saveName);
|
|
|
348
|
+ caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
|
|
349
|
+ }
|
|
342
|
350
|
|
|
343
|
|
- // 创建日期目录
|
|
344
|
|
- File saveFolder = new File(saveFolderPath);
|
|
345
|
|
- if (!saveFolder.exists()) {
|
|
346
|
|
- saveFolder.mkdirs();
|
|
|
351
|
+ }
|
|
347
|
352
|
}
|
|
348
|
|
- String resultFilePath = saveFolderPath + "/" + fileName;
|
|
349
|
|
- File resultFilePathFile = new File(resultFilePath);
|
|
350
|
|
- if (!resultFilePathFile.exists()) {
|
|
351
|
|
- resultFilePathFile.createNewFile();
|
|
|
353
|
+ }
|
|
|
354
|
+ }else {
|
|
|
355
|
+ if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 1)) {
|
|
|
356
|
+ //更新立案申请状态为待用印
|
|
|
357
|
+// MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
|
|
|
358
|
+ if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 1)) {
|
|
|
359
|
+ // 根据流程id查找下一个流程节点
|
|
|
360
|
+ MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
|
|
|
361
|
+ MsCaseApplication application = new MsCaseApplication();
|
|
|
362
|
+ application.setId(caseApplicationselect.getId());
|
|
|
363
|
+ application.setCaseFlowId(nextFlow.getId());
|
|
|
364
|
+ application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
|
365
|
+ caseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
|
366
|
+
|
|
|
367
|
+ //修改"签署用印记录表"的状态为待用印
|
|
|
368
|
+ mssealSignRecord.setSignFlowStatus(2);
|
|
|
369
|
+ sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
|
|
352
|
370
|
}
|
|
|
371
|
+ }
|
|
|
372
|
+ if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 2)) {
|
|
|
373
|
+ //更新立案申请状态为待送达
|
|
|
374
|
+// MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
|
|
|
375
|
+
|
|
|
376
|
+ if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 2)) {
|
|
|
377
|
+ //修改"签署用印记录表"的状态为签署完成
|
|
|
378
|
+ mssealSignRecord.setSignFlowStatus(3);
|
|
|
379
|
+ sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
|
|
|
380
|
+
|
|
|
381
|
+ // 根据流程id查找下一个流程节点
|
|
|
382
|
+ MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
|
|
|
383
|
+ MsCaseApplication application = new MsCaseApplication();
|
|
|
384
|
+ application.setId(caseApplicationselect.getId());
|
|
|
385
|
+ application.setCaseFlowId(nextFlow.getId());
|
|
|
386
|
+ application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
|
387
|
+ caseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
|
388
|
+
|
|
|
389
|
+ //下载审核完成的调解书
|
|
|
390
|
+ String signFlowId = sealSignRecord.getSignFlowid();
|
|
|
391
|
+ EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
|
|
392
|
+ JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
|
|
|
393
|
+ JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
|
|
394
|
+ JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
|
|
|
395
|
+ if (filesArray != null && filesArray.size() > 0) {
|
|
|
396
|
+ JsonObject fileObject = (JsonObject) filesArray.get(0);
|
|
|
397
|
+ String fileDownloadUrl = fileObject.get("downloadUrl").toString();
|
|
|
398
|
+ LocalDate now = LocalDate.now();
|
|
|
399
|
+ String year = Integer.toString(now.getYear());
|
|
|
400
|
+ String month = String.format("%02d", now.getMonthValue());
|
|
|
401
|
+ String day = String.format("%02d", now.getDayOfMonth());
|
|
|
402
|
+ String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
403
|
+ String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
|
404
|
+// String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
405
|
+// String savePath = "/home/ruoyi/uploadPath/upload/";
|
|
|
406
|
+ String saveName = fileName;
|
|
|
407
|
+ String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
353
|
408
|
|
|
354
|
|
- String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
|
355
|
|
- boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
|
356
|
|
- if (downLoadFile) {
|
|
357
|
|
- Long caseAppliId = sealSignRecord.getCaseAppliId();
|
|
358
|
|
- MsCaseAttach caseAttach = new MsCaseAttach();
|
|
359
|
|
- caseAttach.setCaseAppliId(caseAppliId);
|
|
360
|
|
- caseAttach.setAnnexType(7);
|
|
361
|
|
- caseAttach.setAnnexPath(savePath);
|
|
362
|
|
- caseAttach.setAnnexName(saveName);
|
|
363
|
|
- caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
|
364
|
|
- }
|
|
|
409
|
+ // 创建日期目录
|
|
|
410
|
+ File saveFolder = new File(saveFolderPath);
|
|
|
411
|
+ if (!saveFolder.exists()) {
|
|
|
412
|
+ saveFolder.mkdirs();
|
|
|
413
|
+ }
|
|
|
414
|
+ String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
415
|
+ File resultFilePathFile = new File(resultFilePath);
|
|
|
416
|
+ if (!resultFilePathFile.exists()) {
|
|
|
417
|
+ resultFilePathFile.createNewFile();
|
|
|
418
|
+ }
|
|
365
|
419
|
|
|
|
420
|
+ String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
|
|
421
|
+ boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
|
|
422
|
+ if (downLoadFile) {
|
|
|
423
|
+ Long caseAppliId = sealSignRecord.getCaseAppliId();
|
|
|
424
|
+ MsCaseAttach caseAttach = new MsCaseAttach();
|
|
|
425
|
+ caseAttach.setCaseAppliId(caseAppliId);
|
|
|
426
|
+ caseAttach.setAnnexType(7);
|
|
|
427
|
+ caseAttach.setAnnexPath(savePath);
|
|
|
428
|
+ caseAttach.setAnnexName(saveName);
|
|
|
429
|
+ caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
|
|
430
|
+ }
|
|
|
431
|
+
|
|
|
432
|
+ }
|
|
|
433
|
+ }
|
|
366
|
434
|
}
|
|
|
435
|
+
|
|
367
|
436
|
}
|
|
368
|
437
|
}
|
|
|
438
|
+
|
|
|
439
|
+
|
|
|
440
|
+
|
|
|
441
|
+
|
|
|
442
|
+
|
|
369
|
443
|
}
|
|
370
|
444
|
|
|
371
|
445
|
}
|