|
@@ -44,8 +44,9 @@ public class SchedulingTaskService {
|
|
|
private List<ImportTaskAMVO> importTaskAMVOS;
|
|
|
@Autowired
|
|
|
private WebVOTransformService webVOTransformService;
|
|
|
- @Autowired
|
|
|
- private PatentProjectService patentProjectService;
|
|
|
+ @Autowired
|
|
|
+ private PatentProjectService patentProjectService;
|
|
|
+
|
|
|
public void startTask() {
|
|
|
Integer freeCount = Constants.MAX_IMPORT_TASK_COUNT - threadPoolTaskExecutor.getActiveCount();
|
|
|
if (importTaskAMVOS == null) {
|
|
@@ -105,9 +106,9 @@ public class SchedulingTaskService {
|
|
|
for (ImportTask importTask : importTaskList) {
|
|
|
|
|
|
ImportTaskCondition importTaskCondition = importTaskConditions.stream().filter(item -> item.getId().equals(importTask.getImportTaskConditionId())).findFirst().orElse(null);
|
|
|
- LambdaQueryWrapper<PatentProject> queryWrapper =new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(PatentProject::getProjectId,importTaskCondition.getProjectId());
|
|
|
- PatentProject project = patentProjectService.getOne(queryWrapper);
|
|
|
+ LambdaQueryWrapper<PatentProject> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(PatentProject::getProjectId, importTaskCondition.getProjectId());
|
|
|
+
|
|
|
ImportTaskAMVO importTaskAMVO = new ImportTaskAMVO();
|
|
|
BeanUtils.copyProperties(importTask, importTaskAMVO);
|
|
|
if (importTaskCondition != null) {
|
|
@@ -122,7 +123,11 @@ public class SchedulingTaskService {
|
|
|
importTaskAMVO.setProjectType(importTaskCondition.getProjectType());
|
|
|
importTaskAMVO.setPatentNoStr(importTaskCondition.getPatentNos());
|
|
|
importTaskAMVO.setPdfType(importTaskCondition.getPdfType());
|
|
|
- importTaskAMVO.setUpdateCycle(project.getUpdateCycle());
|
|
|
+ PatentProject project = patentProjectService.getOne(queryWrapper);
|
|
|
+ if (project != null) {
|
|
|
+
|
|
|
+ importTaskAMVO.setUpdateCycle(project.getUpdateCycle());
|
|
|
+ }
|
|
|
if (importTaskCondition.getCustomFields() != null) {
|
|
|
JSONArray jsonArray = JSONArray.parseArray(importTaskCondition.getCustomFields());
|
|
|
List<EsCustomFieldDTO> dtos = jsonArray.toJavaList(EsCustomFieldDTO.class);
|
|
@@ -130,7 +135,7 @@ public class SchedulingTaskService {
|
|
|
}
|
|
|
|
|
|
//定时任务
|
|
|
- if (importTaskCondition.getIfCycle()!= null && importTaskCondition.getIfCycle()&&importTask.getUpdateToDate()!=null) {
|
|
|
+ if (importTaskCondition.getIfCycle() != null && importTaskCondition.getIfCycle() && importTask.getUpdateToDate() != null) {
|
|
|
List<EsCustomFieldDTO> dtoList = webVOTransformService.getEsCustomFieldDTOList(importTaskAMVO);
|
|
|
if (importTaskAMVO.getFieldDTOS() == null) {
|
|
|
importTaskAMVO.setFieldDTOS(dtoList);
|