diff --git a/.gitignore b/.gitignore index 0c8527a..a0be7ae 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,6 @@ backend-java/*.iml # desktop app desktop/ ERP-Demo/ +xlsx/ +app/__pycache__ +backend/__pycache__ diff --git a/app/__pycache__/config.cpython-312.pyc b/app/__pycache__/config.cpython-312.pyc index d29bfaf..8afe47f 100644 Binary files a/app/__pycache__/config.cpython-312.pyc and b/app/__pycache__/config.cpython-312.pyc differ diff --git a/app/blueprints/__pycache__/brand.cpython-312.pyc b/app/blueprints/__pycache__/brand.cpython-312.pyc index adf7c02..79482d1 100644 Binary files a/app/blueprints/__pycache__/brand.cpython-312.pyc and b/app/blueprints/__pycache__/brand.cpython-312.pyc differ diff --git a/app/brand_spider/__pycache__/main.cpython-312.pyc b/app/brand_spider/__pycache__/main.cpython-312.pyc index 161636e..9c07e7b 100644 Binary files a/app/brand_spider/__pycache__/main.cpython-312.pyc and b/app/brand_spider/__pycache__/main.cpython-312.pyc differ diff --git a/app/version.txt b/app/version.txt index fa60655..52a718a 100644 --- a/app/version.txt +++ b/app/version.txt @@ -1 +1 @@ -{"version": "1.0.3"} \ No newline at end of file +{"version": "1.0.13"} \ No newline at end of file diff --git a/backend-java/src/main/java/com/nanri/aiimage/modules/brand/controller/BrandTaskController.java b/backend-java/src/main/java/com/nanri/aiimage/modules/brand/controller/BrandTaskController.java index 6639ea9..b4ad774 100644 --- a/backend-java/src/main/java/com/nanri/aiimage/modules/brand/controller/BrandTaskController.java +++ b/backend-java/src/main/java/com/nanri/aiimage/modules/brand/controller/BrandTaskController.java @@ -124,9 +124,8 @@ public class BrandTaskController { @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "404", description = "任务不存在") }) public ApiResponse getTask( - @Parameter(description = "品牌任务 ID", required = true) @PathVariable Long taskId, - @Parameter(description = "用户 ID", required = true) @RequestParam Long userId) { - return ApiResponse.success(brandTaskService.getTaskDetailLegacy(taskId, userId)); + @Parameter(description = "品牌任务 ID", required = true) @PathVariable Long taskId) { + return ApiResponse.success(brandTaskService.getTaskDetailLegacy(taskId)); } @PostMapping("/tasks/{taskId}/result") @@ -154,9 +153,8 @@ public class BrandTaskController { }) public ApiResponse submitResult( @Parameter(description = "品牌任务 ID", required = true) @PathVariable Long taskId, - @Parameter(description = "用户 ID", required = true) @RequestParam Long userId, @Valid @RequestBody BrandCrawlResultRequest request) { - brandTaskService.submitCrawlResult(taskId, userId, request); + brandTaskService.submitCrawlResult(taskId, request); return ApiResponse.success(new BrandSimpleVo(true)); } @@ -170,9 +168,8 @@ public class BrandTaskController { @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "400", description = "任务不存在或当前状态不可取消") }) public ApiResponse cancelTask( - @Parameter(description = "品牌任务 ID", required = true) @PathVariable Long taskId, - @Parameter(description = "用户 ID", required = true) @RequestParam Long userId) { - brandTaskService.cancelTask(taskId, userId); + @Parameter(description = "品牌任务 ID", required = true) @PathVariable Long taskId) { + brandTaskService.cancelTask(taskId); return ApiResponse.success(new BrandSimpleVo(true)); } @@ -186,9 +183,8 @@ public class BrandTaskController { @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "400", description = "任务不存在或正在执行中不可删除") }) public ApiResponse deleteTask( - @Parameter(description = "品牌任务 ID", required = true) @PathVariable Long taskId, - @Parameter(description = "用户 ID", required = true) @RequestParam Long userId) { - brandTaskService.deleteTask(taskId, userId); + @Parameter(description = "品牌任务 ID", required = true) @PathVariable Long taskId) { + brandTaskService.deleteTask(taskId); return ApiResponse.success(new BrandSimpleVo(true)); } @@ -202,9 +198,8 @@ public class BrandTaskController { @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "404", description = "任务不存在或无结果可下载") }) public ResponseEntity download( - @Parameter(description = "品牌任务 ID", required = true) @PathVariable Long taskId, - @Parameter(description = "用户 ID", required = true) @RequestParam Long userId) { - String url = brandTaskService.resolveDownloadUrl(taskId, userId); + @Parameter(description = "品牌任务 ID", required = true) @PathVariable Long taskId) { + String url = brandTaskService.resolveDownloadUrl(taskId); return ResponseEntity.status(302) .header(HttpHeaders.LOCATION, url) .build(); diff --git a/backend-java/src/main/java/com/nanri/aiimage/modules/brand/service/BrandTaskService.java b/backend-java/src/main/java/com/nanri/aiimage/modules/brand/service/BrandTaskService.java index 1ab7e99..39ed9f9 100644 --- a/backend-java/src/main/java/com/nanri/aiimage/modules/brand/service/BrandTaskService.java +++ b/backend-java/src/main/java/com/nanri/aiimage/modules/brand/service/BrandTaskService.java @@ -139,8 +139,8 @@ public class BrandTaskService { return vo; } - public LegacyBrandTaskDetailVo getTaskDetailLegacy(Long taskId, Long userId) { - BrandCrawlTaskEntity task = requireTask(taskId, userId); + public LegacyBrandTaskDetailVo getTaskDetailLegacy(Long taskId) { + BrandCrawlTaskEntity task = requireTask(taskId); LegacyBrandTaskDetailVo vo = new LegacyBrandTaskDetailVo(); vo.setTask(toLegacyTaskItem(task)); vo.setLine_progress(buildLineProgress(taskId)); @@ -204,8 +204,8 @@ public class BrandTaskService { return vo; } - public void submitCrawlResult(Long taskId, Long userId, BrandCrawlResultRequest request) { - BrandCrawlTaskEntity task = requireTask(taskId, userId); + public void submitCrawlResult(Long taskId, BrandCrawlResultRequest request) { + BrandCrawlTaskEntity task = requireTask(taskId); if (STATUS_CANCELLED.equalsIgnoreCase(blankToDefault(task.getStatus(), STATUS_PENDING))) { throw new BusinessException("任务已取消"); } @@ -310,11 +310,10 @@ public class BrandTaskService { } } - public void cancelTask(Long taskId, Long userId) { - requireTask(taskId, userId); + public void cancelTask(Long taskId) { + requireTask(taskId); int updated = brandCrawlTaskMapper.update(null, new LambdaUpdateWrapper() .eq(BrandCrawlTaskEntity::getId, taskId) - .eq(BrandCrawlTaskEntity::getUserId, userId) .in(BrandCrawlTaskEntity::getStatus, STATUS_PENDING, STATUS_RUNNING) .set(BrandCrawlTaskEntity::getStatus, STATUS_CANCELLED)); if (updated == 0) { @@ -323,19 +322,18 @@ public class BrandTaskService { brandTaskProgressCacheService.delete(taskId); } - public void deleteTask(Long taskId, Long userId) { - requireTask(taskId, userId); + public void deleteTask(Long taskId) { + requireTask(taskId); int deleted = brandCrawlTaskMapper.delete(new LambdaQueryWrapper() .eq(BrandCrawlTaskEntity::getId, taskId) - .eq(BrandCrawlTaskEntity::getUserId, userId) .ne(BrandCrawlTaskEntity::getStatus, STATUS_RUNNING)); if (deleted == 0) { throw new BusinessException("任务不存在或正在执行中无法删除"); } } - public String resolveDownloadUrl(Long taskId, Long userId) { - BrandCrawlTaskEntity task = requireTask(taskId, userId); + public String resolveDownloadUrl(Long taskId) { + BrandCrawlTaskEntity task = requireTask(taskId); Object raw = parseJsonValue(task.getResultPaths()); if (!(raw instanceof Map map)) { throw new BusinessException("无结果可下载");