xiejun
2023-08-12 a19d26e88360c9760b2286bac4dfb1710fd2fa21
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.vci.ubcs.code.applyjtcodeservice.wrapper;
 
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.vci.ubcs.code.applyjtcodeservice.entity.DockingPreViewModel;
import com.vci.ubcs.code.applyjtcodeservice.vo.DockingPreViewModelVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
 
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
 
/**
 *集团编码申请视图包装类
 *
 * @author xiejun
 * @since 2023-05-23
 */
public class DockingPreViewWrapper  extends BaseEntityWrapper<DockingPreViewModel, DockingPreViewModelVO> {
    public static DockingPreViewWrapper build() {
        return new DockingPreViewWrapper();
    }
    @Override
    public DockingPreViewModelVO entityVO(DockingPreViewModel entity) {
        DockingPreViewModelVO dockingPreViewModelVO = Objects.requireNonNull(BeanUtil.copy(entity, DockingPreViewModelVO.class));
        return dockingPreViewModelVO;
    }
 
    /***
     * 数组对象转换
     * @param entitys
     * @return
     */
    public List<DockingPreViewModelVO> entityVOs(Collection<DockingPreViewModel> entitys) {
        if(CollectionUtils.isEmpty(entitys)) {return new ArrayList<>();}
        List<DockingPreViewModelVO> vos=new ArrayList<>();
        if(!CollectionUtils.isEmpty(entitys)) {
            entitys.stream().forEach(dockingPreAttrRange -> {
                vos.add(entityVO(dockingPreAttrRange));
            });
        }
        return vos;
    }
 
    /***
     * 数组对象转换
     * @param vos
     * @return
     */
    public List<DockingPreViewModel> voentitys(Collection<DockingPreViewModelVO> vos) {
        if(CollectionUtils.isEmpty(vos)) {return new ArrayList<>();}
        List<DockingPreViewModel>entitys =new ArrayList<>();
        if(!CollectionUtils.isEmpty(vos)) {
            vos.stream().forEach(entity -> {
                entitys.add(voentity(entity));
            });
        }
        return entitys;
    }
 
    /***
     * 数组对象转换
     * @param vo
     * @return
     */
    public DockingPreViewModel voentity( DockingPreViewModelVO vo) {
        DockingPreViewModel entity = Objects.requireNonNull(BeanUtil.copy(vo, DockingPreViewModel.class));
        return entity;
    }
}