fix(用例管理): 修复功能用例页面显示问题

--bug=1036810 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036810
--bug=1036809 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036809
--bug=1036783 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036783
--bug=1036746 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036746
--bug=1036642 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036642
This commit is contained in:
guoyuqi 2024-03-06 14:44:27 +08:00 committed by 刘瑞斌
parent 0c688bccbe
commit 8ee1f1abc3
9 changed files with 41 additions and 39 deletions

View File

@ -246,7 +246,7 @@ public class FunctionalCaseController {
@CheckOwner(resourceId = "#request.getSourceId()", resourceType = "functional_case")
public Pager<List<OperationHistoryDTO>> operationHistoryList(@Validated @RequestBody OperationHistoryRequest request) {
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
org.apache.commons.lang3.StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "create_time desc");
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "create_time desc");
return PageUtils.setPageInfo(page, functionalCaseService.operationHistoryList(request));
}
}

View File

@ -62,7 +62,7 @@ public class FunctionalCaseModuleController {
@RequiresPermissions(PermissionConstants.FUNCTIONAL_CASE_READ_DELETE)
@CheckOwner(resourceId = "#moduleId", resourceType = "functional_case_module")
public void deleteNode(@PathVariable String moduleId) {
functionalCaseModuleService.deleteModule(moduleId);
functionalCaseModuleService.deleteModule(moduleId, SessionUtils.getUserId());
}
@GetMapping("/trash/tree/{projectId}")

View File

@ -27,7 +27,7 @@ public interface ExtFunctionalCaseMapper {
List<String> getFunctionalCaseIds(@Param("projectId") String projectId);
void removeToTrashByModuleIds(@Param("moduleIds") List<String> deleteIds);
void removeToTrashByModuleIds(@Param("moduleIds") List<String> deleteIds, @Param("userId") String userId);
List<FunctionalCase> checkCaseByModuleIds(@Param("moduleIds") List<String> deleteIds);

View File

@ -77,7 +77,7 @@
</select>
<update id="removeToTrashByModuleIds" parameterType="java.lang.String">
UPDATE functional_case SET deleted = true, module_id = 'root' WHERE module_id IN
UPDATE functional_case SET deleted = true, module_id = 'root', delete_time = unix_timestamp()*1000, delete_user = #{userId} WHERE module_id IN
<foreach collection="moduleIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>

View File

@ -117,10 +117,10 @@ public class FunctionalCaseModuleService extends ModuleTreeService {
super.sort(nodeSortDTO);
}
public void deleteModule(String moduleId) {
public void deleteModule(String moduleId, String userId) {
FunctionalCaseModule deleteModule = functionalCaseModuleMapper.selectByPrimaryKey(moduleId);
if (deleteModule != null) {
List<FunctionalCase> functionalCases = this.deleteModuleByIds(Collections.singletonList(moduleId), new ArrayList<>());
List<FunctionalCase> functionalCases = this.deleteModuleByIds(Collections.singletonList(moduleId), new ArrayList<>(), userId);
batchDelLog(functionalCases, deleteModule.getProjectId());
}
}
@ -145,7 +145,7 @@ public class FunctionalCaseModuleService extends ModuleTreeService {
operationLogService.batchAdd(dtoList);
}
public List<FunctionalCase> deleteModuleByIds(List<String> deleteIds, List<FunctionalCase> functionalCases) {
public List<FunctionalCase> deleteModuleByIds(List<String> deleteIds, List<FunctionalCase> functionalCases, String userId) {
if (CollectionUtils.isEmpty(deleteIds)) {
return functionalCases;
}
@ -156,10 +156,10 @@ public class FunctionalCaseModuleService extends ModuleTreeService {
if (CollectionUtils.isNotEmpty(functionalCaseList)) {
functionalCases.addAll(functionalCaseList);
}
extFunctionalCaseMapper.removeToTrashByModuleIds(deleteIds);
extFunctionalCaseMapper.removeToTrashByModuleIds(deleteIds, userId);
List<String> childrenIds = extFunctionalCaseModuleMapper.selectChildrenIdsByParentIds(deleteIds);
if (CollectionUtils.isNotEmpty(childrenIds)) {
deleteModuleByIds(childrenIds, functionalCases);
deleteModuleByIds(childrenIds, functionalCases, userId);
}
return functionalCases;
}

View File

@ -702,7 +702,7 @@ public class FunctionalCaseModuleControllerTests extends BaseTest {
this.requestGetWithOk(URL_MODULE_TREE_DELETE + ModuleConstants.DEFAULT_NODE_ID);
//service层判断测试删除空集合
functionalCaseModuleService.deleteModuleByIds(new ArrayList<>(), new ArrayList<>());
functionalCaseModuleService.deleteModuleByIds(new ArrayList<>(), new ArrayList<>(), "admin");
checkLog(functionalCase.getId(), OperationLogType.DELETE, URL_MODULE_TREE_DELETE);

View File

@ -522,15 +522,15 @@
width: 200,
showDrag: true,
},
{
title: 'caseManagement.featureCase.tableColumnExecutionResult',
dataIndex: 'lastExecuteResult',
slotName: 'lastExecuteResult',
titleSlotName: 'executeResultFilter',
showInTable: true,
width: 200,
showDrag: true,
},
// {
// title: 'caseManagement.featureCase.tableColumnExecutionResult',
// dataIndex: 'lastExecuteResult',
// slotName: 'lastExecuteResult',
// titleSlotName: 'executeResultFilter',
// showInTable: true,
// width: 200,
// showDrag: true,
// },
// {
// title: 'caseManagement.featureCase.tableColumnVersion',
// slotName: 'versionName',
@ -1094,6 +1094,7 @@
projectId: currentProjectId.value,
selectIds: selectAll ? [] : selectedIds,
excludeIds: excludeIds || [],
moduleIds: props.activeFolder === 'all' ? [] : [props.activeFolder, ...props.offspringIds],
condition: {
keyword: keyword.value,
filter: propsRes.value.filter,

View File

@ -381,24 +381,24 @@
width: 200,
showDrag: true,
},
{
title: 'caseManagement.featureCase.tableColumnExecutionResult',
dataIndex: 'lastExecuteResult',
slotName: 'lastExecuteResult',
titleSlotName: 'executeResultFilter',
showInTable: true,
width: 200,
showDrag: true,
},
{
title: 'caseManagement.featureCase.tableColumnVersion',
slotName: 'versionName',
dataIndex: 'versionName',
width: 300,
showTooltip: true,
showInTable: true,
showDrag: true,
},
// {
// title: 'caseManagement.featureCase.tableColumnExecutionResult',
// dataIndex: 'lastExecuteResult',
// slotName: 'lastExecuteResult',
// titleSlotName: 'executeResultFilter',
// showInTable: true,
// width: 200,
// showDrag: true,
// },
// {
// title: 'caseManagement.featureCase.tableColumnVersion',
// slotName: 'versionName',
// dataIndex: 'versionName',
// width: 300,
// showTooltip: true,
// showInTable: true,
// showDrag: true,
// },
{
title: 'caseManagement.featureCase.tableColumnModule',
slotName: 'moduleId',
@ -476,6 +476,7 @@
showInTable: true,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
width: 200,
showDrag: true,

View File

@ -240,8 +240,8 @@
setLoadListParams({
projectId: appStore.currentProjectId,
sourceId: props.caseId,
type: ['IMPORT', 'ADD', 'UPDATE'],
module: ['CASE_MANAGEMENT_CASE_CREATE', 'CASE_MANAGEMENT_CASE_UPDATE'],
types: ['IMPORT', 'ADD', 'UPDATE'],
modules: ['CASE_MANAGEMENT_CASE_CREATE', 'CASE_MANAGEMENT_CASE_UPDATE'],
});
await loadList();
featureCaseStore.getCaseCounts(props.caseId);