小编awu*_*awu的帖子

如何修复方法引用中的错误返回类型:无法将 RecipeIndicatorsDto 转换为 R?

如何修复下面的错误?

方法引用中的返回类型错误:无法将 RecipeIndicatorsDto 转换为 R

多谢你们

public List<RecipeIndicatorsDto> listByUploadTime(LocalDateTime localDateTime) {
    if(localDateTime!=null) {
        QRecipeIndicator qRecipeIndicator = recipeIndicatorRepo.getQEntity();
        QOrder qOrder=orderRepo.getQEntity();
        List<Predicate> predicates = new ArrayList<>();
        predicates.add(qRecipeIndicator.uploadTime.before(localDateTime));
        List<RecipeIndicator> recipeIndicators = recipeIndicatorRepo.find(predicates, new PageRequest(0, 100));
        List<Order> orders=orderRepo.find(null,new PageRequest(0,100));
        return recipeIndicators.stream()
                               .map(DtoFactory::recipeIndicatorsDto)
                               .collect(Collectors.toList());
}
          
public static RecipeIndicatorsDto recipeIndicatorsDto(RecipeIndicator recipeIndicator, Order order) {
    if (recipeIndicator != null&&order!=null) {
        RecipeIndicatorsDto recipeIndicatorsDto = new RecipeIndicatorsDto();
        recipeIndicatorsDto.setVerificationStatus(recipeIndicator.getVerificationStatus());  
        recipeIndicatorsDto.setUploadTime(recipeIndicator.getUploadTime());
        recipeIndicatorsDto.setRemark(order.getRemark());
        recipeIndicatorsDto.setUseDays(order.getUseDays());
}
Run Code Online (Sandbox Code Playgroud)

java

5
推荐指数
1
解决办法
5124
查看次数

标签 统计

java ×1