Merge remote-tracking branch 'origin/dev' into dev
commit
486346b618
|
@ -1,11 +1,20 @@
|
||||||
package net.srt.controller;
|
package net.srt.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.entity.MetadataCollectQuery;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.common.utils.Result;
|
||||||
import net.srt.service.MetadataCollectService;
|
import net.srt.service.MetadataCollectService;
|
||||||
|
import net.srt.vo.MetadataCollectVO;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("metadata-collect")
|
@RequestMapping("metadata-collect")
|
||||||
@Tag(name = "数据治理-元数据采集")
|
@Tag(name = "数据治理-元数据采集")
|
||||||
|
@ -13,4 +22,10 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
public class MetadataCollectController {
|
public class MetadataCollectController {
|
||||||
private final MetadataCollectService metadataCollectService;
|
private final MetadataCollectService metadataCollectService;
|
||||||
|
|
||||||
|
@GetMapping("page")
|
||||||
|
@Operation(summary = "分页")
|
||||||
|
public Result<PageResult<MetadataCollectVO>> page(@Valid MetadataCollectQuery query){
|
||||||
|
PageResult<MetadataCollectVO> page = metadataCollectService.page(query);
|
||||||
|
return Result.ok(page);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package net.srt.convert;
|
||||||
|
|
||||||
|
import net.srt.api.module.data.governance.dto.DataGovernanceMetadataCollectDto;
|
||||||
|
import net.srt.entity.MetadataCollectEntity;
|
||||||
|
import net.srt.vo.MetadataCollectVO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface MetadataCollectConvert {
|
||||||
|
MetadataCollectConvert INSTANCE = Mappers.getMapper(MetadataCollectConvert.class);
|
||||||
|
|
||||||
|
MetadataCollectEntity convert(MetadataCollectVO vo);
|
||||||
|
|
||||||
|
MetadataCollectEntity convert(DataGovernanceMetadataCollectDto dto);
|
||||||
|
|
||||||
|
DataGovernanceMetadataCollectDto convertDto(MetadataCollectEntity entity);
|
||||||
|
|
||||||
|
MetadataCollectVO convert(MetadataCollectEntity entity);
|
||||||
|
|
||||||
|
List<MetadataCollectVO> convertList(List<MetadataCollectEntity> list);
|
||||||
|
|
||||||
|
}
|
|
@ -1,14 +1,76 @@
|
||||||
package net.srt.entity;
|
package net.srt.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Data
|
@Data
|
||||||
@TableName("data_governance_metadata_collect")
|
@TableName("data_governance_metadata_collect")
|
||||||
public class MetadataCollectEntity extends BaseEntity {
|
public class MetadataCollectEntity extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库类型(1-数据库 2-中台库)
|
||||||
|
*/
|
||||||
|
private Integer dbType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库主键id
|
||||||
|
*/
|
||||||
|
private Long databaseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库策略,0-全量,1-增量
|
||||||
|
*/
|
||||||
|
private Integer strategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型 1一次性 2.周期性
|
||||||
|
*/
|
||||||
|
private Integer taskType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cron表达式(秒 分 时 日 月 星期 年,例如 0 0 3 * * ? 表示每天凌晨三点执行)
|
||||||
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
|
private String cron;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归属元数据的目录
|
||||||
|
*/
|
||||||
|
private Long metadataId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已发布 0-否 1-是
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布时间
|
||||||
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
|
private Date releaseTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package net.srt.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import net.srt.framework.common.query.Query;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "数据治理-元数据采集查询")
|
||||||
|
public class MetadataCollectQuery extends Query {
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 入库策略,0-全量,1-增量
|
||||||
|
*/
|
||||||
|
private Integer strategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型 1一次性 2.周期性
|
||||||
|
*/
|
||||||
|
private Integer taskType;
|
||||||
|
}
|
|
@ -1,8 +1,12 @@
|
||||||
package net.srt.service;
|
package net.srt.service;
|
||||||
|
|
||||||
import net.srt.entity.MetadataCollectEntity;
|
import net.srt.entity.MetadataCollectEntity;
|
||||||
|
import net.srt.entity.MetadataCollectQuery;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
import net.srt.framework.mybatis.service.BaseService;
|
import net.srt.framework.mybatis.service.BaseService;
|
||||||
|
import net.srt.vo.MetadataCollectVO;
|
||||||
|
|
||||||
public interface MetadataCollectService extends BaseService<MetadataCollectEntity> {
|
public interface MetadataCollectService extends BaseService<MetadataCollectEntity> {
|
||||||
|
|
||||||
|
PageResult<MetadataCollectVO> page(MetadataCollectQuery query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,37 @@
|
||||||
package net.srt.service.impl;
|
package net.srt.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.convert.MetadataCollectConvert;
|
||||||
import net.srt.dao.MetadataCollectDao;
|
import net.srt.dao.MetadataCollectDao;
|
||||||
import net.srt.entity.MetadataCollectEntity;
|
import net.srt.entity.MetadataCollectEntity;
|
||||||
|
import net.srt.entity.MetadataCollectQuery;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
import net.srt.service.MetadataCollectService;
|
import net.srt.service.MetadataCollectService;
|
||||||
|
import net.srt.vo.MetadataCollectVO;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class MetadataCollectServiceImpl extends BaseServiceImpl<MetadataCollectDao, MetadataCollectEntity> implements MetadataCollectService {
|
public class MetadataCollectServiceImpl extends BaseServiceImpl<MetadataCollectDao, MetadataCollectEntity> implements MetadataCollectService {
|
||||||
|
@Override
|
||||||
|
public PageResult<MetadataCollectVO> page(MetadataCollectQuery query) {
|
||||||
|
IPage<MetadataCollectEntity> page = baseMapper.selectPage(getPage(query), getWrapper(query));
|
||||||
|
return new PageResult<>(MetadataCollectConvert.INSTANCE.convertList(page.getRecords()), page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
private Wrapper<MetadataCollectEntity> getWrapper(MetadataCollectQuery query) {
|
||||||
|
LambdaQueryWrapper<MetadataCollectEntity> wrapper = Wrappers.lambdaQuery();
|
||||||
|
wrapper.like(StringUtil.isNotBlank(query.getName()),MetadataCollectEntity::getName,query.getName())
|
||||||
|
.eq(query.getStrategy()!=null,MetadataCollectEntity::getStrategy,query.getStrategy())
|
||||||
|
.eq(query.getTaskType()!=null,MetadataCollectEntity::getTaskType,query.getTaskType())
|
||||||
|
.orderByDesc(MetadataCollectEntity::getId);
|
||||||
|
dataScopeWithOrgId(wrapper);
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
package net.srt.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import net.srt.framework.common.utils.DateUtils;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "数据治理-元数据采集")
|
||||||
|
public class MetadataCollectVO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "任务名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "数据库类型(1-数据库 2-中台库)")
|
||||||
|
private Integer dbType;
|
||||||
|
|
||||||
|
@Schema(description = "数据库主键id")
|
||||||
|
private Long databaseId;
|
||||||
|
|
||||||
|
@Schema(description = "入库策略,0-全量,1-增量")
|
||||||
|
private Integer strategy;
|
||||||
|
|
||||||
|
@Schema(description = "任务类型 1一次性 2.周期性")
|
||||||
|
private Integer taskType;
|
||||||
|
|
||||||
|
@Schema(description = "cron表达式(秒 分 时 日 月 星期 年,例如 0 0 3 * * ? 表示每天凌晨三点执行)")
|
||||||
|
private String cron;
|
||||||
|
|
||||||
|
@Schema(description = "归属元数据的目录")
|
||||||
|
private Long metadataId;
|
||||||
|
|
||||||
|
@Schema(description = "描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "是否已发布 0-否 1-是")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "发布时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date releaseTime;
|
||||||
|
|
||||||
|
@Schema(description = "项目id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "创建者")
|
||||||
|
private Long creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新者")
|
||||||
|
private Long updater;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
|
@ -42,7 +42,7 @@ public class HadoopController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 修改
|
||||||
* @param HadoopAddDto
|
* @param HadoopAddDto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
package net.srt.Hadoop.convert;
|
package net.srt.Hadoop.convert;
|
||||||
|
|
||||||
import net.srt.Fink.convert.FinkConvert;
|
|
||||||
import net.srt.Fink.dto.FinkAddDto;
|
|
||||||
import net.srt.Fink.entity.FinkEntity;
|
|
||||||
import net.srt.Fink.vo.FinkVo;
|
|
||||||
import net.srt.Hadoop.dto.HadoopAddDto;
|
import net.srt.Hadoop.dto.HadoopAddDto;
|
||||||
import net.srt.Hadoop.dto.HadoopDto;
|
|
||||||
import net.srt.Hadoop.entity.HadoopEntity;
|
import net.srt.Hadoop.entity.HadoopEntity;
|
||||||
import net.srt.Hadoop.vo.HadoopVo;
|
import net.srt.Hadoop.vo.HadoopVo;
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package net.srt.disposition.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DataProductionTreeDto {
|
||||||
|
private Integer id;
|
||||||
|
private Integer parentId;
|
||||||
|
private Integer ifLeaf;
|
||||||
|
private Long taskId;
|
||||||
|
private String taskType;
|
||||||
|
private String parentPath;
|
||||||
|
private String path;
|
||||||
|
private Integer orderNo;
|
||||||
|
private String label;
|
||||||
|
private Long metamodelId;
|
||||||
|
private String name;
|
||||||
|
private String icon;
|
||||||
|
private String code;
|
||||||
|
private Boolean builtin;
|
||||||
|
private String description;
|
||||||
|
private Long projectId;
|
||||||
|
private Integer creator;
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private Date creatTime;
|
||||||
|
}
|
|
@ -14,8 +14,12 @@ import net.srt.disposition.entity.DataProductionTreeEntity;
|
||||||
import net.srt.disposition.mapper.DataProductionMapper;
|
import net.srt.disposition.mapper.DataProductionMapper;
|
||||||
import net.srt.disposition.service.DataProductionService;
|
import net.srt.disposition.service.DataProductionService;
|
||||||
import net.srt.disposition.vo.DataProductionTreeVo;
|
import net.srt.disposition.vo.DataProductionTreeVo;
|
||||||
|
import net.srt.framework.common.utils.BeanUtil;
|
||||||
|
import net.srt.framework.common.utils.BuildTreeUtils;
|
||||||
|
import net.srt.framework.common.utils.TreeNodeVo;
|
||||||
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -24,36 +28,70 @@ import java.util.List;
|
||||||
public class DataProductionServiceImpl extends BaseServiceImpl<DataProductionMapper, DataProductionTreeEntity> implements DataProductionService {
|
public class DataProductionServiceImpl extends BaseServiceImpl<DataProductionMapper, DataProductionTreeEntity> implements DataProductionService {
|
||||||
@Override
|
@Override
|
||||||
public List<DataProductionTreeVo> dataTreeList() {
|
public List<DataProductionTreeVo> dataTreeList() {
|
||||||
ArrayList<DataProductionTreeVo> dataProductionTreeVoArrayList = new ArrayList<>();
|
LambdaQueryWrapper<DataProductionTreeEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
List<DataProductionTreeEntity> dataProductionTreeEntities = baseMapper.selectList(null);
|
wrapper.orderByAsc(DataProductionTreeEntity::getOrderNo);
|
||||||
for (DataProductionTreeEntity dataProductionTreeEntity : dataProductionTreeEntities) {
|
List<DataProductionTreeEntity> dataFileCategoryEntities = baseMapper.selectList(wrapper);
|
||||||
List<DataProductionTreeVo> dataProductionTreeVos=findDataProductTreeVoList(dataProductionTreeEntity);
|
List<DataProductionTreeVo> treeNodeVos = BeanUtil.copyListProperties(dataFileCategoryEntities, DataProductionTreeVo::new, (oldItem, newItem) -> {
|
||||||
DataProductionTreeVo convert = DataProductionTreeConvert.INSTANCE.convert(dataProductionTreeEntity);
|
newItem.setLabel(oldItem.getName());
|
||||||
convert.setDataProductionTreeVos(dataProductionTreeVos);
|
if (newItem.getPath().contains("/")) {
|
||||||
dataProductionTreeVoArrayList.add(convert);
|
newItem.setParentPath(newItem.getPath().substring(0, newItem.getPath().lastIndexOf("/")));
|
||||||
}
|
}
|
||||||
return dataProductionTreeVoArrayList;
|
});
|
||||||
|
return buildTree(treeNodeVos);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<DataProductionTreeVo> findDataProductTreeVoList(DataProductionTreeEntity dataProductionTreeEntity) {
|
public static List<DataProductionTreeVo> buildTree(List<DataProductionTreeVo> nodeVos) {
|
||||||
QueryWrapper<DataProductionTreeEntity> dataProductionTreeEntityQueryWrapper = new QueryWrapper<>();
|
List<DataProductionTreeVo> resultVos = new ArrayList<>(10);
|
||||||
dataProductionTreeEntityQueryWrapper.eq("parent_id",dataProductionTreeEntity.getId());
|
for (DataProductionTreeVo node : nodeVos) {
|
||||||
List<DataProductionTreeEntity> dataProductionTreeEntities = baseMapper.selectList(dataProductionTreeEntityQueryWrapper);
|
// 一级菜单parentId为0
|
||||||
List<DataProductionTreeVo> convert = DataProductionTreeConvert.INSTANCE.convert(dataProductionTreeEntities);
|
if (node.getParentId() == 0) {
|
||||||
return convert;
|
resultVos.add(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 为一级菜单设置子菜单,getChild是递归调用的
|
||||||
|
for (DataProductionTreeVo node : resultVos) {
|
||||||
|
node.setDataProductionTreeVos(getChild(node.getId(), nodeVos));
|
||||||
|
}
|
||||||
|
return resultVos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static List<DataProductionTreeVo> getChild(Integer id, List<DataProductionTreeVo> nodeVos) {
|
||||||
|
// 子菜单
|
||||||
|
List<DataProductionTreeVo> childList = new ArrayList<>(10);
|
||||||
|
for (DataProductionTreeVo node : nodeVos) {
|
||||||
|
// 遍历所有节点,将父菜单id与传过来的id比较
|
||||||
|
if (node.getParentId() != 0) {
|
||||||
|
if (node.getParentId().equals(id)) {
|
||||||
|
childList.add(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 把子菜单的子菜单再循环一遍
|
||||||
|
for (DataProductionTreeVo node : childList) {
|
||||||
|
node.setDataProductionTreeVos(getChild(node.getId(), nodeVos));
|
||||||
|
}
|
||||||
|
return childList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void add(DataProductionTreeDto dataProductionTreeDto) {
|
public void add(DataProductionTreeDto dataProductionTreeDto) {
|
||||||
DataProductionTreeEntity convert = DataProductionTreeConvert.INSTANCE.convert(dataProductionTreeDto);
|
DataProductionTreeEntity entity = DataProductionTreeConvert.INSTANCE.convert(dataProductionTreeDto);
|
||||||
if (convert.getParentPath()!=null && !convert.getParentPath().equals("")){
|
entity.setPath(recursionPath(entity, null));
|
||||||
String path=convert.getParentPath()+"/"+convert.getName();
|
entity.setProjectId(getProjectId());
|
||||||
convert.setPath(path);
|
baseMapper.insert(entity);
|
||||||
baseMapper.insert(convert);
|
|
||||||
}
|
}
|
||||||
convert.setLabel(convert.getName());
|
|
||||||
convert.setPath(convert.getName());
|
private String recursionPath(DataProductionTreeEntity categoryEntity, String path) {
|
||||||
baseMapper.insert(convert);
|
if (StringUtil.isBlank(path)) {
|
||||||
|
path = categoryEntity.getName();
|
||||||
|
}
|
||||||
|
if (categoryEntity.getParentId() != 0) {
|
||||||
|
DataProductionTreeEntity parent = getById(categoryEntity.getParentId());
|
||||||
|
path = parent.getName() + "/" + path;
|
||||||
|
return recursionPath(parent, path);
|
||||||
|
}
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue