//
需要字段名一致 List<UserCheckData> userCheckDataList = null;
List
<UserCheckPO> list = userCheckPORepository.findAll(); if(CollectionUtils.isNotEmpty(list)){ userCheckDataList = list.stream().map(userCheckPO -> { UserCheckData userCheckData = new UserCheckData();           //将userCheckPO拷贝给userCheckData BeanUtils.copyProperties(userCheckPO, userCheckData); return userCheckData; }).collect(Collectors.toList()); }

方法1 为转载

转载地址:https://www.cnblogs.com/java-h/p/14212205.html

 

 

方法2:

outGoodsVehicleRouteDataTResult.setVehicleRouteInfos(outBoardGoodsListDataResponseBO.
                getOutBoardGoodsListResponseBOList().stream().map(OutBoardListQueryConverter::
                OutBoardGoodsListResponseBO2VehicleGoodsRouteInfoDTO).collect(Collectors.toList()));
public static VehicleRouteInfoDTO outBoardListResponseBO2VehicleRouteInfoDTO(OutBoardListResponseBO bo) {
        if (bo == null) {
            return null;
        }
        VehicleRouteInfoDTO vehicleRouteInfoDTO = new VehicleRouteInfoDTO();
        vehicleRouteInfoDTO.setGoodsPointNo(bo.getGoodsPointNo());
        vehicleRouteInfoDTO.setRelationGridId(bo.getRelationGridId());
        vehicleRouteInfoDTO.setUserPreReceiptDate(bo.getUserPreReceiptDate());
        vehicleRouteInfoDTO.setUserDemandQuantity(bo.getUserDemandQuantity());
        vehicleRouteInfoDTO.setPlanSowQuantity(bo.getPlanSowQuantity());
        vehicleRouteInfoDTO.setSowedQuantity(bo.getSowedQuantity());
        vehicleRouteInfoDTO.setCloseContainerQuantity(bo.getCloseContainerQuantity());
        vehicleRouteInfoDTO.setEntruckingOrderQuantity(bo.getEntruckingOrderQuantity());
        vehicleRouteInfoDTO.setShippedQuantity(bo.getShippedQuanti

o2o

 

posted on 2021-03-09 17:36  王洪洪  阅读(429)  评论(0编辑  收藏  举报