zhangf
2024-09-11 d4020168658efdee89a633083cd9c14b06c4d863
src/main/java/com/gkhy/fourierSpecialGasMonitor/service/impl/GasThresholdServiceImpl.java
@@ -26,6 +26,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
 * @author Mr.huang
@@ -58,9 +59,12 @@
        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;
    }