mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 05:29:29 +08:00
refactor(功能用例): 移动模块到回收站用例也移动
This commit is contained in:
parent
45cdc8cc36
commit
b62c7c271b
@ -19,4 +19,6 @@ public interface ExtFunctionalCaseMapper {
|
||||
List<FunctionalCaseVersionDTO> getFunctionalCaseByRefId(@Param("refId") String refId);
|
||||
|
||||
List<String> getFunctionalCaseIds(@Param("projectId") String projectId);
|
||||
|
||||
void removeToTrashByModuleIds(@Param("moduleIds") List<String> deleteIds);
|
||||
}
|
||||
|
@ -56,4 +56,11 @@
|
||||
WHERE
|
||||
project_id = #{projectId}
|
||||
</select>
|
||||
|
||||
<update id="removeToTrashByModuleIds" parameterType="java.lang.String">
|
||||
UPDATE functional_case SET deleted = true WHERE module_id IN
|
||||
<foreach collection="moduleIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
@ -1,6 +1,5 @@
|
||||
package io.metersphere.functional.mapper;
|
||||
|
||||
import io.metersphere.functional.domain.FunctionalCaseModule;
|
||||
import io.metersphere.project.dto.NodeSortQueryParam;
|
||||
import io.metersphere.system.dto.sdk.BaseModule;
|
||||
import io.metersphere.system.dto.sdk.BaseTreeNode;
|
||||
@ -11,26 +10,14 @@ import java.util.List;
|
||||
public interface ExtFunctionalCaseModuleMapper {
|
||||
List<BaseTreeNode> selectBaseByProjectId(String projectId);
|
||||
|
||||
List<BaseTreeNode> selectIdAndParentIdByProjectId(String projectId);
|
||||
|
||||
List<String> selectChildrenIdsByParentIds(@Param("ids") List<String> deleteIds);
|
||||
|
||||
List<String> selectChildrenIdsSortByPos(String parentId);
|
||||
|
||||
void removeToTrashByIds(@Param("ids") List<String> deleteId);
|
||||
void removeToTrashByIds(@Param("ids") List<String> deleteIds);
|
||||
|
||||
Long getMaxPosByParentId(String parentId);
|
||||
|
||||
List<String> selectIdsByProjectId(String projectId);
|
||||
|
||||
FunctionalCaseModule getLastModuleByParentId(String id);
|
||||
|
||||
FunctionalCaseModule getNextModuleInParentId(@Param("parentId") String parentId, @Param("pos") long pos);
|
||||
|
||||
FunctionalCaseModule getPreviousModuleInParentId(@Param("parentId") String parentId, @Param("pos") long pos);
|
||||
|
||||
String selectNameById(String moduleId);
|
||||
|
||||
BaseModule selectBaseModuleById(String dragNodeId);
|
||||
|
||||
BaseModule selectModuleByParentIdAndPosOperator(NodeSortQueryParam nodeSortQueryParam);
|
||||
|
@ -41,12 +41,12 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<delete id="removeToTrashByIds" parameterType="java.lang.String">
|
||||
<update id="removeToTrashByIds" parameterType="java.lang.String">
|
||||
UPDATE functional_case_module SET deleted = true WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</update>
|
||||
<select id="getMaxPosByParentId" resultType="java.lang.Long">
|
||||
SELECT max(pos) FROM functional_case_module
|
||||
WHERE parent_id = #{0}
|
||||
|
@ -9,6 +9,7 @@ package io.metersphere.functional.service;
|
||||
|
||||
import io.metersphere.functional.domain.FunctionalCaseModule;
|
||||
import io.metersphere.functional.domain.FunctionalCaseModuleExample;
|
||||
import io.metersphere.functional.mapper.ExtFunctionalCaseMapper;
|
||||
import io.metersphere.functional.mapper.ExtFunctionalCaseModuleMapper;
|
||||
import io.metersphere.functional.mapper.FunctionalCaseModuleMapper;
|
||||
import io.metersphere.functional.request.FunctionalCaseModuleCreateRequest;
|
||||
@ -44,6 +45,8 @@ public class FunctionalCaseModuleService extends ModuleTreeService {
|
||||
private SqlSessionFactory sqlSessionFactory;
|
||||
@Resource
|
||||
private ExtFunctionalCaseModuleMapper extFunctionalCaseModuleMapper;
|
||||
@Resource
|
||||
private ExtFunctionalCaseMapper extFunctionalCaseMapper;
|
||||
|
||||
public List<BaseTreeNode> getTree(String projectId) {
|
||||
List<BaseTreeNode> fileModuleList = extFunctionalCaseModuleMapper.selectBaseByProjectId(projectId);
|
||||
@ -110,7 +113,7 @@ public class FunctionalCaseModuleService extends ModuleTreeService {
|
||||
if (CollectionUtils.isEmpty(deleteIds)) {
|
||||
return;
|
||||
}
|
||||
//TODO:批量移动case到回收站
|
||||
extFunctionalCaseMapper.removeToTrashByModuleIds(deleteIds);
|
||||
extFunctionalCaseModuleMapper.removeToTrashByIds(deleteIds);
|
||||
List<String> childrenIds = extFunctionalCaseModuleMapper.selectChildrenIdsByParentIds(deleteIds);
|
||||
if (CollectionUtils.isNotEmpty(childrenIds)) {
|
||||
|
Loading…
Reference in New Issue
Block a user