TreeLabelVo增加value字段

This commit is contained in:
2023-04-19 15:43:55 +08:00
parent 580a2f6d4e
commit d283eb00ac
2 changed files with 17 additions and 1 deletions
@@ -1,5 +1,6 @@
package com.adc.da.report.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import com.adc.da.report.constant.TreeLabelConstants;
import com.adc.da.report.vo.TreeLabelVo;
@@ -43,7 +44,17 @@ public class ITreeLabelServiceImpl extends ServiceImpl<TreeLabelDao, TreeLabelEn
filter(treeLabelEntity ->
TreeLabelConstants.ROOT_TAG_PARENT_ID.equals(treeLabelEntity.getParentId()))
.collect(Collectors.toList()).get(0);
List<TreeLabelVo> treeLabelVos = Convert.toList(TreeLabelVo.class, treeLabelEntities);
// 目标List对象
List<TreeLabelVo> treeLabelVos = new ArrayList<>();
// 将原始List中的属性拷贝到目标List中的对应属性
for (TreeLabelEntity source : treeLabelEntities) {
TreeLabelVo target = new TreeLabelVo();
BeanUtil.copyProperties(source, target);
target.setValue(source.getId());
treeLabelVos.add(target);
}
//分组排序
Map<String, List<TreeLabelVo>> groupedLabelVos = treeLabelVos.stream()
@@ -23,6 +23,11 @@ public class TreeLabelVo {
*/
private String id;
/**
* id
*/
private String value;
/**
* 标签名称
*/