|
@@ -208,10 +208,10 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
|
|
if (resultMap == null || (Integer) resultMap.get("total") == 0) {
|
|
if (resultMap == null || (Integer) resultMap.get("total") == 0) {
|
|
ThrowException.throwXiaoShiException("未检索到相关专利");
|
|
ThrowException.throwXiaoShiException("未检索到相关专利");
|
|
} else {
|
|
} else {
|
|
- List<StarPatentVO> starPatentVOS =(List<StarPatentVO>)resultMap.get("records");
|
|
|
|
- StarPatentVO starPatentVO =starPatentVOS.get(0);
|
|
|
|
- String pDStr = starPatentVO.getPD();
|
|
|
|
- Date publicDate = DateUtils2.formStrToDate(pDStr);
|
|
|
|
|
|
+ List<StarPatentVO> starPatentVOS = (List<StarPatentVO>) resultMap.get("records");
|
|
|
|
+ StarPatentVO starPatentVO = starPatentVOS.get(0);
|
|
|
|
+ String pDStr = starPatentVO.getPD();
|
|
|
|
+ Date publicDate = DateUtils2.formStrToDate(pDStr);
|
|
importTask.setUpdateToDate(publicDate);
|
|
importTask.setUpdateToDate(publicDate);
|
|
importTask.setAllNum((Integer) resultMap.get("total"));
|
|
importTask.setAllNum((Integer) resultMap.get("total"));
|
|
}
|
|
}
|
|
@@ -506,12 +506,9 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
|
|
} else if ((sqls.get(0) == null || sqls.get(0).equals("")) && !rootSql.equals("")) {
|
|
} else if ((sqls.get(0) == null || sqls.get(0).equals("")) && !rootSql.equals("")) {
|
|
sqls.set(0, rootSql);
|
|
sqls.set(0, rootSql);
|
|
}
|
|
}
|
|
-
|
|
|
|
return sqls;
|
|
return sqls;
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
public Integer addPdfTask(AddImportPDFTaskDTO addImportPDFTaskDTO) {
|
|
public Integer addPdfTask(AddImportPDFTaskDTO addImportPDFTaskDTO) {
|
|
String fileGuid = addImportPDFTaskDTO.getFileGuid();
|
|
String fileGuid = addImportPDFTaskDTO.getFileGuid();
|
|
Integer pdfType = addImportPDFTaskDTO.getPdfType();
|
|
Integer pdfType = addImportPDFTaskDTO.getPdfType();
|
|
@@ -531,21 +528,20 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
|
|
schedulingTaskService.startTask();
|
|
schedulingTaskService.startTask();
|
|
return importTask.getId();
|
|
return importTask.getId();
|
|
}
|
|
}
|
|
- public void addImportTaskByCondition(ImportTaskCondition importTaskCondition){
|
|
|
|
- //根据id查询最近更新的任务
|
|
|
|
- LambdaQueryWrapper<ImportTask> queryWrapper =new LambdaQueryWrapper<>();
|
|
|
|
- queryWrapper.eq(ImportTask::getImportTaskConditionId,importTaskCondition.getId())
|
|
|
|
- .orderByDesc(ImportTask::getUpdateToDate);
|
|
|
|
- ImportTask lastImportTask =this.getOne(queryWrapper);
|
|
|
|
|
|
|
|
- String condition =importTaskCondition.getSearchCondition();
|
|
|
|
- if(lastImportTask !=null&&lastImportTask.getUpdateToDate()!=null)
|
|
|
|
- {
|
|
|
|
- String dateStr= DateUtils2.dateTimeToPatentStr(lastImportTask.getUpdateToDate());
|
|
|
|
- condition =condition+"and PD="+dateStr;
|
|
|
|
|
|
+ public void addImportTaskByCondition(ImportTaskCondition importTaskCondition) {
|
|
|
|
+ //根据id查询最近更新的任务
|
|
|
|
+ LambdaQueryWrapper<ImportTask> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ queryWrapper.eq(ImportTask::getImportTaskConditionId, importTaskCondition.getId())
|
|
|
|
+ .orderByDesc(ImportTask::getUpdateToDate);
|
|
|
|
+ ImportTask lastImportTask = this.getOne(queryWrapper);
|
|
|
|
+ String condition = importTaskCondition.getSearchCondition();
|
|
|
|
+ if (lastImportTask != null && lastImportTask.getUpdateToDate() != null) {
|
|
|
|
+ String dateStr = DateUtils2.dateTimeToPatentStr(lastImportTask.getUpdateToDate());
|
|
|
|
+ condition = condition + "and PD>" + dateStr;
|
|
}
|
|
}
|
|
PatentStarListDTO patentStarListDto = new PatentStarListDTO()
|
|
PatentStarListDTO patentStarListDto = new PatentStarListDTO()
|
|
- .setCurrentQuery(condition )
|
|
|
|
|
|
+ .setCurrentQuery(condition)
|
|
.setPageNum(1)
|
|
.setPageNum(1)
|
|
.setRowCount(10)
|
|
.setRowCount(10)
|
|
.setDBType(importTaskCondition.getDbType());
|
|
.setDBType(importTaskCondition.getDbType());
|
|
@@ -555,18 +551,15 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
|
|
Map<String, Object> resultMap = patentStarApiService.patentStarSearchApi(patentStarListDto);
|
|
Map<String, Object> resultMap = patentStarApiService.patentStarSearchApi(patentStarListDto);
|
|
if (resultMap == null || (Integer) resultMap.get("total") == 0) {
|
|
if (resultMap == null || (Integer) resultMap.get("total") == 0) {
|
|
return;
|
|
return;
|
|
- }
|
|
|
|
- else {
|
|
|
|
- List<StarPatentVO> starPatentVOS =(List<StarPatentVO>)resultMap.get("records");
|
|
|
|
- StarPatentVO starPatentVO =starPatentVOS.get(0);
|
|
|
|
- String pDStr = starPatentVO.getPD();
|
|
|
|
- Date publicDate = DateUtils2.formStrToDate(pDStr);
|
|
|
|
|
|
+ } else {
|
|
|
|
+ List<StarPatentVO> starPatentVOS = (List<StarPatentVO>) resultMap.get("records");
|
|
|
|
+ StarPatentVO starPatentVO = starPatentVOS.get(0);
|
|
|
|
+ String pDStr = starPatentVO.getPD();
|
|
|
|
+ Date publicDate = DateUtils2.formStrToDate(pDStr);
|
|
importTask.setUpdateToDate(publicDate);
|
|
importTask.setUpdateToDate(publicDate);
|
|
importTask.setAllNum((Integer) resultMap.get("total"));
|
|
importTask.setAllNum((Integer) resultMap.get("total"));
|
|
}
|
|
}
|
|
- }
|
|
|
|
-
|
|
|
|
- catch (Exception e){
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
|
|
|
}
|
|
}
|
|
@@ -575,6 +568,9 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
|
|
importTask.setType(importTaskCondition.getType());
|
|
importTask.setType(importTaskCondition.getType());
|
|
importTask.setSearchCondition(condition);
|
|
importTask.setSearchCondition(condition);
|
|
importTask.setCreateId(importTaskCondition.getCreateId());
|
|
importTask.setCreateId(importTaskCondition.getCreateId());
|
|
|
|
+ Date date = new Date();
|
|
|
|
+ Date toDate = DateUtils.getDate(date, -7);
|
|
|
|
+ importTask.setUpdateToDate(toDate);
|
|
importTask.insert();
|
|
importTask.insert();
|
|
|
|
|
|
}
|
|
}
|