This commit is contained in:
seesaw
2024-10-13 17:56:13 +08:00
parent 382ab2c3b0
commit ba961123d0
4 changed files with 19 additions and 3 deletions

View File

@ -23,6 +23,6 @@ public class DishesTypePageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;
private List<String> ids; private List<Long> ids;
} }

View File

@ -69,4 +69,5 @@ public interface DishesService {
List<DishesDO> getTodayDishes(); List<DishesDO> getTodayDishes();
List<DishesDO> getTodayDishesNew();
} }

View File

@ -283,6 +283,21 @@ public class DishesServiceImpl implements DishesService {
throw exception(2000_10_001, "无法获取设备编码"); throw exception(2000_10_001, "无法获取设备编码");
} }
} }
@Override
public List<DishesDO> getTodayDishesNew() {
LocalDateTime today = LocalDateTime.now();
String dayOfWeekInChinese = today.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.CHINESE);
ArrayList<String> week = new ArrayList<>();
week.add(dayOfWeekInChinese);
week.add("整周");
// Long carteenId = deviceInfoService.getCarteen(getHearder());
List<DishesDO> dishesDOS = dishesMapper.selectList(Wrappers.<DishesDO>lambdaQuery()
// .eq(DishesDO::getCarteenId, carteenId)
.in(DishesDO::getWeekTime, week)
.orderByDesc(DishesDO::getCreateTime));
return dishesDOS;
}
} }

View File

@ -90,9 +90,9 @@ public class DishesTypeServiceImpl implements DishesTypeService {
@Override @Override
public PageResult<DishesTypeDO> getDishesTypePageApp(DishesTypePageReqVO pageReqVO) { public PageResult<DishesTypeDO> getDishesTypePageApp(DishesTypePageReqVO pageReqVO) {
List<DishesDO> todayDishes = dishesService.getTodayDishes(); List<DishesDO> todayDishes = dishesService.getTodayDishesNew();
if(CollectionUtil.isNotEmpty(todayDishes)){ if(CollectionUtil.isNotEmpty(todayDishes)){
List<String> ids = todayDishes.stream().map(DishesDO::getDishecType).collect(Collectors.toList()); List<Long> ids = todayDishes.stream().map(vo -> Long.valueOf(vo.getDishecType())).collect(Collectors.toList());
pageReqVO.setIds(ids); pageReqVO.setIds(ids);
} }
return dishesTypeMapper.selectPage(pageReqVO); return dishesTypeMapper.selectPage(pageReqVO);