| | |
| | | package com.vci.ubcs.code.wrapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.vci.ubcs.code.entity.DockingLog; |
| | | import com.vci.ubcs.code.vo.pagemodel.DockingLogeVO; |
| | | 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; |
| | | |
| | | public class DockingLogeWrapper extends BaseEntityWrapper<DockingLog, DockingLogeVO> { |
| | | public static DockingLogeWrapper build() { |
| | | return new DockingLogeWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public DockingLogeVO entityVO(DockingLog entity) { |
| | | DockingLogeVO dockingLogeVO = Objects.requireNonNull(BeanUtil.copy(entity, DockingLogeVO.class)); |
| | | return dockingLogeVO; |
| | | } |
| | | |
| | | |
| | | /*** |
| | | * 数组对象转换 |
| | | * @param entitys |
| | | * @return |
| | | */ |
| | | public List<DockingLogeVO> entityVOs(Collection<DockingLog> entitys) { |
| | | if(CollectionUtils.isEmpty(entitys)) {return new ArrayList<>();} |
| | | List<DockingLogeVO> vos=new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(entitys)) { |
| | | entitys.stream().forEach(vo -> { |
| | | vos.add(entityVO(vo)); |
| | | }); |
| | | } |
| | | return vos; |
| | | } |
| | | |
| | | /*** |
| | | * 数组对象转换 |
| | | * @param vos |
| | | * @return |
| | | */ |
| | | public List<DockingLog> voentitys(Collection<DockingLogeVO> vos) { |
| | | if(CollectionUtils.isEmpty(vos)) {return new ArrayList<>();} |
| | | List<DockingLog>entitys =new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(vos)) { |
| | | vos.stream().forEach(entity -> { |
| | | entitys.add(voentity(entity)); |
| | | }); |
| | | } |
| | | return entitys; |
| | | } |
| | | |
| | | /*** |
| | | * 数组对象转换 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public DockingLog voentity( DockingLogeVO vo) { |
| | | DockingLog entity = Objects.requireNonNull(BeanUtil.copy(vo, DockingLog.class)); |
| | | return entity; |
| | | } |
| | | } |