| | |
| | | package com.ycl.platform.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | import com.ycl.platform.base.BaseSelect; |
| | | import com.ycl.platform.domain.entity.YwUnit; |
| | | import com.ycl.platform.domain.form.YwUnitForm; |
| | | import com.ycl.platform.domain.query.YwUnitQuery; |
| | |
| | | @Override |
| | | public Result all() { |
| | | List<YwUnit> entities = baseMapper.selectList(null); |
| | | List<YwUnitVO> vos = entities.stream() |
| | | |
| | | List<BaseSelect> vos = entities.stream() |
| | | .map( |
| | | entity -> YwUnitVO.getVoByEntity(entity, null) |
| | | entity -> { |
| | | BaseSelect baseSelect = new BaseSelect(); |
| | | baseSelect.setId(entity.getId()); |
| | | baseSelect.setValue(entity.getUnitName()); |
| | | return baseSelect; |
| | | } |
| | | ) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |