|
@@ -118,9 +118,10 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
-// @Scheduled(cron = "0 0 1 * * ?")
|
|
|
- @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Throwable.class)
|
|
|
+ @Scheduled(cron = "0 0 1 * * ?")
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
|
|
public void getCaseInfoByHanding() throws Exception {
|
|
|
+ System.out.println("新申请递交中类型的案件相关信息开始导入-----importBegin");
|
|
|
//重试机制
|
|
|
int retry = 0;
|
|
|
int retrySum = 3;
|
|
@@ -268,6 +269,7 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
|
this.addDiscrepancy(caseNo);
|
|
|
|
|
|
}
|
|
|
+ System.out.println("新申请递交中类型的案件相关信息完成导入-----importEnd");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -276,9 +278,10 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @Scheduled(cron = "0 30 14 * * ?")
|
|
|
+ @Scheduled(cron = "0 0 3 * * ?")
|
|
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Throwable.class)
|
|
|
public void getCaseInfoByFinish() throws Exception {
|
|
|
+ System.out.println("新申请完成类型的案件相关信息开始导入-----importBegin");
|
|
|
int retry = 0;
|
|
|
int retrySum = 3;
|
|
|
//初始化谷歌浏览器
|
|
@@ -439,6 +442,7 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
|
this.getCaseFile(caseNo);
|
|
|
this.addDiscrepancy(caseNo);
|
|
|
}
|
|
|
+ System.out.println("新申请完成类型的案件相关信息完成导入-----importEnd");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -508,9 +512,12 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
|
/**
|
|
|
* 根据案号获取该案件的文件信息
|
|
|
* 初稿、内部定稿、定稿分别进行保存到文件关联表中
|
|
|
+ *
|
|
|
* @param caseNo
|
|
|
*/
|
|
|
public void getCaseFile(String caseNo) {
|
|
|
+ int retry = 0;
|
|
|
+ int retrySum = 3;
|
|
|
ChromeOptions options = new ChromeOptions();
|
|
|
options.addArguments("user-data-dir=" + strFileSavePath);
|
|
|
options.addArguments("--lang=nl");
|
|
@@ -633,8 +640,10 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException("An error occurred while retrieving case info", e);
|
|
|
+ retry += 1;
|
|
|
+ if (retry < retrySum) {
|
|
|
+ this.getCaseFile(caseNo);
|
|
|
+ }
|
|
|
} finally {
|
|
|
if (driver != null) {
|
|
|
driver.quit();
|
|
@@ -794,7 +803,9 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
|
if (ObjectUtils.isNotEmpty(caseFile)) {
|
|
|
List<AssoCaseFile> assoCaseFiles = assoCaseFileMapper.selectList(new LambdaQueryWrapper<AssoCaseFile>()
|
|
|
.eq(AssoCaseFile::getCaseId, caseFile.getId()));
|
|
|
- if (assoCaseFiles.size() != 3) {
|
|
|
+ if (assoCaseFiles.size() < 3) {
|
|
|
+ assoCaseFileMapper.delete(new LambdaQueryWrapper<AssoCaseFile>()
|
|
|
+ .eq(AssoCaseFile::getCaseId, caseFile.getId()));
|
|
|
caseFileMapper.deleteById(caseFile.getId());
|
|
|
} else {
|
|
|
AssoCaseFile assoCaseFile1 = assoCaseFiles.stream().filter(i -> i.getFileType() == 1).findFirst().orElse(null);
|
|
@@ -1064,7 +1075,7 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
|
detail.setDiffContent(html3);
|
|
|
detail.setRate(diff.toString());
|
|
|
detail.setSimilarity(String.format("%.6f", similarity));
|
|
|
- detail.insert();
|
|
|
+ detail. insert();
|
|
|
}
|
|
|
|
|
|
// 关闭文档
|