更新处理这个外观部分
This commit is contained in:
+23
@@ -12,7 +12,9 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@@ -190,6 +192,27 @@ public class TaskFileJobService {
|
||||
return findJob(taskId, moduleType, resultId, JOB_TYPE_ASSEMBLE_RESULT);
|
||||
}
|
||||
|
||||
public Map<Long, TaskFileJobEntity> findAssembleJobsByResultIds(String moduleType, List<Long> resultIds) {
|
||||
List<Long> normalizedIds = resultIds == null ? List.of() : resultIds.stream()
|
||||
.filter(id -> id != null && id > 0)
|
||||
.distinct()
|
||||
.toList();
|
||||
if (normalizedIds.isEmpty() || moduleType == null || moduleType.isBlank()) {
|
||||
return Map.of();
|
||||
}
|
||||
List<TaskFileJobEntity> jobs = taskFileJobMapper.selectList(new LambdaQueryWrapper<TaskFileJobEntity>()
|
||||
.eq(TaskFileJobEntity::getModuleType, moduleType)
|
||||
.eq(TaskFileJobEntity::getJobType, JOB_TYPE_ASSEMBLE_RESULT)
|
||||
.in(TaskFileJobEntity::getResultId, normalizedIds));
|
||||
Map<Long, TaskFileJobEntity> jobMap = new LinkedHashMap<>();
|
||||
for (TaskFileJobEntity job : jobs) {
|
||||
if (job != null && job.getResultId() != null) {
|
||||
jobMap.putIfAbsent(job.getResultId(), job);
|
||||
}
|
||||
}
|
||||
return jobMap;
|
||||
}
|
||||
|
||||
public long countUnfinishedAssembleJobs(Long taskId, String moduleType) {
|
||||
if (taskId == null || taskId <= 0 || moduleType == null || moduleType.isBlank()) {
|
||||
return 0L;
|
||||
|
||||
Reference in New Issue
Block a user