|
@@ -1404,14 +1404,9 @@ public class HealthReportController {
|
|
|
// 指定报告:返回该报告的食材推荐
|
|
// 指定报告:返回该报告的食材推荐
|
|
|
foods = foodService.listByReportId(reportId);
|
|
foods = foodService.listByReportId(reportId);
|
|
|
} else {
|
|
} else {
|
|
|
- // 未指定报告:返回当前用户最新报告的食材推荐(当前最适合)
|
|
|
|
|
|
|
+ // 未指定报告:返回维护的"当前食材"推荐(food_recommend_idx,有新报告时 upsert 更新)
|
|
|
Long uid = userId != null ? userId : -1L;
|
|
Long uid = userId != null ? userId : -1L;
|
|
|
- HealthReport latest = healthReportService.getLatestReport(uid);
|
|
|
|
|
- if (latest == null) {
|
|
|
|
|
- foods = java.util.Collections.emptyList();
|
|
|
|
|
- } else {
|
|
|
|
|
- foods = foodService.listByReportId(latest.getId());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ foods = foodRecommendService.getCurrentFoodsAsFoodList(uid);
|
|
|
}
|
|
}
|
|
|
return Result.success(foods);
|
|
return Result.success(foods);
|
|
|
}
|
|
}
|