fix(用例管理):用例评审的num独立生成,修改获取第三方的需求的参数
This commit is contained in:
parent
dc2a4efec9
commit
8cf01882d3
|
@ -20,5 +20,6 @@ public enum ApplicationNumScope {
|
||||||
|
|
||||||
BUG_MANAGEMENT,
|
BUG_MANAGEMENT,
|
||||||
|
|
||||||
CASE_MANAGEMENT
|
CASE_MANAGEMENT,
|
||||||
|
REVIEW_CASE_MANAGEMENT
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class FunctionalCaseDemandController {
|
||||||
|
|
||||||
@PostMapping("/page")
|
@PostMapping("/page")
|
||||||
@Operation(summary = "用例管理-功能用例-关联需求-获取已关联的需求列表")
|
@Operation(summary = "用例管理-功能用例-关联需求-获取已关联的需求列表")
|
||||||
@RequiresPermissions(value = {PermissionConstants.FUNCTIONAL_CASE_READ,PermissionConstants.FUNCTIONAL_CASE_READ_ADD, PermissionConstants.FUNCTIONAL_CASE_READ_UPDATE, PermissionConstants.FUNCTIONAL_CASE_READ_DELETE}, logical = Logical.OR)
|
@RequiresPermissions(value = {PermissionConstants.FUNCTIONAL_CASE_READ, PermissionConstants.FUNCTIONAL_CASE_READ_ADD, PermissionConstants.FUNCTIONAL_CASE_READ_UPDATE, PermissionConstants.FUNCTIONAL_CASE_READ_DELETE}, logical = Logical.OR)
|
||||||
public Pager<List<FunctionalDemandDTO>> listFunctionalCaseDemands(@Validated @RequestBody QueryDemandListRequest request) {
|
public Pager<List<FunctionalDemandDTO>> listFunctionalCaseDemands(@Validated @RequestBody QueryDemandListRequest request) {
|
||||||
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), true);
|
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), true);
|
||||||
return PageUtils.setPageInfo(page, functionalCaseDemandService.listFunctionalCaseDemands(request));
|
return PageUtils.setPageInfo(page, functionalCaseDemandService.listFunctionalCaseDemands(request));
|
||||||
|
@ -74,7 +74,7 @@ public class FunctionalCaseDemandController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/third/list/page")
|
@PostMapping("/third/list/page")
|
||||||
@Operation(summary = "用例管理-功能用例-关联需求-批量关联需求")
|
@Operation(summary = "用例管理-功能用例-关联需求-获取三方需求列表")
|
||||||
@RequiresPermissions(value = {PermissionConstants.FUNCTIONAL_CASE_READ_ADD, PermissionConstants.FUNCTIONAL_CASE_READ_UPDATE, PermissionConstants.FUNCTIONAL_CASE_READ_DELETE}, logical = Logical.OR)
|
@RequiresPermissions(value = {PermissionConstants.FUNCTIONAL_CASE_READ_ADD, PermissionConstants.FUNCTIONAL_CASE_READ_UPDATE, PermissionConstants.FUNCTIONAL_CASE_READ_DELETE}, logical = Logical.OR)
|
||||||
public PluginPager<PlatformDemandDTO> pageDemand(@RequestBody @Validated FunctionalThirdDemandPageRequest request) {
|
public PluginPager<PlatformDemandDTO> pageDemand(@RequestBody @Validated FunctionalThirdDemandPageRequest request) {
|
||||||
return functionalCaseDemandService.pageDemand(request);
|
return functionalCaseDemandService.pageDemand(request);
|
||||||
|
|
|
@ -1,33 +1,16 @@
|
||||||
package io.metersphere.functional.request;
|
package io.metersphere.functional.request;
|
||||||
|
|
||||||
|
import io.metersphere.system.dto.sdk.BasePageRequest;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.Max;
|
|
||||||
import jakarta.validation.constraints.Min;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class FunctionalThirdDemandPageRequest {
|
public class FunctionalThirdDemandPageRequest extends BasePageRequest {
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "ms系统当前的项目id", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "ms系统当前的项目id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotBlank(message = "{functional_third_demand_page_request.project_id.not_blank}")
|
@NotBlank(message = "{functional_third_demand_page_request.project_id.not_blank}")
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
|
||||||
@Schema(description = "需求分页查询关键字")
|
|
||||||
private String query;
|
|
||||||
|
|
||||||
@Schema(description = "列表筛选条件")
|
|
||||||
private Map<String, Object> filter;
|
|
||||||
|
|
||||||
@Schema(description = "开始页码", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@Min(value = 1, message = "当前页码必须大于0")
|
|
||||||
private int startPage;
|
|
||||||
|
|
||||||
@Schema(description = "每页条数", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@Min(value = 5, message = "每页显示条数必须不小于5")
|
|
||||||
@Max(value = 500, message = "每页显示条数不能大于500")
|
|
||||||
private int pageSize;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package io.metersphere.functional.request;
|
||||||
|
|
||||||
import io.metersphere.system.dto.sdk.BasePageRequest;
|
import io.metersphere.system.dto.sdk.BasePageRequest;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@ -9,5 +10,10 @@ import lombok.Setter;
|
||||||
@Setter
|
@Setter
|
||||||
public class QueryDemandListRequest extends BasePageRequest {
|
public class QueryDemandListRequest extends BasePageRequest {
|
||||||
@Schema(description = "功能用例id")
|
@Schema(description = "功能用例id")
|
||||||
|
@NotBlank(message = "{demand_request.case_id.not_blank}")
|
||||||
private String caseId;
|
private String caseId;
|
||||||
|
|
||||||
|
@Schema(description = "当前项目id")
|
||||||
|
@NotBlank(message = "{demand_request.project_id.not_blank}")
|
||||||
|
private String projectId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -405,7 +405,7 @@ public class CaseReviewService {
|
||||||
* @return num
|
* @return num
|
||||||
*/
|
*/
|
||||||
public long getNextNum(String projectId) {
|
public long getNextNum(String projectId) {
|
||||||
return NumGenerator.nextNum(projectId, ApplicationNumScope.CASE_MANAGEMENT);
|
return NumGenerator.nextNum(projectId, ApplicationNumScope.REVIEW_CASE_MANAGEMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -217,9 +217,9 @@ public class FunctionalCaseDemandService {
|
||||||
|
|
||||||
public PluginPager<PlatformDemandDTO> pageDemand(FunctionalThirdDemandPageRequest request) {
|
public PluginPager<PlatformDemandDTO> pageDemand(FunctionalThirdDemandPageRequest request) {
|
||||||
DemandPageRequest demandPageRequest = new DemandPageRequest();
|
DemandPageRequest demandPageRequest = new DemandPageRequest();
|
||||||
demandPageRequest.setQuery(request.getQuery());
|
demandPageRequest.setQuery(request.getKeyword());
|
||||||
demandPageRequest.setFilter(request.getFilter());
|
//demandPageRequest.setFilter(request.getFilter());
|
||||||
demandPageRequest.setStartPage(request.getStartPage());
|
demandPageRequest.setStartPage(request.getCurrent());
|
||||||
demandPageRequest.setPageSize(request.getPageSize());
|
demandPageRequest.setPageSize(request.getPageSize());
|
||||||
demandPageRequest.setProjectConfig(projectApplicationService.getProjectDemandThirdPartConfig(request.getProjectId()));
|
demandPageRequest.setProjectConfig(projectApplicationService.getProjectDemandThirdPartConfig(request.getProjectId()));
|
||||||
Platform platform = projectApplicationService.getPlatform(request.getProjectId(), false);
|
Platform platform = projectApplicationService.getPlatform(request.getProjectId(), false);
|
||||||
|
|
|
@ -303,6 +303,7 @@ public class FunctionalCaseDemandControllerTests extends BaseTest {
|
||||||
@NotNull
|
@NotNull
|
||||||
private static QueryDemandListRequest getQueryDemandListRequest(String caseId) {
|
private static QueryDemandListRequest getQueryDemandListRequest(String caseId) {
|
||||||
QueryDemandListRequest queryDemandListRequest = new QueryDemandListRequest();
|
QueryDemandListRequest queryDemandListRequest = new QueryDemandListRequest();
|
||||||
|
queryDemandListRequest.setProjectId("project-case-demand-test");
|
||||||
queryDemandListRequest.setCurrent(1);
|
queryDemandListRequest.setCurrent(1);
|
||||||
queryDemandListRequest.setPageSize(5);
|
queryDemandListRequest.setPageSize(5);
|
||||||
queryDemandListRequest.setCaseId(caseId);
|
queryDemandListRequest.setCaseId(caseId);
|
||||||
|
@ -481,7 +482,7 @@ public class FunctionalCaseDemandControllerTests extends BaseTest {
|
||||||
FunctionalThirdDemandPageRequest functionalThirdDemandPageRequest = new FunctionalThirdDemandPageRequest();
|
FunctionalThirdDemandPageRequest functionalThirdDemandPageRequest = new FunctionalThirdDemandPageRequest();
|
||||||
functionalThirdDemandPageRequest.setProjectId("gyq_project-case-demand-test");
|
functionalThirdDemandPageRequest.setProjectId("gyq_project-case-demand-test");
|
||||||
functionalThirdDemandPageRequest.setPageSize(10);
|
functionalThirdDemandPageRequest.setPageSize(10);
|
||||||
functionalThirdDemandPageRequest.setStartPage(1);
|
functionalThirdDemandPageRequest.setCurrent(1);
|
||||||
MvcResult mvcResultDemand= this.requestPostWithOkAndReturn(URL_DEMAND_PAGE_DEMAND, functionalThirdDemandPageRequest);
|
MvcResult mvcResultDemand= this.requestPostWithOkAndReturn(URL_DEMAND_PAGE_DEMAND, functionalThirdDemandPageRequest);
|
||||||
PluginPager<PlatformDemandDTO> tableData = JSON.parseObject(JSON.toJSONString(
|
PluginPager<PlatformDemandDTO> tableData = JSON.parseObject(JSON.toJSONString(
|
||||||
JSON.parseObject(mvcResultDemand.getResponse().getContentAsString(StandardCharsets.UTF_8), ResultHolder.class).getData()),
|
JSON.parseObject(mvcResultDemand.getResponse().getContentAsString(StandardCharsets.UTF_8), ResultHolder.class).getData()),
|
||||||
|
|
Loading…
Reference in New Issue