mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-11-29 18:48:13 +08:00
fix(测试用例): 功能用例脑图模式下模块操作日志记录问题
This commit is contained in:
parent
2a44695c7e
commit
4bba38798a
@ -579,8 +579,8 @@ public class FunctionalCaseMinderService {
|
||||
beforeNode = sources;
|
||||
afterNode = new ArrayList<>();
|
||||
} else {
|
||||
beforeNode = sources.subList(0, targetIndex-1);
|
||||
afterNode = sources.subList(targetIndex-1, sources.size());
|
||||
beforeNode = sources.subList(0, targetIndex - 1);
|
||||
afterNode = sources.subList(targetIndex - 1, sources.size());
|
||||
}
|
||||
} else {
|
||||
beforeNode = sources.subList(0, targetIndex);
|
||||
@ -878,7 +878,7 @@ public class FunctionalCaseMinderService {
|
||||
checkModules(module, parentIdInDBMap, OperationLogType.ADD.toString());
|
||||
moduleMapper.insert(module);
|
||||
}
|
||||
functionalCaseModuleLogService.handleModuleLog(modules, request.getProjectId(), userId, "/functional/mind/case/edit", OperationLogType.ADD.name());
|
||||
functionalCaseModuleLogService.handleModuleLog(modules, request.getProjectId(), userId, "/functional/mind/case/edit", OperationLogType.ADD.name(), "");
|
||||
}
|
||||
//处理更新(更新的情况是可能换数据本身,可能换父节点,可能换顺序)
|
||||
List<FunctionalCaseModuleEditRequest> updateList = resourceMap.get(OperationLogType.UPDATE.toString());
|
||||
@ -901,7 +901,7 @@ public class FunctionalCaseMinderService {
|
||||
checkModules(module, parentIdInDBMap, OperationLogType.UPDATE.toString());
|
||||
moduleMapper.updateByPrimaryKeySelective(module);
|
||||
}
|
||||
functionalCaseModuleLogService.handleModuleLog(modules, request.getProjectId(), userId, "/functional/mind/case/edit", OperationLogType.UPDATE.name());
|
||||
functionalCaseModuleLogService.handleModuleLog(modules, request.getProjectId(), userId, "/functional/mind/case/edit", OperationLogType.UPDATE.name(), "");
|
||||
}
|
||||
}
|
||||
setDTOTargetMap(functionalMinderUpdateDTO, sourceIdAndTargetIdsMap);
|
||||
@ -1242,7 +1242,7 @@ public class FunctionalCaseMinderService {
|
||||
FunctionalCaseModuleExample moduleExample = new FunctionalCaseModuleExample();
|
||||
moduleExample.createCriteria().andIdIn(moduleIds);
|
||||
List<FunctionalCaseModule> modules = functionalCaseModuleMapper.selectByExample(moduleExample);
|
||||
functionalCaseModuleLogService.handleModuleLog(modules, request.getProjectId(), user.getId(), "/functional/mind/case/edit", OperationLogType.DELETE.name());
|
||||
functionalCaseModuleLogService.handleModuleLog(modules, request.getProjectId(), user.getId(), "/functional/mind/case/edit", OperationLogType.DELETE.name(), " " + Translator.get("log.delete_module"));
|
||||
|
||||
List<FunctionalCase> functionalCases = functionalCaseModuleService.deleteModuleByIds(moduleIds, new ArrayList<>(), user.getId());
|
||||
functionalCaseModuleLogService.batchDelLog(functionalCases, request.getProjectId(), user.getId(), "/functional/mind/case/edit");
|
||||
|
@ -6,7 +6,6 @@ import io.metersphere.project.domain.Project;
|
||||
import io.metersphere.project.mapper.ProjectMapper;
|
||||
import io.metersphere.sdk.constants.HttpMethodConstants;
|
||||
import io.metersphere.sdk.util.JSON;
|
||||
import io.metersphere.sdk.util.Translator;
|
||||
import io.metersphere.system.dto.builder.LogDTOBuilder;
|
||||
import io.metersphere.system.log.constants.OperationLogModule;
|
||||
import io.metersphere.system.log.constants.OperationLogType;
|
||||
@ -113,7 +112,7 @@ public class FunctionalCaseModuleLogService {
|
||||
* @param userId
|
||||
* @param path
|
||||
*/
|
||||
public void handleModuleLog(List<FunctionalCaseModule> deleteModule, String projectId, String userId, String path, String type) {
|
||||
public void handleModuleLog(List<FunctionalCaseModule> deleteModule, String projectId, String userId, String path, String type, String deleteDesc) {
|
||||
Project project = projectMapper.selectByPrimaryKey(projectId);
|
||||
List<LogDTO> dtoList = new ArrayList<>();
|
||||
deleteModule.forEach(item -> {
|
||||
@ -124,7 +123,7 @@ public class FunctionalCaseModuleLogService {
|
||||
userId,
|
||||
type,
|
||||
OperationLogModule.CASE_MANAGEMENT_CASE_MODULE,
|
||||
item.getName() + " " + Translator.get("log.delete_module"));
|
||||
item.getName() + deleteDesc);
|
||||
dto.setPath(path);
|
||||
dto.setMethod(HttpMethodConstants.GET.name());
|
||||
dto.setOriginalValue(JSON.toJSONBytes(item));
|
||||
|
@ -132,7 +132,7 @@ public class FunctionalCaseModuleService extends ModuleTreeService {
|
||||
//用例日志
|
||||
functionalCaseModuleLogService.batchDelLog(functionalCases, deleteModule.getProjectId(), userId, "/functional/case/module/delete/" + moduleId);
|
||||
//模块日志
|
||||
functionalCaseModuleLogService.handleModuleLog(List.of(deleteModule), deleteModule.getProjectId(), userId, "/functional/case/module/delete/" + moduleId, OperationLogType.DELETE.name());
|
||||
functionalCaseModuleLogService.handleModuleLog(List.of(deleteModule), deleteModule.getProjectId(), userId, "/functional/case/module/delete/" + moduleId, OperationLogType.DELETE.name(), " " + Translator.get("log.delete_module"));
|
||||
List<String> ids = functionalCases.stream().map(FunctionalCase::getId).toList();
|
||||
User user = userMapper.selectByPrimaryKey(userId);
|
||||
functionalCaseNoticeService.batchSendNotice(deleteModule.getProjectId(), ids, user, NoticeConstants.Event.DELETE);
|
||||
|
Loading…
Reference in New Issue
Block a user