TreeLabelVo增加value字段
This commit is contained in:
+12
-1
@@ -1,5 +1,6 @@
|
|||||||
package com.adc.da.report.service.impl;
|
package com.adc.da.report.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import com.adc.da.report.constant.TreeLabelConstants;
|
import com.adc.da.report.constant.TreeLabelConstants;
|
||||||
import com.adc.da.report.vo.TreeLabelVo;
|
import com.adc.da.report.vo.TreeLabelVo;
|
||||||
@@ -43,7 +44,17 @@ public class ITreeLabelServiceImpl extends ServiceImpl<TreeLabelDao, TreeLabelEn
|
|||||||
filter(treeLabelEntity ->
|
filter(treeLabelEntity ->
|
||||||
TreeLabelConstants.ROOT_TAG_PARENT_ID.equals(treeLabelEntity.getParentId()))
|
TreeLabelConstants.ROOT_TAG_PARENT_ID.equals(treeLabelEntity.getParentId()))
|
||||||
.collect(Collectors.toList()).get(0);
|
.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()
|
Map<String, List<TreeLabelVo>> groupedLabelVos = treeLabelVos.stream()
|
||||||
|
|||||||
@@ -23,6 +23,11 @@ public class TreeLabelVo {
|
|||||||
*/
|
*/
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标签名称
|
* 标签名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user