|
@@ -42,10 +42,11 @@ public class DietRecommendationService {
|
|
|
.eq(DietRecommendation::getRecommendationDate, date)
|
|
.eq(DietRecommendation::getRecommendationDate, date)
|
|
|
.in(DietRecommendation::getStatus, Arrays.asList("pending", "accepted", "completed"));
|
|
.in(DietRecommendation::getStatus, Arrays.asList("pending", "accepted", "completed"));
|
|
|
|
|
|
|
|
- DietRecommendation record = dietRecommendationMapper.selectOne(wrapper);
|
|
|
|
|
|
|
+ List<DietRecommendation> records = dietRecommendationMapper.selectList(wrapper);
|
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
- if (record != null) {
|
|
|
|
|
|
|
+ if (!records.isEmpty()) {
|
|
|
|
|
+ DietRecommendation record = records.get(0);
|
|
|
result.put("id", record.getId());
|
|
result.put("id", record.getId());
|
|
|
result.put("date", dateStr);
|
|
result.put("date", dateStr);
|
|
|
result.put("mealType", record.getMealType());
|
|
result.put("mealType", record.getMealType());
|