如何解决方法参考中的错误返回类型:无法将RecipeIndicatorsDto转换为R?

时间:2019-05-06 10:30:22

标签: java

如何修复下面的错误?

  

方法参考中的错误返回类型:无法将RecipeIndicatorsD转换为R

谢谢大家

{
   "_id":"5cc26b81ea0b841b2a8723a1",
   "lastestEdit":"2019-05-06T10:23:27.777Z",
   "name":"linh",
   "contact":"0923123",
   "dob":"2019-04-11T17:00:00.000Z",
   "gender":"M",
   "id":"PW3933059352",
   "oldID":1004144,
   "email":"linh@gmail.com",
   "created":"2019-04-26T02:22:56.978Z",
   "images":[
      {
         "_id":"5cd00a3b265a2967d87b94cf",
         "name":"PW3933059352-20190506-linh-0923123-1557137979",
         "treatment":"beauty",
         "childFolder":[
            {
               "_id":"5cd00a3b265a2967d87b94d2",
               "name":"Trước",
               "googleDriveChildFolderId":"1i4qa8Z8KDdURYQ74Yho75TA4o3zjfHXl"
            },
            {
               "_id":"5cd00a3b265a2967d87b94d1",
               "name":"Sau",
               "googleDriveChildFolderId":"14N2YSxgeYUO4XMxmztzXNaaSGn5QoqAj"
            },
            {
               "_id":"5cd00a3b265a2967d87b94d0",
               "name":"X-Quang",
               "googleDriveChildFolderId":"1X-O0pcmpv5gQ_yJ2KHG0IYAn4tsqGOAC"
            },
            {
               "_id":"5cd00a43265a2967d87b94d3",
               "name":"test"
            }
         ],
         "gTreatmentId":"1yWgO-wplDLldCweOlhHNggAssPsD1TJ0",
         "gPatientFolderId":"1B27Sw0a1NbOs5J4pzs2PhNBjR9RUZ4-N"
      },
      {
         "_id":"5cd00b1c265a2967d87b94d4",
         "name":"PW3933059352-20190506-linh-0923123-1557138204",
         "treatment":"tooth_removal",
         "childFolder":[
            {
               "_id":"5cd00b1c265a2967d87b94d7",
               "name":"Trước",
               "googleDriveChildFolderId":"1OBZ0nBzmgJyOi--RvTKtguJL_db4x2d6"
            },
            {
               "_id":"5cd00b1c265a2967d87b94d6",
               "name":"Sau",
               "googleDriveChildFolderId":"1IXqsbk_EwrNLFupGf8WUrT1uxfi_ZG-K"
            },
            {
               "_id":"5cd00b1c265a2967d87b94d5",
               "name":"X-Quang",
               "googleDriveChildFolderId":"1mwSHY9L0ZKHCL9bXefGADSDw9U3XpMhG"
            }
         ],
         "gTreatmentId":"1Z-ogjXNrP4Y60f8fAlTsFKuwQXII5cQo",
         "gPatientFolderId":"1FJWS9R6QlPvktEhTsfofaQpWeWO2BQH4"
      }
   ],
   "address":"hanoi",
   "job":"Sinh viên",
   "__v":170,
   "lastestAppointment":null
}

公共静态RecipeIndicatorsDto配方指标Dto(RecipeIndicator配方指标,订购单){         如果(recipeIndicator!= null && order!= null){             RecipeIndicatorsDto recipeIndicatorsDto =新的RecipeIndicatorsDto();             recipeIndicatorsDto.setVerificationStatus(recipeIndicator.getVerificationStatus());
            recipeIndicatorsDto.setUploadTime(recipeIndicator.getUploadTime());             recipeIndicatorsDto.setRemark(order.getRemark());             recipeIndicatorsDto.setUseDays(order.getUseDays());

1 个答案:

答案 0 :(得分:0)

DtoFactory::recipeIndicatorsDto是对静态方法的方法引用,该方法需要一个RecipeIndicator参数和一个Order参数。 由于您将其传递给map的{​​{1}},因此只有Stream<RecipeIndicator>实例可用。

您可以改用lambda表达式:

RecipeIndicator

我不确定要将哪个.map(recipeIndicator -> DtoFactory.recipeIndicatorsDto(recipeIndicator, qOrder)) 实例传递给它。我猜可能是Order