fix: 修复完结任务时不再强制要求交付路径

This commit is contained in:
Your Name 2026-01-07 00:28:03 +08:00
parent 67b2440ee9
commit 724c1b8b8f

View File

@ -300,7 +300,10 @@ public class TaskItemService {
try {
downloadUrl = externalAssetService.checkTaskCompletion(taskNo);
} catch (Exception e) {
log.warn("调用第三方素材API失败", e);
log.warn("调用第三方素材API失败: {}", e.getMessage());
// API调用失败时,提示用户
throw new BusinessException(ResultCode.ERROR,
"素材API验证失败,请稍后重试或联系管理员");
}
if (downloadUrl == null) {
@ -311,9 +314,11 @@ public class TaskItemService {
log.info("第三方素材API返回下载链接: {}", downloadUrl);
} else {
// 未启用第三方API,使用传统方式(需要传入deliveryPath)
if (deliveryPath == null || deliveryPath.trim().isEmpty()) {
throw new BusinessException(ResultCode.ERROR, "交付路径不能为空");
// 未启用第三方API,允许直接完结任务
log.info("第三方素材API未启用,直接完结任务: itemId={}", itemId);
// 如果有传入deliveryPath,则使用它
if (deliveryPath != null && !deliveryPath.trim().isEmpty()) {
downloadUrl = deliveryPath;
}
}