Skip to content

Commit

Permalink
[Fix] Fix abnormal data in pg query (DataLinkDC#3768)
Browse files Browse the repository at this point in the history
Signed-off-by: Zzm0809 <934230207@qq.com>
Co-authored-by: Zzm0809 <Zzm0809@users.noreply.github.com>
  • Loading branch information
Zzm0809 and Zzm0809 authored Sep 2, 2024
1 parent acc53b1 commit b5ee335
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1041,16 +1041,19 @@ public List<TaskDTO> getUserTasks(Integer userId) {
}
}
});

LambdaQueryWrapper<JobInstance> wrapper = new LambdaQueryWrapper<>();
wrapper.in(JobInstance::getId, tskMap.keySet());
jobInstanceService.getBaseMapper().selectList(wrapper, resultContext -> {
JobInstance jobInstance = resultContext.getResultObject();
TaskDTO taskDTO = tskMap.get(jobInstance.getId());
if (Objects.nonNull(taskDTO)) {
taskDTO.setStatus(jobInstance.getStatus());
}
});
// When the postgre data source query in () is empty, a syntax error will be reported, so it is necessary to
// judge
if (!tskMap.keySet().isEmpty()) {
LambdaQueryWrapper<JobInstance> wrapper = new LambdaQueryWrapper<>();
wrapper.in(JobInstance::getId, tskMap.keySet());
jobInstanceService.getBaseMapper().selectList(wrapper, resultContext -> {
JobInstance jobInstance = resultContext.getResultObject();
TaskDTO taskDTO = tskMap.get(jobInstance.getId());
if (Objects.nonNull(taskDTO)) {
taskDTO.setStatus(jobInstance.getStatus());
}
});
}

List<TaskDTO> tasks = new ArrayList<>(tskMap.values());
// 按照step排序,发布>开发>,相同情况 下按照状态排序
Expand Down

0 comments on commit b5ee335

Please sign in to comment.