下のエラーを修復するには?
メソッド参照で不正な戻り値の型:RにRecipeIndicatorsDtoを変換することはできません
みんなありがとう
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());
パブリック静的RecipeIndicatorsDto recipeIndicatorsDto(RecipeIndicator recipeIndicator、受注オーダー){場合(recipeIndicator = NULL &&順= nullを!){RecipeIndicatorsDto recipeIndicatorsDto =新しいRecipeIndicatorsDto(); recipeIndicatorsDto.setVerificationStatus(recipeIndicator.getVerificationStatus())。
recipeIndicatorsDto.setUploadTime(recipeIndicator.getUploadTime())。recipeIndicatorsDto.setRemark(order.getRemark())。recipeIndicatorsDto.setUseDays(order.getUseDays())。
DtoFactory::recipeIndicatorsDto
必要とする静的メソッドへのメソッド参照されRecipeIndicator
たパラメータとOrder
パラメータ。あなたはそれを渡しているのでmap
のStream<RecipeIndicator>
、唯一のRecipeIndicator
インスタンスが使用可能です。
代わりに、ラムダ式を使用することができます。
.map(recipeIndicator -> DtoFactory.recipeIndicatorsDto(recipeIndicator, qOrder))
私はわからないんだけどOrder
、あなたがそれに渡すインスタンス。私はそれがあるかもしれない推測しましたqOrder
。