From 9ffd9358d8d15cdce1973923cb95d91d41edfdc7 Mon Sep 17 00:00:00 2001 From: caofengbin <1050430934@qq.com> Date: Wed, 20 Dec 2023 15:04:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=94=AF=E6=8C=81=E6=8C=89?= =?UTF-8?q?=E4=BD=9C=E8=80=85=E8=BF=9B=E8=A1=8C=E7=AD=9B=E9=80=89=E7=9A=84?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/controller/TestCasesController.java | 7 ++++--- .../sonic/controller/services/TestCasesService.java | 5 +++-- .../services/impl/TestCasesServiceImpl.java | 12 +++++++----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/TestCasesController.java b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/TestCasesController.java index 3f27e715..56be6e10 100644 --- a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/TestCasesController.java +++ b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/TestCasesController.java @@ -59,10 +59,10 @@ public class TestCasesController { @Parameter(name = "platform", description = "平台类型"), @Parameter(name = "name", description = "用例名称"), @Parameter(name = "moduleIds", description = "模块Id"), + @Parameter(name = "caseAuthorNames", description = "用例作者列表"), @Parameter(name = "page", description = "页码"), @Parameter(name = "pageSize", description = "页数据大小"), @Parameter(name = "idSort", description = "控制id排序方式"), - @Parameter(name = "designerSort", description = "控制designer排序方式"), @Parameter(name = "editTimeSort", description = "控制editTime排序方式") }) @@ -71,15 +71,16 @@ public RespModel> findAll(@RequestParam(name = "projec @RequestParam(name = "platform") int platform, @RequestParam(name = "name", required = false) String name, @RequestParam(name = "moduleIds[]", required = false) List moduleIds, + @RequestParam(name = "caseAuthorNames[]", required = false) List caseAuthorNames, @RequestParam(name = "page") int page, @RequestParam(name = "pageSize") int pageSize, @RequestParam(name = "idSort", required = false) String idSort, - @RequestParam(value = "designerSort", required = false) String designerSort, @RequestParam(value = "editTimeSort", required = false) String editTimeSort) { Page pageable = new Page<>(page, pageSize); return new RespModel<>( RespEnum.SEARCH_OK, - testCasesService.findAll(projectId, platform, name, moduleIds, pageable, idSort, designerSort, editTimeSort) + testCasesService.findAll(projectId, platform, name, moduleIds, caseAuthorNames, + pageable, idSort, editTimeSort) ); } diff --git a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/TestCasesService.java b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/TestCasesService.java index 9276f17b..d3d7beba 100644 --- a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/TestCasesService.java +++ b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/TestCasesService.java @@ -15,8 +15,9 @@ * @date 2021/8/20 17:51 */ public interface TestCasesService extends IService { - CommentPage findAll(int projectId, int platform, String name, List moduleIds, Page pageable, - String idSort, String designerSort, String editTimeSort); + CommentPage findAll(int projectId, int platform, String name, List moduleIds, + List caseAuthorNames, Page pageable, + String idSort, String editTimeSort); List findAll(int projectId, int platform); diff --git a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/TestCasesServiceImpl.java b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/TestCasesServiceImpl.java index 173436de..30d74683 100644 --- a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/TestCasesServiceImpl.java +++ b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/TestCasesServiceImpl.java @@ -66,20 +66,22 @@ public class TestCasesServiceImpl extends SonicServiceImpl findAll(int projectId, int platform, String name, List moduleIds, Page pageable, - String idSort, String designerSort, String editTimeSort) { + public CommentPage findAll(int projectId, int platform, String name, List moduleIds, + List caseAuthorNames, + Page pageable, + String idSort, String editTimeSort) { LambdaQueryChainWrapper lambdaQuery = lambdaQuery(); lambdaQuery.eq(projectId != 0, TestCases::getProjectId, projectId) .eq(platform != 0, TestCases::getPlatform, platform) .in(moduleIds != null && moduleIds.size() > 0, TestCases::getModuleId, moduleIds) + .in(caseAuthorNames != null && caseAuthorNames.size() > 0, TestCases::getDesigner, caseAuthorNames) .like(!StringUtils.isEmpty(name), TestCases::getName, name) - .orderByDesc(StringUtils.isEmpty(editTimeSort) && StringUtils.isEmpty(idSort) && StringUtils.isEmpty(designerSort), + .orderByDesc(StringUtils.isEmpty(editTimeSort) && StringUtils.isEmpty(idSort), TestCases::getEditTime) .orderBy(!StringUtils.isEmpty(editTimeSort), "asc".equals(editTimeSort), TestCases::getEditTime) - .orderBy(!StringUtils.isEmpty(idSort), "asc".equals(idSort), TestCases::getId) - .orderBy(!StringUtils.isEmpty(designerSort), "asc".equals(designerSort), TestCases::getDesigner); + .orderBy(!StringUtils.isEmpty(idSort), "asc".equals(idSort), TestCases::getId); //写入对应模块信息 Page page = lambdaQuery.page(pageable);