qinxuyang 3 недель назад
Родитель
Сommit
a3a7feebdd
16 измененных файлов с 120 добавлено и 97 удалено
  1. 8 0
      alien-entity/src/main/java/shop/alien/entity/store/StoreTable.java
  2. 2 2
      alien-entity/src/main/java/shop/alien/mapper/StoreBookingTableMapper.java
  3. 1 1
      alien-entity/src/main/resources/mapper/StoreBookingTableMapper.xml
  4. 1 1
      alien-entity/src/main/resources/mapper/StoreReservationMapper.xml
  5. 1 1
      alien-entity/src/main/resources/mapper/UserReservationMapper.xml
  6. 25 12
      alien-store/src/main/java/shop/alien/store/controller/StoreBookingTableController.java
  7. 7 7
      alien-store/src/main/java/shop/alien/store/service/StoreBookingTableService.java
  8. 8 0
      alien-store/src/main/java/shop/alien/store/service/StoreTableService.java
  9. 3 3
      alien-store/src/main/java/shop/alien/store/service/impl/ReservationNoticeAsyncServiceImpl.java
  10. 4 4
      alien-store/src/main/java/shop/alien/store/service/impl/ReservationOrderListServiceImpl.java
  11. 5 5
      alien-store/src/main/java/shop/alien/store/service/impl/ReservationOrderPageServiceImpl.java
  12. 5 6
      alien-store/src/main/java/shop/alien/store/service/impl/StoreBookingCategoryServiceImpl.java
  13. 40 46
      alien-store/src/main/java/shop/alien/store/service/impl/StoreBookingTableServiceImpl.java
  14. 2 2
      alien-store/src/main/java/shop/alien/store/service/impl/StoreReservationServiceImpl.java
  15. 1 0
      alien-store/src/main/java/shop/alien/store/service/impl/StoreTableServiceImpl.java
  16. 7 7
      alien-store/src/main/java/shop/alien/store/service/impl/UserReservationServiceImpl.java

+ 8 - 0
alien-entity/src/main/java/shop/alien/entity/store/StoreTable.java

@@ -33,6 +33,14 @@ public class StoreTable {
     @TableField("table_number")
     private String tableNumber;
 
+    @ApiModelProperty(value = "分类ID(关联store_booking_category表)")
+    @TableField("category_id")
+    private Integer categoryId;
+
+    @ApiModelProperty(value = "座位数")
+    @TableField("seating_capacity")
+    private Integer seatingCapacity;
+
     @ApiModelProperty(value = "当前进行中的订单ID(订单结账或取消后清空)")
     @TableField("current_order_id")
     private Integer currentOrderId;

+ 2 - 2
alien-entity/src/main/java/shop/alien/mapper/StoreBookingTableMapper.java

@@ -1,7 +1,7 @@
 package shop.alien.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import shop.alien.entity.store.StoreBookingTable;
+import shop.alien.entity.store.StoreTable;
 
 /**
  * 预订服务桌号表 Mapper 接口
@@ -9,5 +9,5 @@ import shop.alien.entity.store.StoreBookingTable;
  * @author system
  * @since 2025-01-XX
  */
-public interface StoreBookingTableMapper extends BaseMapper<StoreBookingTable> {
+public interface StoreBookingTableMapper extends BaseMapper<StoreTable> {
 }

+ 1 - 1
alien-entity/src/main/resources/mapper/StoreBookingTableMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="shop.alien.mapper.StoreBookingTableMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="shop.alien.entity.store.StoreBookingTable">
+    <resultMap id="BaseResultMap" type="shop.alien.entity.store.StoreTable">
         <id column="id" property="id" />
         <result column="store_id" property="storeId" />
         <result column="category_id" property="categoryId" />

+ 1 - 1
alien-entity/src/main/resources/mapper/StoreReservationMapper.xml

@@ -95,7 +95,7 @@
             user_reservation ur
         LEFT JOIN store_booking_category sbc ON ur.category_id = sbc.id
         LEFT JOIN user_reservation_table urt ON ur.id = urt.reservation_id AND urt.delete_flag = 0
-        LEFT JOIN store_booking_table sbt ON urt.table_id = sbt.id
+        LEFT JOIN store_table sbt ON urt.table_id = sbt.id
         LEFT JOIN life_user lu ON ur.user_id = lu.id AND lu.delete_flag = 0
         LEFT JOIN user_reservation_order uro ON ur.id = uro.reservation_id AND uro.delete_flag = 0
         WHERE

+ 1 - 1
alien-entity/src/main/resources/mapper/UserReservationMapper.xml

@@ -109,7 +109,7 @@
             user_reservation ur
         LEFT JOIN store_booking_category sbc ON ur.category_id = sbc.id AND sbc.delete_flag = 0
         LEFT JOIN user_reservation_table urt ON ur.id = urt.reservation_id AND urt.delete_flag = 0
-        LEFT JOIN store_booking_table sbt ON urt.table_id = sbt.id AND sbt.delete_flag = 0
+        LEFT JOIN store_table sbt ON urt.table_id = sbt.id AND sbt.delete_flag = 0
         LEFT JOIN life_user lu ON ur.user_id = lu.id AND lu.delete_flag = 0
         LEFT JOIN user_reservation_order uro ON ur.id = uro.reservation_id AND uro.delete_flag = 0
         WHERE

+ 25 - 12
alien-store/src/main/java/shop/alien/store/controller/StoreBookingTableController.java

@@ -7,11 +7,12 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
-import shop.alien.entity.store.StoreBookingTable;
+import shop.alien.entity.store.StoreTable;
 import shop.alien.entity.store.dto.StoreBookingTableBatchDTO;
 import shop.alien.entity.store.dto.StoreBookingTableDTO;
 import shop.alien.entity.store.vo.StoreBookingTableVo;
 import shop.alien.store.service.StoreBookingTableService;
+import shop.alien.store.service.StoreTableService;
 
 import java.util.List;
 
@@ -32,6 +33,9 @@ public class StoreBookingTableController {
 
     private final StoreBookingTableService storeBookingTableService;
 
+    private final StoreTableService storeTableService;
+
+
     @ApiOperationSupport(order = 1)
     @ApiOperation("查询预订服务桌号列表(分页)")
     @ApiImplicitParams({
@@ -75,7 +79,7 @@ public class StoreBookingTableController {
             @ApiImplicitParam(name = "id", value = "桌号ID", dataType = "Integer", paramType = "query", required = true)
     })
     @GetMapping("/detail")
-    public R<StoreBookingTable> getTableDetail(@RequestParam Integer id) {
+    public R<StoreTable> getTableDetail(@RequestParam Integer id) {
         log.info("StoreBookingTableController.getTableDetail?id={}", id);
         
         if (id == null) {
@@ -83,7 +87,7 @@ public class StoreBookingTableController {
         }
         
         try {
-            StoreBookingTable table = storeBookingTableService.getById(id);
+            StoreTable table = storeBookingTableService.getById(id);
             if (table == null) {
                 return R.fail("桌号不存在");
             }
@@ -112,18 +116,27 @@ public class StoreBookingTableController {
         }
         
         try {
-            // 转换为 StoreBookingTable 列表
-            List<StoreBookingTable> tables = dto.getTables().stream()
+            List<StoreTable> tables = dto.getTables().stream()
                     .map(item -> {
-                        StoreBookingTable table = new StoreBookingTable();
+                        StoreTable table = new StoreTable();
                         table.setTableNumber(item.getTableNumber());
                         table.setSeatingCapacity(item.getSeatingCapacity());
                         return table;
                     })
                     .collect(java.util.stream.Collectors.toList());
-            
+
             boolean result = storeBookingTableService.batchAddTables(dto.getStoreId(), dto.getCategoryId(), tables);
             if (result) {
+                // 批量创建成功后,异步生成小程序二维码
+                List<String> tableNumbers = tables.stream()
+                        .map(StoreTable::getTableNumber)
+                        .filter(StringUtils::hasText)
+                        .map(String::trim)
+                        .collect(java.util.stream.Collectors.toList());
+                if (!tableNumbers.isEmpty()) {
+                    storeTableService.asyncGenerateQrCodesForTables(dto.getStoreId(), tableNumbers);
+                }
+
                 return R.success("新增成功");
             } else {
                 return R.fail("新增失败");
@@ -150,18 +163,18 @@ public class StoreBookingTableController {
         }
         
         try {
-            StoreBookingTable table = new StoreBookingTable();
+            StoreTable table = new StoreTable();
             table.setId(dto.getId());
-            if (dto.getCategoryId() != null) {
-                table.setCategoryId(dto.getCategoryId());
-            }
             if (StringUtils.hasText(dto.getTableNumber())) {
                 table.setTableNumber(dto.getTableNumber());
             }
+
+            if (dto.getCategoryId() != null) {
+                table.setCategoryId(dto.getCategoryId());
+            }
             if (dto.getSeatingCapacity() != null) {
                 table.setSeatingCapacity(dto.getSeatingCapacity());
             }
-            
             boolean result = storeBookingTableService.updateTable(table);
             if (result) {
                 return R.success("更新成功");

+ 7 - 7
alien-store/src/main/java/shop/alien/store/service/StoreBookingTableService.java

@@ -2,7 +2,7 @@ package shop.alien.store.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
-import shop.alien.entity.store.StoreBookingTable;
+import shop.alien.entity.store.StoreTable;
 import shop.alien.entity.store.vo.StoreBookingTableVo;
 
 import java.util.List;
@@ -13,16 +13,16 @@ import java.util.List;
  * @author system
  * @since 2025-01-XX
  */
-public interface StoreBookingTableService extends IService<StoreBookingTable> {
+public interface StoreBookingTableService extends IService<StoreTable> {
 
     /**
      * 查询预订服务桌号列表
      *
      * @param storeId   门店ID
      * @param categoryId 分类ID(可选,null表示查询全部)
-     * @return List<StoreBookingTable>
+     * @return List<StoreTable>
      */
-    List<StoreBookingTable> getTableList(Integer storeId, Integer categoryId);
+    List<StoreTable> getTableList(Integer storeId, Integer categoryId);
 
     /**
      * 查询预订服务桌号列表(包含分类名称)
@@ -50,7 +50,7 @@ public interface StoreBookingTableService extends IService<StoreBookingTable> {
      * @param table 桌号对象
      * @return boolean
      */
-    boolean addTable(StoreBookingTable table);
+    boolean addTable(StoreTable table);
 
     /**
      * 批量新增预订服务桌号
@@ -60,7 +60,7 @@ public interface StoreBookingTableService extends IService<StoreBookingTable> {
      * @param tables    桌号列表(每个包含桌号和座位数)
      * @return boolean
      */
-    boolean batchAddTables(Integer storeId, Integer categoryId, List<StoreBookingTable> tables);
+    boolean batchAddTables(Integer storeId, Integer categoryId, List<StoreTable> tables);
 
     /**
      * 更新预订服务桌号
@@ -68,7 +68,7 @@ public interface StoreBookingTableService extends IService<StoreBookingTable> {
      * @param table 桌号对象
      * @return boolean
      */
-    boolean updateTable(StoreBookingTable table);
+    boolean updateTable(StoreTable table);
 
     /**
      * 删除预订服务桌号

+ 8 - 0
alien-store/src/main/java/shop/alien/store/service/StoreTableService.java

@@ -38,6 +38,14 @@ public interface StoreTableService extends IService<StoreTable> {
     boolean batchCreateTables(Integer storeId, List<String> tableNumbers);
 
     /**
+     * 异步为新创建的桌号生成二维码
+     *
+     * @param storeId 门店ID
+     * @param tableNumbers 桌号列表
+     */
+    void asyncGenerateQrCodesForTables(Integer storeId, List<String> tableNumbers);
+
+    /**
      * 更新桌号
      *
      * @param dto 桌号管理DTO

+ 3 - 3
alien-store/src/main/java/shop/alien/store/service/impl/ReservationNoticeAsyncServiceImpl.java

@@ -7,7 +7,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import shop.alien.entity.store.LifeNotice;
-import shop.alien.entity.store.StoreBookingTable;
+import shop.alien.entity.store.StoreTable;
 import shop.alien.entity.store.StoreUser;
 import shop.alien.entity.store.UserReservation;
 import shop.alien.entity.store.UserReservationOrder;
@@ -73,7 +73,7 @@ public class ReservationNoticeAsyncServiceImpl implements ReservationNoticeAsync
             if (reservationTables != null && !reservationTables.isEmpty()) {
                 List<String> tableNumbers = reservationTables.stream()
                         .map(rt -> {
-                            StoreBookingTable table = storeBookingTableService.getById(rt.getTableId());
+                            StoreTable table = storeBookingTableService.getById(rt.getTableId());
                             return table != null && table.getTableNumber() != null ? table.getTableNumber() : null;
                         })
                         .filter(tn -> tn != null && !tn.trim().isEmpty())
@@ -175,7 +175,7 @@ public class ReservationNoticeAsyncServiceImpl implements ReservationNoticeAsync
             if (reservationTables != null && !reservationTables.isEmpty()) {
                 List<String> tableNumbers = reservationTables.stream()
                         .map(rt -> {
-                            StoreBookingTable table = storeBookingTableService.getById(rt.getTableId());
+                            StoreTable table = storeBookingTableService.getById(rt.getTableId());
                             return table != null && table.getTableNumber() != null ? table.getTableNumber() : null;
                         })
                         .filter(tn -> tn != null && !tn.trim().isEmpty())

+ 4 - 4
alien-store/src/main/java/shop/alien/store/service/impl/ReservationOrderListServiceImpl.java

@@ -7,7 +7,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import shop.alien.entity.store.StoreBookingCategory;
-import shop.alien.entity.store.StoreBookingTable;
+import shop.alien.entity.store.StoreTable;
 import shop.alien.entity.store.UserReservation;
 import shop.alien.entity.store.UserReservationTable;
 import shop.alien.entity.store.vo.ReservationOrderCountsDto;
@@ -104,10 +104,10 @@ public class ReservationOrderListServiceImpl implements ReservationOrderListServ
                             .eq(UserReservationTable::getReservationId, rid)
                             .orderByAsc(UserReservationTable::getSort)
                             .orderByAsc(UserReservationTable::getId));
-            List<StoreBookingTable> tables = new ArrayList<>();
+            List<StoreTable> tables = new ArrayList<>();
             String categoryName = null;
             for (UserReservationTable ut : utList) {
-                StoreBookingTable t = storeBookingTableService.getById(ut.getTableId());
+                StoreTable t = storeBookingTableService.getById(ut.getTableId());
                 if (t != null) {
                     tables.add(t);
                     if (categoryName == null && t.getCategoryId() != null) {
@@ -116,7 +116,7 @@ public class ReservationOrderListServiceImpl implements ReservationOrderListServ
                     }
                 }
             }
-            String tableNumbersText = tables.stream().map(StoreBookingTable::getTableNumber).filter(Objects::nonNull).collect(Collectors.joining(","));
+            String tableNumbersText = tables.stream().map(StoreTable::getTableNumber).filter(Objects::nonNull).collect(Collectors.joining(","));
             reservationTableTextMap.put(rid, tableNumbersText.isEmpty() ? null : tableNumbersText);
             categoryNameMap.put(rid, categoryName != null ? categoryName : "大厅");
         }

+ 5 - 5
alien-store/src/main/java/shop/alien/store/service/impl/ReservationOrderPageServiceImpl.java

@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.springframework.stereotype.Service;
 import shop.alien.entity.store.MerchantPaymentOrder;
 import shop.alien.entity.store.StoreBookingCategory;
-import shop.alien.entity.store.StoreBookingTable;
+import shop.alien.entity.store.StoreTable;
 import shop.alien.entity.store.StoreInfo;
 import shop.alien.entity.store.UserReservation;
 import shop.alien.entity.store.UserReservationOrder;
@@ -125,10 +125,10 @@ public class ReservationOrderPageServiceImpl implements ReservationOrderPageServ
                 vo.setDiningTimeText(buildDiningTimeSlot(reservation.getStartTime(), reservation.getEndTime()));
 
                 List<Integer> tableIds = listTableIdsByReservationId(reservation.getId());
-                List<StoreBookingTable> tables = new ArrayList<>();
+                List<StoreTable> tables = new ArrayList<>();
                 String categoryName = null;
                 for (Integer tableId : tableIds) {
-                    StoreBookingTable t = storeBookingTableService.getById(tableId);
+                    StoreTable t = storeBookingTableService.getById(tableId);
                     if (t != null) {
                         tables.add(t);
                         if (categoryName == null && t.getCategoryId() != null) {
@@ -139,7 +139,7 @@ public class ReservationOrderPageServiceImpl implements ReservationOrderPageServ
                         }
                     }
                 }
-                String tableNumbersText = tables.stream().map(StoreBookingTable::getTableNumber).filter(Objects::nonNull).collect(Collectors.joining(","));
+                String tableNumbersText = tables.stream().map(StoreTable::getTableNumber).filter(Objects::nonNull).collect(Collectors.joining(","));
                 vo.setTableNumbersText(tableNumbersText.isEmpty() ? null : tableNumbersText);
                 vo.setGuestAndCategoryText(buildGuestAndCategoryText(categoryName, reservation.getGuestCount(), tables));
                 vo.setLocationTableText(buildLocationTableText(categoryName, tableNumbersText));
@@ -276,7 +276,7 @@ public class ReservationOrderPageServiceImpl implements ReservationOrderPageServ
         return startTime != null ? startTime : endTime;
     }
 
-    private String buildGuestAndCategoryText(String categoryName, Integer guestCount, List<StoreBookingTable> tables) {
+    private String buildGuestAndCategoryText(String categoryName, Integer guestCount, List<StoreTable> tables) {
         int capacity = tables.stream().mapToInt(t -> t.getSeatingCapacity() != null ? t.getSeatingCapacity() : 0).max().orElse(guestCount != null ? guestCount : 0);
         if (capacity <= 0 && guestCount != null) capacity = guestCount;
         String part = categoryName != null ? categoryName : "预订";

+ 5 - 6
alien-store/src/main/java/shop/alien/store/service/impl/StoreBookingCategoryServiceImpl.java

@@ -13,8 +13,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 import shop.alien.entity.store.StoreBookingCategory;
 import shop.alien.entity.store.StoreBookingSettings;
-import shop.alien.entity.store.StoreBookingTable;
-import shop.alien.entity.store.UserReservation;
+import shop.alien.entity.store.StoreTable;
 import shop.alien.mapper.StoreBookingCategoryMapper;
 import shop.alien.mapper.UserReservationMapper;
 import shop.alien.store.service.StoreBookingCategoryService;
@@ -259,15 +258,15 @@ public class StoreBookingCategoryServiceImpl extends ServiceImpl<StoreBookingCat
         }
         
         // 查询当前分类下的所有桌号
-        LambdaQueryWrapper<StoreBookingTable> tableWrapper = new LambdaQueryWrapper<>();
-        tableWrapper.eq(StoreBookingTable::getCategoryId, id);
+        LambdaQueryWrapper<StoreTable> tableWrapper = new LambdaQueryWrapper<>();
+        tableWrapper.eq(StoreTable::getCategoryId, id);
         // @TableLogic 会自动过滤已删除的记录(delete_flag=0)
-        List<StoreBookingTable> tables = storeBookingTableService.list(tableWrapper);
+        List<StoreTable> tables = storeBookingTableService.list(tableWrapper);
         
         // 如果存在桌号,先批量删除这些桌号
         if (tables != null && !tables.isEmpty()) {
             List<Integer> tableIds = tables.stream()
-                    .map(StoreBookingTable::getId)
+                    .map(StoreTable::getId)
                     .collect(java.util.stream.Collectors.toList());
             
             log.info("删除分类时同时删除该分类下的所有桌号,categoryId={}, tableCount={}, tableIds={}", 

+ 40 - 46
alien-store/src/main/java/shop/alien/store/service/impl/StoreBookingTableServiceImpl.java

@@ -13,13 +13,10 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 import org.springframework.beans.BeanUtils;
 import shop.alien.entity.store.StoreBookingCategory;
-import shop.alien.entity.store.StoreBookingTable;
-import shop.alien.entity.store.UserReservation;
-import shop.alien.entity.store.UserReservationTable;
+import shop.alien.entity.store.StoreTable;
 import shop.alien.entity.store.vo.StoreBookingTableVo;
 import shop.alien.mapper.StoreBookingTableMapper;
 import shop.alien.mapper.UserReservationMapper;
-import shop.alien.mapper.UserReservationTableMapper;
 import shop.alien.store.service.StoreBookingCategoryService;
 import shop.alien.store.service.StoreBookingTableService;
 import shop.alien.util.common.JwtUtil;
@@ -38,38 +35,35 @@ import java.util.stream.Collectors;
 @Slf4j
 @Service
 @Transactional
-public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableMapper, StoreBookingTable> implements StoreBookingTableService {
+public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableMapper, StoreTable> implements StoreBookingTableService {
 
     private final StoreBookingCategoryService storeBookingCategoryService;
-    private final UserReservationTableMapper userReservationTableMapper;
     private final UserReservationMapper userReservationMapper;
 
     public StoreBookingTableServiceImpl(@Lazy StoreBookingCategoryService storeBookingCategoryService,
-                                        UserReservationTableMapper userReservationTableMapper,
                                         UserReservationMapper userReservationMapper) {
         this.storeBookingCategoryService = storeBookingCategoryService;
-        this.userReservationTableMapper = userReservationTableMapper;
         this.userReservationMapper = userReservationMapper;
     }
 
     @Override
-    public List<StoreBookingTable> getTableList(Integer storeId, Integer categoryId) {
+    public List<StoreTable> getTableList(Integer storeId, Integer categoryId) {
         log.info("StoreBookingTableServiceImpl.getTableList?storeId={}, categoryId={}", storeId, categoryId);
         
-        LambdaQueryWrapper<StoreBookingTable> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(StoreBookingTable::getStoreId, storeId);
+        LambdaQueryWrapper<StoreTable> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(StoreTable::getStoreId, storeId);
         
         // 如果指定了分类ID,则按分类筛选;否则查询全部
         if (categoryId != null) {
-            wrapper.eq(StoreBookingTable::getCategoryId, categoryId);
+            wrapper.eq(StoreTable::getCategoryId, categoryId);
         }
         
         // 查询所有数据,然后在Java中进行排序
-        List<StoreBookingTable> list = this.list(wrapper);
+        List<StoreTable> list = this.list(wrapper);
         
         // 自定义排序:根据类别、字母(A-Z)、数字(由小到大)顺序排列
         list.sort(Comparator
-                .comparing(StoreBookingTable::getCategoryId, Comparator.nullsLast(Integer::compareTo)) // 先按类别排序
+                .comparing(StoreTable::getCategoryId, Comparator.nullsLast(Integer::compareTo)) // 先按类别排序
                 .thenComparing(table -> parseTableNumberForSort(table.getTableNumber()))); // 再按桌号排序
         
         return list;
@@ -80,7 +74,7 @@ public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableM
         log.info("StoreBookingTableServiceImpl.getTableListWithCategoryName?storeId={}, categoryId={}", storeId, categoryId);
         
         // 先查询桌号列表
-        List<StoreBookingTable> tableList = getTableList(storeId, categoryId);
+        List<StoreTable> tableList = getTableList(storeId, categoryId);
         
         // 查询所有分类信息,构建categoryId -> categoryName的映射
         List<StoreBookingCategory> categoryList = storeBookingCategoryService.list(
@@ -198,7 +192,7 @@ public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableM
     }
 
     @Override
-    public boolean addTable(StoreBookingTable table) {
+    public boolean addTable(StoreTable table) {
         log.info("StoreBookingTableServiceImpl.addTable?table={}", table);
         
         // 从JWT获取当前登录用户ID
@@ -227,12 +221,12 @@ public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableM
         table.setTableNumber(tableNumber);
         
         // 检查同一分类下是否已存在相同的桌号(不同分类可以同名)
-        LambdaQueryWrapper<StoreBookingTable> checkWrapper = new LambdaQueryWrapper<>();
-        checkWrapper.eq(StoreBookingTable::getStoreId, table.getStoreId())
-                .eq(StoreBookingTable::getCategoryId, table.getCategoryId())
-                .eq(StoreBookingTable::getTableNumber, tableNumber);
+        LambdaQueryWrapper<StoreTable> checkWrapper = new LambdaQueryWrapper<>();
+        checkWrapper.eq(StoreTable::getStoreId, table.getStoreId())
+                .eq(StoreTable::getCategoryId, table.getCategoryId())
+                .eq(StoreTable::getTableNumber, tableNumber);
         // @TableLogic 会自动过滤已删除的记录(delete_flag=0)
-        StoreBookingTable existingTable = this.getOne(checkWrapper);
+        StoreTable existingTable = this.getOne(checkWrapper);
         if (existingTable != null) {
             log.warn("新增预订服务桌号失败:同一分类下桌号已存在,storeId={}, categoryId={}, tableNumber={}", 
                     table.getStoreId(), table.getCategoryId(), tableNumber);
@@ -245,7 +239,7 @@ public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableM
     }
 
     @Override
-    public boolean batchAddTables(Integer storeId, Integer categoryId, List<StoreBookingTable> tables) {
+    public boolean batchAddTables(Integer storeId, Integer categoryId, List<StoreTable> tables) {
         log.info("StoreBookingTableServiceImpl.batchAddTables?storeId={}, categoryId={}, tables.size={}", 
                 storeId, categoryId, tables != null ? tables.size() : 0);
         
@@ -267,7 +261,7 @@ public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableM
         }
         
         // 验证并处理每个桌号
-        for (StoreBookingTable table : tables) {
+        for (StoreTable table : tables) {
             if (!StringUtils.hasText(table.getTableNumber())) {
                 log.warn("批量新增预订服务桌号失败:桌号不能为空");
                 throw new RuntimeException("桌号不能为空");
@@ -287,7 +281,7 @@ public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableM
         
         // 检查是否有重复的桌号(在本次批量添加的列表中)
         long distinctCount = tables.stream()
-                .map(StoreBookingTable::getTableNumber)
+                .map(StoreTable::getTableNumber)
                 .distinct()
                 .count();
         if (distinctCount != tables.size()) {
@@ -297,19 +291,19 @@ public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableM
         
         // 检查同一分类下是否已存在相同的桌号(不同分类可以同名)
         List<String> tableNumbers = tables.stream()
-                .map(StoreBookingTable::getTableNumber)
+                .map(StoreTable::getTableNumber)
                 .collect(Collectors.toList());
         
-        LambdaQueryWrapper<StoreBookingTable> checkWrapper = new LambdaQueryWrapper<>();
-        checkWrapper.eq(StoreBookingTable::getStoreId, storeId)
-                .eq(StoreBookingTable::getCategoryId, categoryId)
-                .in(StoreBookingTable::getTableNumber, tableNumbers);
+        LambdaQueryWrapper<StoreTable> checkWrapper = new LambdaQueryWrapper<>();
+        checkWrapper.eq(StoreTable::getStoreId, storeId)
+                .eq(StoreTable::getCategoryId, categoryId)
+                .in(StoreTable::getTableNumber, tableNumbers);
         // @TableLogic 会自动过滤已删除的记录(delete_flag=0)
-        List<StoreBookingTable> existingTables = this.list(checkWrapper);
+        List<StoreTable> existingTables = this.list(checkWrapper);
         
         if (!existingTables.isEmpty()) {
             List<String> existingNumbers = existingTables.stream()
-                    .map(StoreBookingTable::getTableNumber)
+                    .map(StoreTable::getTableNumber)
                     .distinct()
                     .collect(Collectors.toList());
             log.warn("批量新增预订服务桌号失败:同一分类下桌号已存在,storeId={}, categoryId={}, existingNumbers={}", 
@@ -326,7 +320,7 @@ public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableM
     }
 
     @Override
-    public boolean updateTable(StoreBookingTable table) {
+    public boolean updateTable(StoreTable table) {
         log.info("StoreBookingTableServiceImpl.updateTable?table={}", table);
         
         // 从JWT获取当前登录用户ID
@@ -338,7 +332,7 @@ public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableM
             throw new RuntimeException("桌号ID不能为空");
         }
         
-        StoreBookingTable existingTable = this.getById(table.getId());
+        StoreTable existingTable = this.getById(table.getId());
         if (existingTable == null) {
             log.warn("更新预订服务桌号失败:桌号不存在,id={}", table.getId());
             throw new RuntimeException("桌号不存在");
@@ -355,13 +349,13 @@ public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableM
                 // 如果分类ID也变化了,使用新的分类ID;否则使用原有的分类ID
                 Integer checkCategoryId = table.getCategoryId() != null ? table.getCategoryId() : existingTable.getCategoryId();
                 
-                LambdaQueryWrapper<StoreBookingTable> wrapper = new LambdaQueryWrapper<>();
-                wrapper.eq(StoreBookingTable::getStoreId, existingTable.getStoreId())
-                        .eq(StoreBookingTable::getCategoryId, checkCategoryId)
-                        .eq(StoreBookingTable::getTableNumber, tableNumber)
-                        .ne(StoreBookingTable::getId, table.getId());
+                LambdaQueryWrapper<StoreTable> wrapper = new LambdaQueryWrapper<>();
+                wrapper.eq(StoreTable::getStoreId, existingTable.getStoreId())
+                        .eq(StoreTable::getCategoryId, checkCategoryId)
+                        .eq(StoreTable::getTableNumber, tableNumber)
+                        .ne(StoreTable::getId, table.getId());
                 // @TableLogic 会自动过滤已删除的记录(delete_flag=0)
-                StoreBookingTable duplicateTable = this.getOne(wrapper);
+                StoreTable duplicateTable = this.getOne(wrapper);
                 if (duplicateTable != null) {
                     log.warn("更新预订服务桌号失败:同一分类下桌号已存在,storeId={}, categoryId={}, tableNumber={}, id={}", 
                             existingTable.getStoreId(), checkCategoryId, tableNumber, table.getId());
@@ -377,21 +371,21 @@ public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableM
         }
         
         // 更新字段
-        LambdaUpdateWrapper<StoreBookingTable> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.eq(StoreBookingTable::getId, table.getId());
+        LambdaUpdateWrapper<StoreTable> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper.eq(StoreTable::getId, table.getId());
         
         if (StringUtils.hasText(table.getTableNumber())) {
-            updateWrapper.set(StoreBookingTable::getTableNumber, table.getTableNumber());
+            updateWrapper.set(StoreTable::getTableNumber, table.getTableNumber());
         }
         if (table.getCategoryId() != null) {
-            updateWrapper.set(StoreBookingTable::getCategoryId, table.getCategoryId());
+            updateWrapper.set(StoreTable::getCategoryId, table.getCategoryId());
         }
         if (table.getSeatingCapacity() != null) {
-            updateWrapper.set(StoreBookingTable::getSeatingCapacity, table.getSeatingCapacity());
+            updateWrapper.set(StoreTable::getSeatingCapacity, table.getSeatingCapacity());
         }
         
         if (userId != null) {
-            updateWrapper.set(StoreBookingTable::getUpdatedUserId, userId);
+            updateWrapper.set(StoreTable::getUpdatedUserId, userId);
         }
         
         return this.update(updateWrapper);
@@ -401,7 +395,7 @@ public class StoreBookingTableServiceImpl extends ServiceImpl<StoreBookingTableM
     public boolean deleteTable(Integer id) {
         log.info("StoreBookingTableServiceImpl.deleteTable?id={}", id);
         
-        StoreBookingTable table = this.getById(id);
+        StoreTable table = this.getById(id);
         if (table == null) {
             log.warn("删除预订服务桌号失败:桌号不存在,id={}", id);
             throw new RuntimeException("桌号不存在");

+ 2 - 2
alien-store/src/main/java/shop/alien/store/service/impl/StoreReservationServiceImpl.java

@@ -7,7 +7,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import shop.alien.entity.store.MerchantPaymentOrder;
-import shop.alien.entity.store.StoreBookingTable;
+import shop.alien.entity.store.StoreTable;
 import shop.alien.entity.store.StoreInfo;
 import shop.alien.entity.store.UserReservation;
 import shop.alien.entity.store.UserReservationTable;
@@ -262,7 +262,7 @@ public class StoreReservationServiceImpl extends ServiceImpl<StoreReservationMap
                 // 获取所有桌号,用逗号分隔
                 List<String> tableNumbers = reservationTables.stream()
                         .map(rt -> {
-                            StoreBookingTable table = storeBookingTableService.getById(rt.getTableId());
+                            StoreTable table = storeBookingTableService.getById(rt.getTableId());
                             return table != null && table.getTableNumber() != null ? table.getTableNumber() : null;
                         })
                         .filter(tn -> tn != null && !tn.trim().isEmpty())

+ 1 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreTableServiceImpl.java

@@ -113,6 +113,7 @@ public class StoreTableServiceImpl extends ServiceImpl<StoreTableMapper, StoreTa
      * 异步为新创建的桌号生成二维码
      */
     @Async
+    @Override
     public void asyncGenerateQrCodesForTables(Integer storeId, List<String> tableNumbers) {
         log.info("开始异步生成桌号二维码, storeId={}, tableNumbers={}", storeId, tableNumbers);
         try {

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

@@ -522,7 +522,7 @@ public class UserReservationServiceImpl extends ServiceImpl<UserReservationMappe
         }
         list.put("storeBookingBusinessHours", storeBookingBusinessHours);
         
-        List<StoreBookingTable> storeBookingTables = storeBookingTableService.list(new LambdaQueryWrapper<StoreBookingTable>().eq(StoreBookingTable::getStoreId, storeId));
+        List<StoreTable> storeBookingTables = storeBookingTableService.list(new LambdaQueryWrapper<StoreTable>().eq(StoreTable::getStoreId, storeId));
         list.put("storeBookingTables", storeBookingTables);
         List<StoreBookingCategory> storeBookingCategorys = storeBookingCategoryService.list(
                 new LambdaQueryWrapper<StoreBookingCategory>()
@@ -681,7 +681,7 @@ public class UserReservationServiceImpl extends ServiceImpl<UserReservationMappe
      * 使用 store_booking_settings 的 booking_start_time、booking_end_time 作为当日可预订起止,与 user_reservation 的 start_time、end_time 及 user_reservation_table 的 table_id 对比,只有全部约满才返回 true。
      */
     private List<Map<String, Object>> buildTableStatusListForDay(Integer storeId, Date dayStart, Date dayEnd,
-                                                                 List<StoreBookingTable> storeTables,
+                                                                List<StoreTable> storeTables,
                                                                  List<UserReservation> dayReservations,
                                                                  List<UserReservationTable> dayTableLinks,
                                                                  int bookingStartMin, int bookingEndMin) {
@@ -736,7 +736,7 @@ public class UserReservationServiceImpl extends ServiceImpl<UserReservationMappe
         cal.add(Calendar.DAY_OF_MONTH, 1);
         Date dayEnd = cal.getTime();
 
-        List<StoreBookingTable> storeTables = storeBookingTableService.getTableList(storeId, null);
+        List<StoreTable> storeTables = storeBookingTableService.getTableList(storeId, null);
         int[] range = getBookingRangeMinutes(storeId);
         int bookingStartMin = range[0];
         int bookingEndMin = range[1];
@@ -788,7 +788,7 @@ public class UserReservationServiceImpl extends ServiceImpl<UserReservationMappe
             return result;
         }
         // 门店下所有选座(桌),用于按“选座”维度计算约满
-        List<StoreBookingTable> storeTables = storeBookingTableService.getTableList(storeId, null);
+        List<StoreTable> storeTables = storeBookingTableService.getTableList(storeId, null);
 //        if (storeTables == null) {
 //            storeTables = List.of();
 //        }
@@ -900,7 +900,7 @@ public class UserReservationServiceImpl extends ServiceImpl<UserReservationMappe
         }
         List<String> numbers = tableIds.stream()
                 .map(tableId -> {
-                    StoreBookingTable t = storeBookingTableService.getById(tableId);
+                    StoreTable t = storeBookingTableService.getById(tableId);
                     return t != null && t.getTableNumber() != null ? t.getTableNumber().trim() : null;
                 })
                 .filter(n -> n != null && !n.isEmpty())
@@ -1329,7 +1329,7 @@ public class UserReservationServiceImpl extends ServiceImpl<UserReservationMappe
         }
         List<String> nums = links.stream()
                 .map(rt -> {
-                    StoreBookingTable t = storeBookingTableService.getById(rt.getTableId());
+                    StoreTable t = storeBookingTableService.getById(rt.getTableId());
                     return t != null && t.getTableNumber() != null ? t.getTableNumber().trim() : null;
                 })
                 .filter(n -> n != null && !n.isEmpty())
@@ -1397,7 +1397,7 @@ public class UserReservationServiceImpl extends ServiceImpl<UserReservationMappe
         }
         List<BookingTableItemVo> list = new ArrayList<>();
         for (Integer tableId : tableIds) {
-            StoreBookingTable table = storeBookingTableService.getById(tableId);
+            StoreTable table = storeBookingTableService.getById(tableId);
             if (table == null) {
                 continue;
             }