| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author Mr.huang |
| | |
| | | Result success = Result.success(); |
| | | List<GasThreshold> gasThresholds = gasThresholdRepository.findAll(); |
| | | if (!CollectionUtils.isEmpty(gasThresholds)){ |
| | | List<GasThresholdListRespDTO> respDTOS = new ArrayList<>(); |
| | | BeanUtils.copyProperties(gasThresholds,respDTOS); |
| | | success.setData(respDTOS); |
| | | List<GasThresholdListRespDTO> collect = gasThresholds.stream().map(gasThreshold -> { |
| | | GasThresholdListRespDTO dto = new GasThresholdListRespDTO(); |
| | | BeanUtils.copyProperties(gasThreshold, dto); |
| | | return dto; |
| | | }).collect(Collectors.toList()); |
| | | success.setData(collect); |
| | | } |
| | | return success; |
| | | } |