feat(测试计划): 测试计划实际开始结束时间的计算功能开发
This commit is contained in:
parent
b3de5b92b4
commit
2e206e0755
|
@ -6,6 +6,7 @@ import io.metersphere.dto.BugProviderDTO;
|
||||||
import io.metersphere.plan.constants.TestPlanResourceConfig;
|
import io.metersphere.plan.constants.TestPlanResourceConfig;
|
||||||
import io.metersphere.plan.dto.request.*;
|
import io.metersphere.plan.dto.request.*;
|
||||||
import io.metersphere.plan.dto.response.*;
|
import io.metersphere.plan.dto.response.*;
|
||||||
|
import io.metersphere.plan.mapper.ExtTestPlanMapper;
|
||||||
import io.metersphere.plan.service.TestPlanCaseLogService;
|
import io.metersphere.plan.service.TestPlanCaseLogService;
|
||||||
import io.metersphere.plan.service.TestPlanFunctionalCaseService;
|
import io.metersphere.plan.service.TestPlanFunctionalCaseService;
|
||||||
import io.metersphere.plan.service.TestPlanManagementService;
|
import io.metersphere.plan.service.TestPlanManagementService;
|
||||||
|
@ -48,6 +49,8 @@ public class TestPlanFunctionalCaseController {
|
||||||
private TestPlanManagementService testPlanManagementService;
|
private TestPlanManagementService testPlanManagementService;
|
||||||
@Resource
|
@Resource
|
||||||
private TestPlanFunctionalCaseService testPlanFunctionalCaseService;
|
private TestPlanFunctionalCaseService testPlanFunctionalCaseService;
|
||||||
|
@Resource
|
||||||
|
private ExtTestPlanMapper extTestPlanMapper;
|
||||||
|
|
||||||
@PostMapping(value = "/sort")
|
@PostMapping(value = "/sort")
|
||||||
@Operation(summary = "测试计划功能用例-功能用例拖拽排序")
|
@Operation(summary = "测试计划功能用例-功能用例拖拽排序")
|
||||||
|
@ -140,6 +143,7 @@ public class TestPlanFunctionalCaseController {
|
||||||
@CheckOwner(resourceId = "#request.getTestPlanId()", resourceType = "test_plan")
|
@CheckOwner(resourceId = "#request.getTestPlanId()", resourceType = "test_plan")
|
||||||
public void run(@Validated @RequestBody TestPlanCaseRunRequest request) {
|
public void run(@Validated @RequestBody TestPlanCaseRunRequest request) {
|
||||||
testPlanFunctionalCaseService.run(request, new LogInsertModule(SessionUtils.getUserId(), "/test-plan/functional/case/run", HttpMethodConstants.POST.name()));
|
testPlanFunctionalCaseService.run(request, new LogInsertModule(SessionUtils.getUserId(), "/test-plan/functional/case/run", HttpMethodConstants.POST.name()));
|
||||||
|
extTestPlanMapper.setActualStartTime(request.getTestPlanId(), System.currentTimeMillis());
|
||||||
testPlanService.refreshTestPlanStatus(request.getTestPlanId());
|
testPlanService.refreshTestPlanStatus(request.getTestPlanId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,6 +153,7 @@ public class TestPlanFunctionalCaseController {
|
||||||
@CheckOwner(resourceId = "#request.getTestPlanId()", resourceType = "test_plan")
|
@CheckOwner(resourceId = "#request.getTestPlanId()", resourceType = "test_plan")
|
||||||
public void batchRun(@Validated @RequestBody TestPlanCaseBatchRunRequest request) {
|
public void batchRun(@Validated @RequestBody TestPlanCaseBatchRunRequest request) {
|
||||||
testPlanFunctionalCaseService.batchRun(request, new LogInsertModule(SessionUtils.getUserId(), "/test-plan/functional/case/batch/run", HttpMethodConstants.POST.name()));
|
testPlanFunctionalCaseService.batchRun(request, new LogInsertModule(SessionUtils.getUserId(), "/test-plan/functional/case/batch/run", HttpMethodConstants.POST.name()));
|
||||||
|
extTestPlanMapper.setActualStartTime(request.getTestPlanId(), System.currentTimeMillis());
|
||||||
testPlanService.refreshTestPlanStatus(request.getTestPlanId());
|
testPlanService.refreshTestPlanStatus(request.getTestPlanId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package io.metersphere.plan.dto.response;
|
package io.metersphere.plan.dto.response;
|
||||||
|
|
||||||
|
import io.metersphere.sdk.constants.TestPlanConstants;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
@ -17,7 +18,7 @@ public class TestPlanDetailResponse extends TestPlanStatisticsResponse implement
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "测试计划组Id")
|
@Schema(description = "测试计划组Id")
|
||||||
private String groupId;
|
private String groupId = TestPlanConstants.TEST_PLAN_DEFAULT_GROUP_ID;
|
||||||
|
|
||||||
@Schema(description = "测试计划组名称")
|
@Schema(description = "测试计划组名称")
|
||||||
private String groupName;
|
private String groupName;
|
||||||
|
|
|
@ -39,6 +39,18 @@ public class TestPlanResponse extends TestPlanStatisticsResponse {
|
||||||
@Schema(description = "组内计划数量")
|
@Schema(description = "组内计划数量")
|
||||||
private Integer childrenCount;
|
private Integer childrenCount;
|
||||||
|
|
||||||
|
@Schema(description = "计划开始时间")
|
||||||
|
private Long plannedStartTime;
|
||||||
|
|
||||||
|
@Schema(description = "计划结束时间")
|
||||||
|
private Long plannedEndTime;
|
||||||
|
|
||||||
|
@Schema(description = "实际开始时间")
|
||||||
|
private Long actualStartTime;
|
||||||
|
|
||||||
|
@Schema(description = "实际结束时间")
|
||||||
|
private Long actualEndTime;
|
||||||
|
|
||||||
@Schema(description = "测试计划组Id")
|
@Schema(description = "测试计划组Id")
|
||||||
private String groupId;
|
private String groupId;
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,12 @@ public interface ExtTestPlanMapper {
|
||||||
|
|
||||||
void batchUpdate(@Param("testPlan") TestPlan testPlan, @Param("ids") List<String> ids);
|
void batchUpdate(@Param("testPlan") TestPlan testPlan, @Param("ids") List<String> ids);
|
||||||
|
|
||||||
|
void setActualStartTime(@Param("id") String id, @Param("time") Long actualStartTime);
|
||||||
|
|
||||||
|
void setActualEndTime(@Param("id") String id, @Param("time") Long actualEndTime);
|
||||||
|
|
||||||
|
void clearActualEndTime(String id);
|
||||||
|
|
||||||
List<String> selectIdByProjectId(String projectId);
|
List<String> selectIdByProjectId(String projectId);
|
||||||
|
|
||||||
List<String> selectNotArchivedIds(@Param("ids") List<String> selectIds);
|
List<String> selectNotArchivedIds(@Param("ids") List<String> selectIds);
|
||||||
|
|
|
@ -53,6 +53,10 @@
|
||||||
t.type,
|
t.type,
|
||||||
t.description,
|
t.description,
|
||||||
t.pos,
|
t.pos,
|
||||||
|
t.planned_start_time AS plannedStartTime,
|
||||||
|
t.planned_end_time AS plannedEndTime,
|
||||||
|
t.actual_start_time AS actualStartTime,
|
||||||
|
t.actual_end_time AS actualEndTime,
|
||||||
t.tags
|
t.tags
|
||||||
FROM test_plan t
|
FROM test_plan t
|
||||||
INNER JOIN user createUser ON t.create_user = createUser.id
|
INNER JOIN user createUser ON t.create_user = createUser.id
|
||||||
|
@ -486,6 +490,23 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
and project_id = #{testPlan.projectId}
|
and project_id = #{testPlan.projectId}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="setActualStartTime">
|
||||||
|
update test_plan
|
||||||
|
set actual_start_time = #{time}
|
||||||
|
where id = #{id}
|
||||||
|
and actual_start_time is null
|
||||||
|
</update>
|
||||||
|
<update id="setActualEndTime">
|
||||||
|
update test_plan
|
||||||
|
set actual_end_time = #{time}
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
<update id="clearActualEndTime">
|
||||||
|
update test_plan
|
||||||
|
set actual_end_time = null
|
||||||
|
where id = #{0}
|
||||||
|
and actual_end_time is not null
|
||||||
|
</update>
|
||||||
|
|
||||||
<sql id="filter">
|
<sql id="filter">
|
||||||
<if test="request.filter != null and request.filter.size() > 0">
|
<if test="request.filter != null and request.filter.size() > 0">
|
||||||
|
|
|
@ -19,10 +19,7 @@ import io.metersphere.plan.domain.TestPlanCollection;
|
||||||
import io.metersphere.plan.domain.TestPlanCollectionExample;
|
import io.metersphere.plan.domain.TestPlanCollectionExample;
|
||||||
import io.metersphere.plan.dto.request.ApiExecutionMapService;
|
import io.metersphere.plan.dto.request.ApiExecutionMapService;
|
||||||
import io.metersphere.plan.dto.request.TestPlanApiCaseBatchRunRequest;
|
import io.metersphere.plan.dto.request.TestPlanApiCaseBatchRunRequest;
|
||||||
import io.metersphere.plan.mapper.ExtTestPlanApiCaseMapper;
|
import io.metersphere.plan.mapper.*;
|
||||||
import io.metersphere.plan.mapper.TestPlanApiCaseMapper;
|
|
||||||
import io.metersphere.plan.mapper.TestPlanCollectionMapper;
|
|
||||||
import io.metersphere.plan.mapper.TestPlanMapper;
|
|
||||||
import io.metersphere.sdk.constants.ApiExecuteResourceType;
|
import io.metersphere.sdk.constants.ApiExecuteResourceType;
|
||||||
import io.metersphere.sdk.constants.CaseType;
|
import io.metersphere.sdk.constants.CaseType;
|
||||||
import io.metersphere.sdk.constants.CommonConstants;
|
import io.metersphere.sdk.constants.CommonConstants;
|
||||||
|
@ -76,6 +73,8 @@ public class TestPlanApiCaseBatchRunService {
|
||||||
private TestPlanApiBatchRunBaseService testPlanApiBatchRunBaseService;
|
private TestPlanApiBatchRunBaseService testPlanApiBatchRunBaseService;
|
||||||
@Resource
|
@Resource
|
||||||
private TestPlanMapper testPlanMapper;
|
private TestPlanMapper testPlanMapper;
|
||||||
|
@Resource
|
||||||
|
private ExtTestPlanMapper extTestPlanMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步批量执行
|
* 异步批量执行
|
||||||
|
@ -84,6 +83,7 @@ public class TestPlanApiCaseBatchRunService {
|
||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
public void asyncBatchRun(TestPlanApiCaseBatchRunRequest request, String userId) {
|
public void asyncBatchRun(TestPlanApiCaseBatchRunRequest request, String userId) {
|
||||||
|
extTestPlanMapper.setActualStartTime(request.getTestPlanId(), System.currentTimeMillis());
|
||||||
Thread.startVirtualThread(() -> batchRun(request, userId));
|
Thread.startVirtualThread(() -> batchRun(request, userId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,8 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||||
@Resource
|
@Resource
|
||||||
private TestPlanMapper testPlanMapper;
|
private TestPlanMapper testPlanMapper;
|
||||||
@Resource
|
@Resource
|
||||||
|
private ExtTestPlanMapper extTestPlanMapper;
|
||||||
|
@Resource
|
||||||
private TestPlanApiCaseMapper testPlanApiCaseMapper;
|
private TestPlanApiCaseMapper testPlanApiCaseMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private ExtTestPlanApiCaseMapper extTestPlanApiCaseMapper;
|
private ExtTestPlanApiCaseMapper extTestPlanApiCaseMapper;
|
||||||
|
@ -625,6 +627,7 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||||
|
|
||||||
public TaskRequestDTO run(String id, String reportId, String userId) {
|
public TaskRequestDTO run(String id, String reportId, String userId) {
|
||||||
TestPlanApiCase testPlanApiCase = checkResourceExist(id);
|
TestPlanApiCase testPlanApiCase = checkResourceExist(id);
|
||||||
|
extTestPlanMapper.setActualStartTime(testPlanApiCase.getTestPlanId(), System.currentTimeMillis());
|
||||||
ApiTestCase apiTestCase = apiTestCaseService.checkResourceExist(testPlanApiCase.getApiCaseId());
|
ApiTestCase apiTestCase = apiTestCaseService.checkResourceExist(testPlanApiCase.getApiCaseId());
|
||||||
ApiRunModeConfigDTO runModeConfig = testPlanApiBatchRunBaseService.getApiRunModeConfig(testPlanApiCase.getTestPlanCollectionId());
|
ApiRunModeConfigDTO runModeConfig = testPlanApiBatchRunBaseService.getApiRunModeConfig(testPlanApiCase.getTestPlanCollectionId());
|
||||||
runModeConfig.setEnvironmentId(apiBatchRunBaseService.getEnvId(runModeConfig, testPlanApiCase.getEnvironmentId()));
|
runModeConfig.setEnvironmentId(apiBatchRunBaseService.getEnvId(runModeConfig, testPlanApiCase.getEnvironmentId()));
|
||||||
|
|
|
@ -17,10 +17,7 @@ import io.metersphere.plan.domain.TestPlanCollection;
|
||||||
import io.metersphere.plan.domain.TestPlanCollectionExample;
|
import io.metersphere.plan.domain.TestPlanCollectionExample;
|
||||||
import io.metersphere.plan.dto.request.ApiExecutionMapService;
|
import io.metersphere.plan.dto.request.ApiExecutionMapService;
|
||||||
import io.metersphere.plan.dto.request.TestPlanApiScenarioBatchRunRequest;
|
import io.metersphere.plan.dto.request.TestPlanApiScenarioBatchRunRequest;
|
||||||
import io.metersphere.plan.mapper.ExtTestPlanApiScenarioMapper;
|
import io.metersphere.plan.mapper.*;
|
||||||
import io.metersphere.plan.mapper.TestPlanApiScenarioMapper;
|
|
||||||
import io.metersphere.plan.mapper.TestPlanCollectionMapper;
|
|
||||||
import io.metersphere.plan.mapper.TestPlanMapper;
|
|
||||||
import io.metersphere.sdk.constants.ApiExecuteResourceType;
|
import io.metersphere.sdk.constants.ApiExecuteResourceType;
|
||||||
import io.metersphere.sdk.constants.CaseType;
|
import io.metersphere.sdk.constants.CaseType;
|
||||||
import io.metersphere.sdk.constants.CommonConstants;
|
import io.metersphere.sdk.constants.CommonConstants;
|
||||||
|
@ -75,6 +72,8 @@ public class TestPlanApiScenarioBatchRunService {
|
||||||
private ApiExecutionMapService apiExecutionMapService;
|
private ApiExecutionMapService apiExecutionMapService;
|
||||||
@Resource
|
@Resource
|
||||||
private TestPlanCollectionMapper testPlanCollectionMapper;
|
private TestPlanCollectionMapper testPlanCollectionMapper;
|
||||||
|
@Resource
|
||||||
|
private ExtTestPlanMapper extTestPlanMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步批量执行
|
* 异步批量执行
|
||||||
|
@ -83,6 +82,7 @@ public class TestPlanApiScenarioBatchRunService {
|
||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
public void asyncBatchRun(TestPlanApiScenarioBatchRunRequest request, String userId) {
|
public void asyncBatchRun(TestPlanApiScenarioBatchRunRequest request, String userId) {
|
||||||
|
extTestPlanMapper.setActualStartTime(request.getTestPlanId(), System.currentTimeMillis());
|
||||||
Thread.startVirtualThread(() -> batchRun(request, userId));
|
Thread.startVirtualThread(() -> batchRun(request, userId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,8 @@ public class TestPlanApiScenarioService extends TestPlanResourceService {
|
||||||
@Resource
|
@Resource
|
||||||
private TestPlanMapper testPlanMapper;
|
private TestPlanMapper testPlanMapper;
|
||||||
@Resource
|
@Resource
|
||||||
|
private ExtTestPlanMapper extTestPlanMapper;
|
||||||
|
@Resource
|
||||||
private TestPlanResourceLogService testPlanResourceLogService;
|
private TestPlanResourceLogService testPlanResourceLogService;
|
||||||
@Resource
|
@Resource
|
||||||
private ApiScenarioRunService apiScenarioRunService;
|
private ApiScenarioRunService apiScenarioRunService;
|
||||||
|
@ -287,6 +289,7 @@ public class TestPlanApiScenarioService extends TestPlanResourceService {
|
||||||
|
|
||||||
public TaskRequestDTO run(String id, String reportId, String userId) {
|
public TaskRequestDTO run(String id, String reportId, String userId) {
|
||||||
TestPlanApiScenario testPlanApiScenario = checkResourceExist(id);
|
TestPlanApiScenario testPlanApiScenario = checkResourceExist(id);
|
||||||
|
extTestPlanMapper.setActualStartTime(testPlanApiScenario.getTestPlanId(), System.currentTimeMillis());
|
||||||
ApiScenario apiScenario = apiScenarioService.checkResourceExist(testPlanApiScenario.getApiScenarioId());
|
ApiScenario apiScenario = apiScenarioService.checkResourceExist(testPlanApiScenario.getApiScenarioId());
|
||||||
ApiRunModeConfigDTO runModeConfig = testPlanApiBatchRunBaseService.getApiRunModeConfig(testPlanApiScenario.getTestPlanCollectionId());
|
ApiRunModeConfigDTO runModeConfig = testPlanApiBatchRunBaseService.getApiRunModeConfig(testPlanApiScenario.getTestPlanCollectionId());
|
||||||
runModeConfig.setEnvironmentId(apiBatchRunBaseService.getEnvId(runModeConfig, testPlanApiScenario.getEnvironmentId()));
|
runModeConfig.setEnvironmentId(apiBatchRunBaseService.getEnvId(runModeConfig, testPlanApiScenario.getEnvironmentId()));
|
||||||
|
|
|
@ -7,6 +7,7 @@ import io.metersphere.plan.dto.request.TestPlanBatchExecuteRequest;
|
||||||
import io.metersphere.plan.dto.request.TestPlanExecuteRequest;
|
import io.metersphere.plan.dto.request.TestPlanExecuteRequest;
|
||||||
import io.metersphere.plan.dto.request.TestPlanReportGenRequest;
|
import io.metersphere.plan.dto.request.TestPlanReportGenRequest;
|
||||||
import io.metersphere.plan.mapper.ExtTestPlanReportMapper;
|
import io.metersphere.plan.mapper.ExtTestPlanReportMapper;
|
||||||
|
import io.metersphere.plan.mapper.ExtTestPlanMapper;
|
||||||
import io.metersphere.plan.mapper.TestPlanCollectionMapper;
|
import io.metersphere.plan.mapper.TestPlanCollectionMapper;
|
||||||
import io.metersphere.plan.mapper.TestPlanConfigMapper;
|
import io.metersphere.plan.mapper.TestPlanConfigMapper;
|
||||||
import io.metersphere.plan.mapper.TestPlanMapper;
|
import io.metersphere.plan.mapper.TestPlanMapper;
|
||||||
|
@ -41,6 +42,8 @@ public class TestPlanExecuteService {
|
||||||
@Resource
|
@Resource
|
||||||
private ExtTestPlanReportMapper extTestPlanReportMapper;
|
private ExtTestPlanReportMapper extTestPlanReportMapper;
|
||||||
@Resource
|
@Resource
|
||||||
|
private ExtTestPlanMapper extTestPlanMapper;
|
||||||
|
@Resource
|
||||||
private TestPlanConfigMapper testPlanConfigMapper;
|
private TestPlanConfigMapper testPlanConfigMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private TestPlanService testPlanService;
|
private TestPlanService testPlanService;
|
||||||
|
@ -194,6 +197,7 @@ public class TestPlanExecuteService {
|
||||||
|
|
||||||
//执行测试计划里不同类型的用例 回调:caseTypeExecuteQueueFinish
|
//执行测试计划里不同类型的用例 回调:caseTypeExecuteQueueFinish
|
||||||
public String executeTestPlan(TestPlanExecutionQueue executionQueue) {
|
public String executeTestPlan(TestPlanExecutionQueue executionQueue) {
|
||||||
|
extTestPlanMapper.setActualStartTime(executionQueue.getSourceID(), System.currentTimeMillis());
|
||||||
TestPlan testPlan = testPlanMapper.selectByPrimaryKey(executionQueue.getSourceID());
|
TestPlan testPlan = testPlanMapper.selectByPrimaryKey(executionQueue.getSourceID());
|
||||||
TestPlanCollectionExample testPlanCollectionExample = new TestPlanCollectionExample();
|
TestPlanCollectionExample testPlanCollectionExample = new TestPlanCollectionExample();
|
||||||
testPlanCollectionExample.createCriteria().andTestPlanIdEqualTo(testPlan.getId()).andParentIdEqualTo("NONE");
|
testPlanCollectionExample.createCriteria().andTestPlanIdEqualTo(testPlan.getId()).andParentIdEqualTo("NONE");
|
||||||
|
@ -439,12 +443,18 @@ public class TestPlanExecuteService {
|
||||||
postParam.setEndTime(System.currentTimeMillis());
|
postParam.setEndTime(System.currentTimeMillis());
|
||||||
postParam.setExecStatus(ExecStatus.COMPLETED.name());
|
postParam.setExecStatus(ExecStatus.COMPLETED.name());
|
||||||
testPlanReportService.postHandleReport(postParam);
|
testPlanReportService.postHandleReport(postParam);
|
||||||
|
|
||||||
|
if(!isGroupReport){
|
||||||
|
TestPlanReport testPlanReport = testPlanReportService.selectById(reportId);
|
||||||
|
if(testPlanReport!=null){
|
||||||
|
testPlanService.refreshTestPlanStatus(testPlanReport.getTestPlanId());
|
||||||
|
}
|
||||||
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
LogUtils.error("Cannot find test plan report for " + reportId, e);
|
LogUtils.error("Cannot find test plan report for " + reportId, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void queueExecuteFinish(TestPlanExecutionQueue queue) {
|
private void queueExecuteFinish(TestPlanExecutionQueue queue) {
|
||||||
if (StringUtils.equalsIgnoreCase(queue.getParentQueueType(), QUEUE_PREFIX_TEST_PLAN_BATCH_EXECUTE)) {
|
if (StringUtils.equalsIgnoreCase(queue.getParentQueueType(), QUEUE_PREFIX_TEST_PLAN_BATCH_EXECUTE)) {
|
||||||
if(StringUtils.equalsIgnoreCase(queue.getQueueType(),QUEUE_PREFIX_TEST_PLAN_GROUP_EXECUTE)){
|
if(StringUtils.equalsIgnoreCase(queue.getQueueType(),QUEUE_PREFIX_TEST_PLAN_GROUP_EXECUTE)){
|
||||||
|
|
|
@ -462,6 +462,9 @@ public class TestPlanReportService {
|
||||||
|
|
||||||
testPlanReportMapper.updateByPrimaryKeySelective(planReport);
|
testPlanReportMapper.updateByPrimaryKeySelective(planReport);
|
||||||
}
|
}
|
||||||
|
public TestPlanReport selectById(String reportId) {
|
||||||
|
return testPlanReportMapper.selectByPrimaryKey(reportId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取报告分析详情
|
* 获取报告分析详情
|
||||||
|
|
|
@ -769,12 +769,15 @@ public class TestPlanService extends TestPlanBaseUtilsService {
|
||||||
if (MapUtils.isEmpty(caseExecResultCount)) {
|
if (MapUtils.isEmpty(caseExecResultCount)) {
|
||||||
// 没有任何执行结果: 状态是未开始
|
// 没有任何执行结果: 状态是未开始
|
||||||
testPlanFinalStatus = TestPlanConstants.TEST_PLAN_STATUS_PREPARED;
|
testPlanFinalStatus = TestPlanConstants.TEST_PLAN_STATUS_PREPARED;
|
||||||
|
extTestPlanMapper.clearActualEndTime(testPlanId);
|
||||||
} else if (caseExecResultCount.size() == 1 && caseExecResultCount.containsKey(ExecStatus.PENDING.name()) && caseExecResultCount.get(ExecStatus.PENDING.name()) > 0) {
|
} else if (caseExecResultCount.size() == 1 && caseExecResultCount.containsKey(ExecStatus.PENDING.name()) && caseExecResultCount.get(ExecStatus.PENDING.name()) > 0) {
|
||||||
// 执行结果只有未开始: 状态是未开始
|
// 执行结果只有未开始: 状态是未开始
|
||||||
testPlanFinalStatus = TestPlanConstants.TEST_PLAN_STATUS_PREPARED;
|
testPlanFinalStatus = TestPlanConstants.TEST_PLAN_STATUS_PREPARED;
|
||||||
|
extTestPlanMapper.clearActualEndTime(testPlanId);
|
||||||
} else if (!caseExecResultCount.containsKey(ExecStatus.PENDING.name())) {
|
} else if (!caseExecResultCount.containsKey(ExecStatus.PENDING.name())) {
|
||||||
// 执行结果没有未开始: 已完成
|
// 执行结果没有未开始: 已完成
|
||||||
testPlanFinalStatus = TestPlanConstants.TEST_PLAN_STATUS_COMPLETED;
|
testPlanFinalStatus = TestPlanConstants.TEST_PLAN_STATUS_COMPLETED;
|
||||||
|
extTestPlanMapper.setActualEndTime(testPlanId, System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
TestPlan testPlan = new TestPlan();
|
TestPlan testPlan = new TestPlan();
|
||||||
testPlan.setId(testPlanId);
|
testPlan.setId(testPlanId);
|
||||||
|
|
Loading…
Reference in New Issue