fix(pricetrack): ASIN文件路径防本地路径误提交+fileKey兜底反查
This commit is contained in:
+9
-1
@@ -86,6 +86,7 @@ public class PriceTrackTaskService {
|
||||
private final TaskFileJobService taskFileJobService;
|
||||
private final TaskDistributedLockService taskDistributedLockService;
|
||||
private final TaskProgressLightAssembler taskProgressLightAssembler;
|
||||
private final com.nanri.aiimage.modules.file.service.LocalFileStorageService localFileStorageService;
|
||||
|
||||
private FileTaskEntity loadTaskForExecution(Long taskId) {
|
||||
Map<Long, FileTaskEntity> cachedTasks = priceTrackTaskCacheService.getTaskCacheBatch(List.of(taskId));
|
||||
@@ -1463,7 +1464,14 @@ public class PriceTrackTaskService {
|
||||
}
|
||||
File file = new File(rawPath);
|
||||
if (!file.isFile()) {
|
||||
throw new BusinessException("ASIN file not found: " + rawPath);
|
||||
// 直接路径不可读时兜底:按上传返回的 fileKey 反查服务器本地临时目录
|
||||
File resolved = localFileStorageService.findLocalSourceFile(rawPath);
|
||||
if (resolved != null) {
|
||||
file = resolved;
|
||||
}
|
||||
}
|
||||
if (!file.isFile()) {
|
||||
throw new BusinessException("ASIN 文件不存在或不可读: " + rawPath);
|
||||
}
|
||||
String lowerName = file.getName().toLowerCase(Locale.ROOT);
|
||||
if (lowerName.endsWith(".csv")) {
|
||||
|
||||
Reference in New Issue
Block a user