fix(系统设置): 优化批量全选关闭定时任务报错的缺陷
--bug=1039407 --user=王孝刚 【项目任务中心】定时任务-接口场景/API导入列表-全选所有页-批量开启/关闭-报Name cannot be null. https://www.tapd.cn/55049933/s/1497619
This commit is contained in:
parent
b4ce05288e
commit
627a63c511
|
@ -1,5 +1,6 @@
|
||||||
package io.metersphere.api.dto.scenario;
|
package io.metersphere.api.dto.scenario;
|
||||||
|
|
||||||
|
import io.metersphere.sdk.constants.ApiReportStatus;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
@ -27,7 +28,7 @@ public class ApiScenarioReportStepDTO {
|
||||||
private String parentId;
|
private String parentId;
|
||||||
|
|
||||||
@Schema(description = "结果状态")
|
@Schema(description = "结果状态")
|
||||||
private String status;
|
private String status = ApiReportStatus.PENDING.name();
|
||||||
|
|
||||||
@Schema(description = "误报编号/误报状态独有")
|
@Schema(description = "误报编号/误报状态独有")
|
||||||
private String fakeCode;
|
private String fakeCode;
|
||||||
|
|
|
@ -36,6 +36,8 @@ public class ApiDefinitionNoticeService {
|
||||||
|
|
||||||
public ApiDefinitionCaseDTO getUpdateApiDTO(ApiDefinitionUpdateRequest request) {
|
public ApiDefinitionCaseDTO getUpdateApiDTO(ApiDefinitionUpdateRequest request) {
|
||||||
ApiDefinitionCaseDTO caseDTO = new ApiDefinitionCaseDTO();
|
ApiDefinitionCaseDTO caseDTO = new ApiDefinitionCaseDTO();
|
||||||
|
ApiDefinition apiDefinition = apiDefinitionMapper.selectByPrimaryKey(request.getId());
|
||||||
|
BeanUtils.copyBean(caseDTO, apiDefinition);
|
||||||
BeanUtils.copyBean(caseDTO, request);
|
BeanUtils.copyBean(caseDTO, request);
|
||||||
return caseDTO;
|
return caseDTO;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,13 +36,9 @@ public class ApiTestCaseNoticeService {
|
||||||
|
|
||||||
public ApiDefinitionCaseDTO getCaseDTO(ApiTestCaseUpdateRequest request) {
|
public ApiDefinitionCaseDTO getCaseDTO(ApiTestCaseUpdateRequest request) {
|
||||||
ApiDefinitionCaseDTO caseDTO = new ApiDefinitionCaseDTO();
|
ApiDefinitionCaseDTO caseDTO = new ApiDefinitionCaseDTO();
|
||||||
|
ApiTestCase testCase = apiTestCaseMapper.selectByPrimaryKey(request.getId());
|
||||||
|
BeanUtils.copyBean(caseDTO, testCase);
|
||||||
BeanUtils.copyBean(caseDTO, request);
|
BeanUtils.copyBean(caseDTO, request);
|
||||||
caseDTO.setName(null);
|
|
||||||
caseDTO.setStatus(null);
|
|
||||||
caseDTO.setCaseCreateUser(null);
|
|
||||||
caseDTO.setCaseUpdateUser(null);
|
|
||||||
caseDTO.setCaseName(request.getName());
|
|
||||||
caseDTO.setCaseStatus(request.getStatus());
|
|
||||||
return caseDTO;
|
return caseDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import io.metersphere.sdk.util.BeanUtils;
|
||||||
import io.metersphere.sdk.util.SubListUtils;
|
import io.metersphere.sdk.util.SubListUtils;
|
||||||
import io.metersphere.system.domain.Schedule;
|
import io.metersphere.system.domain.Schedule;
|
||||||
import io.metersphere.system.domain.ScheduleExample;
|
import io.metersphere.system.domain.ScheduleExample;
|
||||||
|
import io.metersphere.system.dto.sdk.ApiScenarioMessageDTO;
|
||||||
import io.metersphere.system.mapper.ScheduleMapper;
|
import io.metersphere.system.mapper.ScheduleMapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
@ -52,21 +53,23 @@ public class ApiScenarioNoticeService {
|
||||||
return dtoList;
|
return dtoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApiScenarioDTO getScenarioDTO(ApiScenarioAddRequest request) {
|
public ApiScenarioMessageDTO getScenarioDTO(ApiScenarioAddRequest request) {
|
||||||
ApiScenarioDTO scenarioDTO = new ApiScenarioDTO();
|
ApiScenarioMessageDTO scenarioDTO = new ApiScenarioMessageDTO();
|
||||||
BeanUtils.copyBean(scenarioDTO, request);
|
BeanUtils.copyBean(scenarioDTO, request);
|
||||||
return scenarioDTO;
|
return scenarioDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApiScenarioDTO getScenarioDTO(ApiScenarioUpdateRequest request) {
|
public ApiScenarioMessageDTO getScenarioDTO(ApiScenarioUpdateRequest request) {
|
||||||
ApiScenarioDTO scenarioDTO = new ApiScenarioDTO();
|
ApiScenarioMessageDTO scenarioDTO = new ApiScenarioMessageDTO();
|
||||||
|
ApiScenario apiScenario = apiScenarioMapper.selectByPrimaryKey(request.getId());
|
||||||
|
BeanUtils.copyBean(scenarioDTO, apiScenario);
|
||||||
BeanUtils.copyBean(scenarioDTO, request);
|
BeanUtils.copyBean(scenarioDTO, request);
|
||||||
return scenarioDTO;
|
return scenarioDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApiScenarioDTO getScenarioDTO(String id) {
|
public ApiScenarioMessageDTO getScenarioDTO(String id) {
|
||||||
ApiScenario apiScenario = apiScenarioMapper.selectByPrimaryKey(id);
|
ApiScenario apiScenario = apiScenarioMapper.selectByPrimaryKey(id);
|
||||||
ApiScenarioDTO scenarioDTO = new ApiScenarioDTO();
|
ApiScenarioMessageDTO scenarioDTO = new ApiScenarioMessageDTO();
|
||||||
BeanUtils.copyBean(scenarioDTO, apiScenario);
|
BeanUtils.copyBean(scenarioDTO, apiScenario);
|
||||||
return scenarioDTO;
|
return scenarioDTO;
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,17 +149,9 @@
|
||||||
select task.* from (
|
select task.* from (
|
||||||
<if test="request.scheduleTagType == 'API_IMPORT'">
|
<if test="request.scheduleTagType == 'API_IMPORT'">
|
||||||
SELECT
|
SELECT
|
||||||
schedule.id,
|
schedule.*,
|
||||||
schedule.name as taskname,
|
|
||||||
schedule.project_id,
|
|
||||||
resource_type,
|
|
||||||
ads.num as resource_num,
|
ads.num as resource_num,
|
||||||
ads.name as resource_name,
|
ads.name as resource_name
|
||||||
ads.id as resource_id,
|
|
||||||
schedule.value,
|
|
||||||
schedule.enable,
|
|
||||||
schedule.create_user AS createUserName,
|
|
||||||
schedule.create_time
|
|
||||||
FROM
|
FROM
|
||||||
schedule
|
schedule
|
||||||
inner join api_definition_swagger ads on schedule.resource_id = ads.id
|
inner join api_definition_swagger ads on schedule.resource_id = ads.id
|
||||||
|
@ -167,17 +159,9 @@
|
||||||
</if>
|
</if>
|
||||||
<if test="request.scheduleTagType == 'API_SCENARIO'">
|
<if test="request.scheduleTagType == 'API_SCENARIO'">
|
||||||
SELECT
|
SELECT
|
||||||
schedule.id,
|
schedule.*,
|
||||||
schedule.name as taskname,
|
|
||||||
schedule.project_id,
|
|
||||||
resource_type,
|
|
||||||
api_scenario.num as resource_num,
|
api_scenario.num as resource_num,
|
||||||
api_scenario.name as resource_name,
|
api_scenario.name as resource_name
|
||||||
api_scenario.id as resource_id,
|
|
||||||
schedule.value,
|
|
||||||
schedule.enable,
|
|
||||||
schedule.create_user AS createUserName,
|
|
||||||
schedule.create_time
|
|
||||||
FROM
|
FROM
|
||||||
schedule
|
schedule
|
||||||
inner join api_scenario on schedule.resource_id = api_scenario.id
|
inner join api_scenario on schedule.resource_id = api_scenario.id
|
||||||
|
|
|
@ -534,5 +534,6 @@ public interface NoticeConstants {
|
||||||
String platformBugId = "platformBugId";
|
String platformBugId = "platformBugId";
|
||||||
String handleUsers = "handleUsers";
|
String handleUsers = "handleUsers";
|
||||||
String groupId = "groupId";
|
String groupId = "groupId";
|
||||||
|
String job = "job";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue