ludc
2023-04-26 3cb0cef6f7189dcbb537df52cef5921d1d2c3cd9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.vci.ubcs.omd.wrapper;
 
import com.vci.ubcs.omd.entity.FieldRange;
import com.vci.ubcs.omd.vo.FieldRangeVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
 
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
 
/**
 * Description: 字段范围的包装类
 *
 * @author LiHang
 * @date 2023/4/3
 */
public class FiledRangeWrapper extends BaseEntityWrapper<FieldRange, FieldRangeVO> {
 
    public static FiledRangeWrapper build() {
        return new FiledRangeWrapper();
    }
 
    /**
     * do2vo
     * @param entity pojo
     * @return 显示对象
     */
    @Override
    public FieldRangeVO entityVO(FieldRange entity) {
        FieldRangeVO vo = Objects.requireNonNull(BeanUtil.copy(entity, FieldRangeVO.class));
        return vo;
    }
 
    /**
     * 批量转vo
     * @param list pojo集合
     * @return 显示对象
     */
    public List<FieldRangeVO> listEntityVO(List<FieldRange> list) {
        return list.stream().map(this::entityVO).collect(Collectors.toList());
    }
}