mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update 优化流程查询以及多根节点构建树结构
This commit is contained in:
@ -4,14 +4,13 @@ import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.workflow.common.constant.FlowConstant;
|
||||
import org.dromara.workflow.domain.FlowCategory;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 流程分类视图对象 wf_category
|
||||
@ -34,13 +33,14 @@ public class FlowCategoryVo implements Serializable {
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 父级id
|
||||
* 父级分类id
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 父类别名称
|
||||
* 父级分类名称
|
||||
*/
|
||||
@Translation(type = FlowConstant.CATEGORY_ID_TO_NAME, mapper = "parentId")
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
@ -66,9 +66,4 @@ public class FlowCategoryVo implements Serializable {
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 子菜单
|
||||
*/
|
||||
private List<FlowCategoryVo> children = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
@ -8,7 +8,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.constant.SystemConstants;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.*;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.ObjectUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.core.utils.TreeBuildUtils;
|
||||
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.warm.flow.core.service.DefService;
|
||||
@ -48,14 +51,7 @@ public class FlwCategoryServiceImpl implements IFlwCategoryService {
|
||||
*/
|
||||
@Override
|
||||
public FlowCategoryVo queryById(Long categoryId) {
|
||||
FlowCategoryVo category = baseMapper.selectVoById(categoryId);
|
||||
if (ObjectUtil.isNull(category)) {
|
||||
return null;
|
||||
}
|
||||
FlowCategoryVo parentCategory = baseMapper.selectVoOne(new LambdaQueryWrapper<FlowCategory>()
|
||||
.select(FlowCategory::getCategoryName).eq(FlowCategory::getCategoryId, category.getParentId()));
|
||||
category.setParentName(ObjectUtils.notNullGetter(parentCategory, FlowCategoryVo::getCategoryName));
|
||||
return category;
|
||||
return baseMapper.selectVoById(categoryId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user