Bladeren bron

用户端 预定时间修改

qinxuyang 1 maand geleden
bovenliggende
commit
d8ddce5f8f

+ 14 - 0
alien-store/src/main/java/shop/alien/store/service/impl/UserReservationServiceImpl.java

@@ -61,6 +61,8 @@ public class UserReservationServiceImpl extends ServiceImpl<UserReservationMappe
 
     private final UserReservationOrderMapper userReservationOrderMapper;
 
+    private final StoreBookingBusinessHoursService storeBookingBusinessHoursService;
+
     private ReservationOrderPageService reservationOrderPageService;
 
     @Autowired
@@ -330,6 +332,18 @@ public class UserReservationServiceImpl extends ServiceImpl<UserReservationMappe
         LambdaQueryWrapper<StoreBookingSettings> eq = new LambdaQueryWrapper<StoreBookingSettings>().eq(StoreBookingSettings::getStoreId, storeId);
         List<StoreBookingSettings> storeBookingSettings = storeBookingSettingsService.list(eq);
         list.put("storeBookingSettings", storeBookingSettings);
+        
+        // 查询营业时间:如果有设置信息,则查询对应的营业时间
+        List<StoreBookingBusinessHours> storeBookingBusinessHours = new ArrayList<>();
+        if (storeBookingSettings != null && !storeBookingSettings.isEmpty()) {
+            // 获取第一个设置的ID(通常一个门店只有一个设置)
+            StoreBookingSettings settings = storeBookingSettings.get(0);
+            if (settings != null && settings.getId() != null) {
+                storeBookingBusinessHours = storeBookingBusinessHoursService.getListBySettingsId(settings.getId());
+            }
+        }
+        list.put("storeBookingBusinessHours", storeBookingBusinessHours);
+        
         List<StoreBookingTable> storeBookingTables = storeBookingTableService.list(new LambdaQueryWrapper<StoreBookingTable>().eq(StoreBookingTable::getStoreId, storeId));
         list.put("storeBookingTables", storeBookingTables);
         List<StoreBookingCategory> storeBookingCategorys = storeBookingCategoryService.list(new LambdaQueryWrapper<StoreBookingCategory>().eq(StoreBookingCategory::getStoreId, storeId));