优化
This commit is contained in:
@ -23,6 +23,6 @@ public class DishesTypePageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
private List<String> ids;
|
||||
private List<Long> ids;
|
||||
|
||||
}
|
@ -69,4 +69,5 @@ public interface DishesService {
|
||||
|
||||
List<DishesDO> getTodayDishes();
|
||||
|
||||
List<DishesDO> getTodayDishesNew();
|
||||
}
|
@ -283,6 +283,21 @@ public class DishesServiceImpl implements DishesService {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
@ -90,9 +90,9 @@ public class DishesTypeServiceImpl implements DishesTypeService {
|
||||
|
||||
@Override
|
||||
public PageResult<DishesTypeDO> getDishesTypePageApp(DishesTypePageReqVO pageReqVO) {
|
||||
List<DishesDO> todayDishes = dishesService.getTodayDishes();
|
||||
List<DishesDO> todayDishes = dishesService.getTodayDishesNew();
|
||||
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);
|
||||
}
|
||||
return dishesTypeMapper.selectPage(pageReqVO);
|
||||
|
Reference in New Issue
Block a user