Quellcode durchsuchen

Merge branch 'sit' into uat-20260202

dujian vor 1 Monat
Ursprung
Commit
f10abb0635

+ 1 - 1
alien-dining/src/main/java/shop/alien/dining/controller/DiningCollectController.java

@@ -37,7 +37,7 @@ public class DiningCollectController {
     @ApiOperationSupport(order = 1)
     @PostMapping("/addCollect")
     public R<Boolean> addCollect(@ApiParam(value = "收藏对象", required = true) @RequestBody LifeCollect lifeCollect) {
-        log.info("DiningCollectController.addCollect lifeCollect={}", lifeCollect);
+        log.info("DiningCollectController.addCollect?lifeCollect={}", lifeCollect);
         try {
             return diningCollectService.addCollect(lifeCollect);
         } catch (Exception e) {

+ 14 - 0
alien-dining/src/main/java/shop/alien/dining/controller/DiningController.java

@@ -33,6 +33,7 @@ public class DiningController {
     @GetMapping("/table-dining-status")
     public R<TableDiningStatusVO> getTableDiningStatus(
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId) {
+        log.info("DiningController.getTableDiningStatus?tableId={}", tableId);
         try {
             TableDiningStatusVO vo = diningService.getTableDiningStatus(tableId);
             return R.data(vo);
@@ -47,6 +48,7 @@ public class DiningController {
     public R<DiningPageInfoVO> getDiningPageInfo(
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId,
             @ApiParam(value = "就餐人数(首客必传;餐桌已就餐中时可省略,将使用已保存人数)") @RequestParam(required = false) Integer dinerCount) {
+        log.info("DiningController.getDiningPageInfo?tableId={}, dinerCount={}", tableId, dinerCount);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -67,6 +69,7 @@ public class DiningController {
             @ApiParam(value = "门店ID", required = true) @RequestParam Integer storeId,
             @ApiParam(value = "搜索关键词", required = false) @RequestParam(required = false) String keyword,
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId) {
+        log.info("DiningController.searchCuisines?storeId={}, keyword={}, tableId={}", storeId, keyword, tableId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -93,6 +96,7 @@ public class DiningController {
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId,
             @ApiParam(value = "页码", required = false) @RequestParam(defaultValue = "1") Integer page,
             @ApiParam(value = "每页数量", required = false) @RequestParam(defaultValue = "12") Integer size) {
+        log.info("DiningController.getCuisinesByCategory?storeId={}, categoryId={}, tableId={}, page={}, size={}", storeId, categoryId, tableId, page, size);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -112,6 +116,7 @@ public class DiningController {
     public R<CuisineDetailVO> getCuisineDetail(
             @ApiParam(value = "菜品ID", required = true) @PathVariable Integer cuisineId,
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId) {
+        log.info("DiningController.getCuisineDetail?cuisineId={}, tableId={}", cuisineId, tableId);
         try {
             CuisineDetailVO vo = diningService.getCuisineDetail(cuisineId, tableId);
             
@@ -126,6 +131,7 @@ public class DiningController {
     @GetMapping("/coupons/available")
     public R<List<AvailableCouponVO>> getAvailableCoupons(
             @ApiParam(value = "门店ID", required = true) @RequestParam Integer storeId) {
+        log.info("DiningController.getAvailableCoupons?storeId={}", storeId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -144,6 +150,7 @@ public class DiningController {
     @PostMapping("/coupon/receive")
     public R<Boolean> receiveCoupon(
             @ApiParam(value = "优惠券ID", required = true) @RequestParam Integer couponId) {
+        log.info("DiningController.receiveCoupon?couponId={}", couponId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -163,6 +170,7 @@ public class DiningController {
     public R<OrderConfirmVO> getOrderConfirmInfo(
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId,
             @ApiParam(value = "就餐人数", required = true) @RequestParam Integer dinerCount) {
+        log.info("DiningController.getOrderConfirmInfo?tableId={}, dinerCount={}", tableId, dinerCount);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -181,6 +189,7 @@ public class DiningController {
     @PostMapping("/order/lock")
     public R<Boolean> lockOrder(
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId) {
+        log.info("DiningController.lockOrder?tableId={}", tableId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -202,6 +211,7 @@ public class DiningController {
     @PostMapping("/order/unlock")
     public R<Boolean> unlockOrder(
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId) {
+        log.info("DiningController.unlockOrder?tableId={}", tableId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -220,6 +230,7 @@ public class DiningController {
     @GetMapping("/order/check-lock")
     public R<Integer> checkOrderLock(
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId) {
+        log.info("DiningController.checkOrderLock?tableId={}", tableId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -238,6 +249,7 @@ public class DiningController {
     @GetMapping("/order/settlement")
     public R<shop.alien.entity.store.vo.OrderSettlementVO> getOrderSettlementInfo(
             @ApiParam(value = "订单ID", required = true) @RequestParam Integer orderId) {
+        log.info("DiningController.getOrderSettlementInfo?orderId={}", orderId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -256,6 +268,7 @@ public class DiningController {
     @PostMapping("/order/settlement/lock")
     public R<Boolean> lockSettlement(
             @ApiParam(value = "订单ID", required = true) @RequestParam Integer orderId) {
+        log.info("DiningController.lockSettlement?orderId={}", orderId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -277,6 +290,7 @@ public class DiningController {
     @PostMapping("/order/settlement/unlock")
     public R<Boolean> unlockSettlement(
             @ApiParam(value = "订单ID", required = true) @RequestParam Integer orderId) {
+        log.info("DiningController.unlockSettlement?orderId={}", orderId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();

+ 7 - 0
alien-dining/src/main/java/shop/alien/dining/controller/DiningCouponController.java

@@ -58,6 +58,7 @@ public class DiningCouponController {
             @RequestParam("tabType") String tabType,
             @RequestParam(value = "type", required = false) Integer type,
             @RequestParam(value = "couponType", required = false) Integer couponType) {
+        log.info("DiningCouponController.getUserCouponList?page={}, size={}, tabType={}, type={}, couponType={}", page, size, tabType, type, couponType);
         String authorization = request.getHeader("Authorization");
         return diningCouponService.getUserCouponList(authorization, page, size, tabType, type, couponType);
     }
@@ -73,6 +74,7 @@ public class DiningCouponController {
     public R<LifeDiscountCouponVo> getCounponDetailById(
             HttpServletRequest request,
             @RequestParam("counponId") String counponId) {
+        log.info("DiningCouponController.getCounponDetailById?counponId={}", counponId);
         String authorization = request.getHeader("Authorization");
         return diningCouponService.getCounponDetailById(authorization, counponId);
     }
@@ -92,6 +94,7 @@ public class DiningCouponController {
             @RequestParam("storeId") String storeId,
             @RequestParam("amount") BigDecimal amount,
             @ApiParam(value = "优惠券类型:1=仅满减券,2=仅折扣券,不传=全部优惠券") @RequestParam(value = "couponType", required = false) Integer couponType) {
+        log.info("DiningCouponController.getStoreUserUsableCouponList?storeId={}, amount={}, couponType={}", storeId, amount, couponType);
         String authorization = request.getHeader("Authorization");
         return diningCouponService.getStoreUserUsableCouponList(authorization, storeId, amount, couponType);
     }
@@ -108,6 +111,7 @@ public class DiningCouponController {
     public R<List<LifeDiscountCouponVo>> getUserOwnedCoupons(
             @ApiParam(value = "门店ID(可选)") @RequestParam(required = false) String storeId,
             @ApiParam(value = "当前消费金额(可选,用于判断是否符合支付条件)") @RequestParam(required = false) BigDecimal amount) {
+        log.info("DiningCouponController.getUserOwnedCoupons?storeId={}, amount={}", storeId, amount);
         return diningCouponService.getUserOwnedCoupons(storeId, amount);
     }
 
@@ -125,6 +129,7 @@ public class DiningCouponController {
             HttpServletRequest request,
             @ApiParam(value = "商户id", required = true) @RequestParam("storeId") String storeId,
             @ApiParam(value = "优惠券类型:1=仅满减券,2=仅折扣券,不传=全部优惠券") @RequestParam(value = "couponType", required = false) Integer couponType) {
+        log.info("DiningCouponController.getStoreUserCouponList?storeId={}, couponType={}", storeId, couponType);
         String authorization = request.getHeader("Authorization");
         return diningCouponService.getStoreUserCouponList(authorization, storeId, couponType);
     }
@@ -142,6 +147,7 @@ public class DiningCouponController {
     public R<List<LifeDiscountCouponVo>> getUserOwnedCouponsByStore(
             @ApiParam(value = "商铺ID(可选)") @RequestParam(required = false) String storeId,
             @ApiParam(value = "优惠券类型:1=仅满减券,2=仅折扣券,不传=全部优惠券") @RequestParam(value = "couponType", required = false) Integer couponType) {
+        log.info("DiningCouponController.getUserOwnedCouponsByStore?storeId={}, couponType={}", storeId, couponType);
         return diningCouponService.getUserOwnedCouponsByStore(storeId, couponType);
     }
 
@@ -171,6 +177,7 @@ public class DiningCouponController {
             @ApiParam(value = "查询类型(1:我的优惠券,2:好友的优惠券)", defaultValue = "1") @RequestParam(value = "couponsFromType", defaultValue = "1") int couponsFromType,
             @ApiParam(value = "优惠券状态(0:草稿,1:正式)", defaultValue = "1") @RequestParam(value = "couponStatus", defaultValue = "1", required = false) int couponStatus,
             @ApiParam(value = "优惠券类型:1=仅满减券,2=仅折扣券,不传=全部优惠券") @RequestParam(value = "couponType", required = false) Integer couponType) {
+        log.info("DiningCouponController.getStoreAllCouponList?page={}, size={}, storeId={}, couponName={}, tab={}, couponsFromType={}, couponStatus={}, couponType={}", page, size, storeId, couponName, tab, couponsFromType, couponStatus, couponType);
         String authorization = request.getHeader("Authorization");
         return diningCouponService.getStoreAllCouponList(authorization, page, size, storeId, couponName, tab, couponsFromType, couponStatus, couponType);
     }

+ 1 - 1
alien-dining/src/main/java/shop/alien/dining/controller/DiningFileUploadController.java

@@ -39,7 +39,7 @@ public class DiningFileUploadController {
     @ApiOperationSupport(order = 1)
     @PostMapping("/upload")
     public R<String> upload(@RequestParam("file") MultipartFile file) {
-        log.info("DiningFileUploadController.upload fileName:{}", file.getOriginalFilename());
+        log.info("DiningFileUploadController.upload?fileName={}", file != null ? file.getOriginalFilename() : null);
         try {
             if (file == null || file.isEmpty()) {
                 return R.fail("文件不能为空");

+ 1 - 0
alien-dining/src/main/java/shop/alien/dining/controller/DiningUserController.java

@@ -160,6 +160,7 @@ public class DiningUserController {
             return R.fail("Token 不能为空");
         }
 
+        log.info("DiningUserController.parseToken?token={}", token.length() > 20 ? token.substring(0, 20) + "****" : token);
         com.alibaba.fastjson.JSONObject userInfo = shop.alien.dining.util.TokenUtil.parseToken(token);
         if (userInfo == null) {
             return R.fail("Token 解析失败,请查看日志获取详细信息");

+ 2 - 0
alien-dining/src/main/java/shop/alien/dining/controller/PaymentController.java

@@ -97,6 +97,7 @@ public class PaymentController {
      */
     @RequestMapping("/searchOrderByOutTradeNoPath")
     public R searchOrderByOutTradeNoPath(String transactionId, String payType, Integer storeId) {
+        log.info("PaymentController.searchOrderByOutTradeNoPath?transactionId={}, payType={}, storeId={}", transactionId, payType, storeId);
         try {
             return paymentStrategyFactory.getStrategy(payType).searchOrderByOutTradeNoPath(transactionId, storeId);
         } catch (Exception e) {
@@ -111,6 +112,7 @@ public class PaymentController {
      */
     @RequestMapping("/refunds")
     public R refunds(@RequestBody Map<String, String> params) {
+        log.info("PaymentController.refunds?params={}", params);
         try {
             return R.data(paymentStrategyFactory.getStrategy(params.get("payType")).handleRefund(params));
         } catch (Exception e) {

+ 4 - 0
alien-dining/src/main/java/shop/alien/dining/controller/StoreInfoController.java

@@ -33,6 +33,7 @@ public class StoreInfoController {
     @GetMapping("/tables")
     public R<List<StoreTable>> getTablesByStoreId(
             @ApiParam(value = "门店ID", required = true) @RequestParam Integer storeId) {
+        log.info("StoreInfoController.getTablesByStoreId?storeId={}", storeId);
         try {
             if (storeId == null) {
                 return R.fail("门店ID不能为空");
@@ -49,6 +50,7 @@ public class StoreInfoController {
     @GetMapping("/categories")
     public R<List<StoreCuisineCategory>> getCategoriesByStoreId(
             @ApiParam(value = "门店ID", required = true) @RequestParam Integer storeId) {
+        log.info("StoreInfoController.getCategoriesByStoreId?storeId={}", storeId);
         try {
             if (storeId == null) {
                 return R.fail("门店ID不能为空");
@@ -65,6 +67,7 @@ public class StoreInfoController {
     @GetMapping("/cuisines")
     public R<List<StoreCuisine>> getCuisinesByCategoryId(
             @ApiParam(value = "菜品种类ID", required = true) @RequestParam Integer categoryId) {
+        log.info("StoreInfoController.getCuisinesByCategoryId?categoryId={}", categoryId);
         try {
             if (categoryId == null) {
                 return R.fail("菜品种类ID不能为空");
@@ -81,6 +84,7 @@ public class StoreInfoController {
     @GetMapping("/detail/{storeId}")
     public R<StoreInfoWithHomepageCuisinesDTO> getStoreInfoWithHomepageCuisines(
             @ApiParam(value = "商铺ID", required = true) @PathVariable Integer storeId) {
+        log.info("StoreInfoController.getStoreInfoWithHomepageCuisines?storeId={}", storeId);
         try {
             if (storeId == null) {
                 return R.fail("商铺ID不能为空");

+ 22 - 0
alien-dining/src/main/java/shop/alien/dining/controller/StoreOrderController.java

@@ -55,6 +55,7 @@ public class StoreOrderController {
     @ApiOperation(value = "获取购物车", notes = "根据桌号ID获取购物车信息")
     @GetMapping("/cart/{tableId}")
     public R<CartDTO> getCart(@ApiParam(value = "桌号ID", required = true) @PathVariable Integer tableId) {
+        log.info("StoreOrderController.getCart?tableId={}", tableId);
         try {
             // 验证 token
             if (!TokenUtil.hasValidToken()) {
@@ -71,6 +72,7 @@ public class StoreOrderController {
     @ApiOperation(value = "添加商品到购物车", notes = "添加商品到购物车,并推送SSE和WebSocket消息")
     @PostMapping("/cart/add")
     public R<CartDTO> addCartItem(@Valid @RequestBody AddCartItemDTO dto) {
+        log.info("StoreOrderController.addCartItem?dto={}", dto);
         try {
             // 验证 token(用户信息在 CartService 中从 token 获取)
             if (!TokenUtil.hasValidToken()) {
@@ -94,6 +96,7 @@ public class StoreOrderController {
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId,
             @ApiParam(value = "菜品ID", required = true) @RequestParam Integer cuisineId,
             @ApiParam(value = "数量", required = true) @RequestParam Integer quantity) {
+        log.info("StoreOrderController.updateCartItem?tableId={}, cuisineId={}, quantity={}", tableId, cuisineId, quantity);
         try {
             // 验证 token
             if (!TokenUtil.hasValidToken()) {
@@ -116,6 +119,7 @@ public class StoreOrderController {
     public R<CartDTO> removeCartItem(
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId,
             @ApiParam(value = "菜品ID", required = true) @RequestParam Integer cuisineId) {
+        log.info("StoreOrderController.removeCartItem?tableId={}, cuisineId={}", tableId, cuisineId);
         try {
             // 验证 token
             if (!TokenUtil.hasValidToken()) {
@@ -137,6 +141,7 @@ public class StoreOrderController {
     @DeleteMapping("/cart/clear")
     public R<CartDTO> clearCart(
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId) {
+        log.info("StoreOrderController.clearCart?tableId={}", tableId);
         try {
             // 验证 token
             if (!TokenUtil.hasValidToken()) {
@@ -166,6 +171,7 @@ public class StoreOrderController {
     public R<CartDTO> setDinerCount(
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId,
             @ApiParam(value = "用餐人数", required = true) @RequestParam Integer dinerCount) {
+        log.info("StoreOrderController.setDinerCount?tableId={}, dinerCount={}", tableId, dinerCount);
         try {
             // 验证 token
             if (!TokenUtil.hasValidToken()) {
@@ -191,6 +197,7 @@ public class StoreOrderController {
     public R<CartDTO> updateTablewareQuantity(
             @ApiParam(value = "桌号ID", required = true) @RequestParam Integer tableId,
             @ApiParam(value = "餐具数量", required = true) @RequestParam Integer quantity) {
+        log.info("StoreOrderController.updateTablewareQuantity?tableId={}, quantity={}", tableId, quantity);
         try {
             // 验证 token
             if (!TokenUtil.hasValidToken()) {
@@ -214,6 +221,7 @@ public class StoreOrderController {
     @ApiOperation(value = "创建订单(下单)", notes = "从购物车创建订单,不立即支付")
     @PostMapping("/create")
     public R<shop.alien.entity.store.vo.OrderSuccessVO> createOrder(@Valid @RequestBody CreateOrderDTO dto) {
+        log.info("StoreOrderController.createOrder?dto={}", dto);
         try {
             // 验证 token(用户信息在 StoreOrderService 中从 token 获取)
             if (!TokenUtil.hasValidToken()) {
@@ -252,6 +260,7 @@ public class StoreOrderController {
     @ApiOperation(value = "加餐", notes = "在已有订单基础上添加菜品")
     @PostMapping("/add-dish")
     public R<StoreOrder> addDishToOrder(@Valid @RequestBody shop.alien.entity.store.dto.AddDishDTO dto) {
+        log.info("StoreOrderController.addDishToOrder?dto={}", dto);
         try {
             // 验证 token(用户信息在 StoreOrderService 中从 token 获取)
             if (!TokenUtil.hasValidToken()) {
@@ -270,6 +279,7 @@ public class StoreOrderController {
     public R<Object> payOrder(
             @ApiParam(value = "订单ID", required = true) @PathVariable Integer orderId,
             @ApiParam(value = "支付方式(1:微信, 2:支付宝, 3:现金)", required = true) @RequestParam Integer payType) {
+        log.info("StoreOrderController.payOrder?orderId={}, payType={}", orderId, payType);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -308,6 +318,7 @@ public class StoreOrderController {
     @ApiOperation(value = "取消订单", notes = "取消订单")
     @PostMapping("/cancel/{orderId}")
     public R<Boolean> cancelOrder(@ApiParam(value = "订单ID", required = true) @PathVariable Integer orderId) {
+        log.info("StoreOrderController.cancelOrder?orderId={}", orderId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -325,6 +336,7 @@ public class StoreOrderController {
     @ApiOperation(value = "查询订单详情", notes = "根据订单ID查询订单详情,包含订单基本信息和按批次分组的变更记录,用于展示每次下单/加餐都加了什么商品")
     @GetMapping("/detail/{orderId}")
     public R<OrderDetailWithChangeLogVO> getOrderDetail(@ApiParam(value = "订单ID", required = true) @PathVariable Integer orderId) {
+        log.info("StoreOrderController.getOrderDetail?orderId={}", orderId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -342,6 +354,7 @@ public class StoreOrderController {
     @ApiOperation(value = "查询订单明细", notes = "根据订单ID查询订单明细列表")
     @GetMapping("/detail/list/{orderId}")
     public R<List<StoreOrderDetail>> getOrderDetailList(@ApiParam(value = "订单ID", required = true) @PathVariable Integer orderId) {
+        log.info("StoreOrderController.getOrderDetailList?orderId={}", orderId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -364,6 +377,7 @@ public class StoreOrderController {
     @ApiOperation(value = "查询订单信息", notes = "根据订单ID查询订单完整信息(包含订单基本信息、菜品清单、价格明细)")
     @GetMapping("/info/{orderId}")
     public R<OrderInfoVO> getOrderInfo(@ApiParam(value = "订单ID", required = true) @PathVariable Integer orderId) {
+        log.info("StoreOrderController.getOrderInfo?orderId={}", orderId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -381,6 +395,7 @@ public class StoreOrderController {
     @ApiOperation(value = "查询订单变更记录", notes = "根据订单ID查询订单的所有变更记录(按批次分组),用于展示每次下单/加餐都加了什么商品")
     @GetMapping("/change-log/{orderId}")
     public R<List<OrderChangeLogBatchVO>> getOrderChangeLogs(@ApiParam(value = "订单ID", required = true) @PathVariable Integer orderId) {
+        log.info("StoreOrderController.getOrderChangeLogs?orderId={}", orderId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -405,6 +420,7 @@ public class StoreOrderController {
             @ApiParam(value = "桌号ID") @RequestParam(required = false) Integer tableId,
             @ApiParam(value = "订单状态") @RequestParam(required = false) Integer orderStatus,
             @ApiParam(value = "搜索关键词(订单编号或菜品名称,限15字)") @RequestParam(required = false) String keyword) {
+        log.info("StoreOrderController.getOrderPage?current={}, size={}, storeId={}, tableId={}, orderStatus={}, keyword={}", current, size, storeId, tableId, orderStatus, keyword);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -426,6 +442,7 @@ public class StoreOrderController {
             @ApiParam(value = "页码", required = true) @RequestParam(defaultValue = "1") Long current,
             @ApiParam(value = "每页数量", required = true) @RequestParam(defaultValue = "10") Long size,
             @ApiParam(value = "订单类型(0或unpaid:未支付订单, 1或history:历史订单)", required = true) @RequestParam String type) {
+        log.info("StoreOrderController.getMyOrders?current={}, size={}, type={}", current, size, type);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -444,6 +461,7 @@ public class StoreOrderController {
     @ApiOperation(value = "换桌", notes = "换桌并迁移购物车、未完成的订单以及其他关联表数据")
     @PostMapping("/change-table")
     public R<CartDTO> changeTable(@Valid @RequestBody ChangeTableDTO dto) {
+        log.info("StoreOrderController.changeTable?dto={}", dto);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -476,6 +494,7 @@ public class StoreOrderController {
     @ApiOperation(value = "完成订单", notes = "完成订单,将已支付状态的订单改为已完成状态。订单状态:0-待支付,1-已支付,3-已完成。只有已支付状态的订单才能完成")
     @PostMapping("/complete/{orderId}")
     public R<Boolean> completeOrder(@ApiParam(value = "订单ID", required = true) @PathVariable Integer orderId) {
+        log.info("StoreOrderController.completeOrder?orderId={}", orderId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -493,6 +512,7 @@ public class StoreOrderController {
     @ApiOperation(value = "商家手动完成订单", notes = "供商家使用,手动点击完成订单。不校验订单是否处于已支付状态,直接将订单状态改为已完成。订单状态:0-待支付,1-已支付,2-已取消,3-已完成")
     @PostMapping("/complete-by-merchant/{orderId}")
     public R<Boolean> completeOrderByMerchant(@ApiParam(value = "订单ID", required = true) @PathVariable Integer orderId) {
+        log.info("StoreOrderController.completeOrderByMerchant?orderId={}", orderId);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -510,6 +530,7 @@ public class StoreOrderController {
     @ApiOperation(value = "更新订单优惠券", notes = "重新选择优惠券")
     @PostMapping("/update-coupon")
     public R<StoreOrder> updateOrderCoupon(@Valid @RequestBody shop.alien.entity.store.dto.UpdateOrderCouponDTO dto) {
+        log.info("StoreOrderController.updateOrderCoupon?dto={}", dto);
         try {
             // 从 token 获取用户信息
             Integer userId = TokenUtil.getCurrentUserId();
@@ -527,6 +548,7 @@ public class StoreOrderController {
     @ApiOperation(value = "管理员重置餐桌", notes = "管理员重置餐桌:删除购物车数据、未支付/已取消的订单数据,并重置餐桌表初始化。已支付/已完成的订单会被保留,避免数据丢失")
     @PostMapping("/admin/reset-table/{tableId}")
     public R<Boolean> resetTable(@ApiParam(value = "餐桌ID", required = true) @PathVariable Integer tableId) {
+        log.info("StoreOrderController.resetTable?tableId={}", tableId);
         try {
             // TODO: 这里可以添加管理员权限验证
             // if (!isAdmin(userId)) {

+ 5 - 2
alien-dining/src/main/java/shop/alien/dining/service/impl/StoreOrderServiceImpl.java

@@ -166,8 +166,11 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
                 throw new RuntimeException("优惠券不存在");
             }
 
-            // 验证优惠券是否属于该门店
-            if (!coupon.getStoreId().equals(String.valueOf(table.getStoreId()))) {
+            // 验证优惠券是否属于该门店(空安全:coupon.storeId 为 String,table.storeId 为 Integer)
+            String couponStoreId = coupon.getStoreId();
+            Integer tableStoreId = table.getStoreId();
+            if (couponStoreId == null || tableStoreId == null
+                    || !couponStoreId.equals(String.valueOf(tableStoreId))) {
                 throw new RuntimeException("优惠券不属于该门店");
             }
 

+ 10 - 5
alien-store/src/main/java/shop/alien/store/controller/AiTagsController.java

@@ -86,13 +86,18 @@ public class AiTagsController {
                 // 4. 解析响应体(根据外部接口返回格式调整)
                 String responseBody = exchange.getBody();
                 JSONObject jsonObject = JSONObject.parseObject(responseBody);
-                JSONArray jsonArray = jsonObject.getJSONObject("data").getJSONArray("list");
-                if(jsonArray.isEmpty()){
+                if(null != jsonObject) {
+                    JSONArray jsonArray = jsonObject.getJSONObject("data").getJSONArray("list");
+
+                    if (jsonArray.isEmpty()) {
+                        return R.data(new ArrayList<>());
+                    }
+                    String negativeComment = jsonArray.getJSONObject(0).getString("negative_comment");
+                    // 这里简单返回原始字符串(根据实际情况调整)
+                    return R.data(parseComment(negativeComment));
+                } else {
                     return R.data(new ArrayList<>());
                 }
-                String negativeComment = jsonArray.getJSONObject(0).getString("negative_comment");
-                // 这里简单返回原始字符串(根据实际情况调整)
-                return R.data(parseComment(negativeComment));
             } else {
                 return R.fail("获取店铺标签失败:" + exchange.getStatusCode());
             }

+ 118 - 2
alien-store/src/main/java/shop/alien/store/controller/StoreInfoController.java

@@ -26,8 +26,9 @@ import shop.alien.entity.storePlatform.StoreLicenseHistory;
 import shop.alien.mapper.*;
 import shop.alien.mapper.storePlantform.StoreLicenseHistoryMapper;
 import shop.alien.store.config.BaseRedisService;
-import shop.alien.store.service.StoreInfoService;
-import shop.alien.store.service.StoreQualificationService;
+import shop.alien.store.service.*;
+import shop.alien.entity.store.StoreCuisine;
+import shop.alien.entity.store.StorePrice;
 import shop.alien.entity.store.UserLoginInfo;
 import shop.alien.util.common.TokenInfo;
 import springfox.documentation.annotations.ApiIgnore;
@@ -75,6 +76,12 @@ public class StoreInfoController {
     private final StoreUserMapper storeUserMapper;
     private final LifeFansMapper lifeFansMapper;
 
+    private final StoreCuisineService storeCuisineService;
+    private final StorePriceService storePriceService;
+    private final StoreStaffConfigService storeStaffConfigService;
+    private final PerformanceListService performanceListService;
+    private final SportsEquipmentFacilityService sportsEquipmentFacilityService;
+
     @ApiOperation("获取所有门店")
     @ApiOperationSupport(order = 1)
     @GetMapping("/getAll")
@@ -1806,6 +1813,115 @@ public class StoreInfoController {
     }
     
     /**
+     * 根据经营板块返回店铺详情页可展示的标签(仅当对应接口有数据时才展示)
+     * <p>
+     * 美食:价目表、人员;
+     * 休闲娱乐:价目表、人员、演出;
+     * 生活服务:价目表、设施、教练、人员。
+     * 每个标签会调用对应数据接口判断是否有数据,无数据则不返回该标签。
+     * </p>
+     *
+     * @param storeId         门店 ID
+     * @param businessSection 经营板块:传 dictId 或名称。1/美食、2/休闲娱乐、3/生活服务
+     * @return 有数据的标签列表,每项包含标签名和对应接口路径
+     */
+    @ApiOperation("根据经营板块获取店铺详情页展示标签(仅展示有数据的标签)")
+    @ApiOperationSupport(order = 100)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "storeId", value = "门店ID", dataType = "Integer", paramType = "query", required = true),
+            @ApiImplicitParam(name = "businessSection", value = "经营板块:1或美食、2或休闲娱乐、3或生活服务", dataType = "String", paramType = "query", required = true)
+    })
+    @GetMapping("/getStoreSectionTags")
+    public R<Map<String, Boolean>> getStoreSectionTags(
+            @RequestParam Integer storeId,
+            @RequestParam String businessSection) {
+        log.info("StoreInfoController.getStoreSectionTags?storeId={}, businessSection={}", storeId, businessSection);
+        if (storeId == null) {
+            return R.fail("门店ID不能为空");
+        }
+        if (StringUtils.isBlank(businessSection)) {
+            return R.fail("经营板块不能为空");
+        }
+        String section = businessSection.trim();
+        boolean isFood = "3".equals(section) || "美食".equals(section);
+        boolean isLeisure = "2".equals(section) || "休闲娱乐".equals(section);
+        boolean isLifeService = "1".equals(section) || "生活服务".equals(section);
+        if (!isFood && !isLeisure && !isLifeService) {
+            return R.fail("未知的经营板块: " + businessSection);
+        }
+        Map<String, Boolean> tags = buildSectionTagsByData(storeId, isFood, isLeisure, isLifeService);
+        return R.data(tags);
+    }
+
+    /**
+     * 根据实际数据判断各标签是否有数据,返回 Map(key 为标签名,value 有数据 true / 无数据 false)
+     */
+    private Map<String, Boolean> buildSectionTagsByData(Integer storeId, boolean isFood, boolean isLeisure, boolean isLifeService) {
+        Map<String, Boolean> map = new HashMap<>(8);
+
+        map.put("showPriceCard", hasPriceListData(storeId));
+        map.put("showStaffCard", hasStaffData(storeId));
+
+        if (isLeisure) {
+            map.put("showPerformance", hasPerformanceData(storeId));
+        }
+        if (isLifeService) {
+            map.put("showFacilityServiceCard", hasFacilityData(storeId));
+        }
+
+        return map;
+    }
+
+    /** 价目表是否有数据:美食价目或通用价目存在且已上架 */
+    private boolean hasPriceListData(Integer storeId) {
+        long cuisineCount = storeCuisineService.count(
+                new LambdaQueryWrapper<StoreCuisine>()
+                        .eq(StoreCuisine::getStoreId, storeId)
+                        .eq(StoreCuisine::getShelfStatus, 1));
+        if (cuisineCount > 0) {
+            return true;
+        }
+        return storePriceService.count(
+                new LambdaQueryWrapper<StorePrice>()
+                        .eq(StorePrice::getStoreId, storeId)
+                        .eq(StorePrice::getShelfStatus, 1)) > 0;
+    }
+
+    /** 人员是否有数据:按标题分组的员工列表非空 */
+    private boolean hasStaffData(Integer storeId) {
+        try {
+            List<StaffTitleGroupVo> groups = storeStaffConfigService.queryStaffListByTitle(storeId);
+            return CollectionUtils.isNotEmpty(groups);
+        } catch (Exception e) {
+            log.warn("查询人员数据异常 storeId={}, {}", storeId, e.getMessage());
+            return false;
+        }
+    }
+
+    /** 演出是否有数据:演出列表接口有记录 */
+    private boolean hasPerformanceData(Integer storeId) {
+        try {
+            IPage<PerformanceListVo> page = performanceListService.queryPerformanceList(1, 1, storeId);
+            return page != null && page.getTotal() > 0;
+        } catch (Exception e) {
+            log.warn("查询演出数据异常 storeId={}, {}", storeId, e.getMessage());
+            return false;
+        }
+    }
+
+    /** 设施是否有数据:运动器材设施分类汇总有数据 */
+    private boolean hasFacilityData(Integer storeId) {
+        try {
+            List<SportsEquipmentFacilityCategorySummaryVo> list = sportsEquipmentFacilityService.getCategorySummary(storeId);
+            return CollectionUtils.isNotEmpty(list);
+        } catch (Exception e) {
+            log.warn("查询设施数据异常 storeId={}, {}", storeId, e.getMessage());
+            return false;
+        }
+    }
+
+
+    /**
      * 店铺信息(包含商户头像)
      */
     @Data

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

@@ -1403,6 +1403,20 @@ public class SportsEquipmentFacilityServiceImpl extends ServiceImpl<SportsEquipm
                             .collect(Collectors.toList());
                 }
             }
+            // 若仍无图片,尝试按区域ID查询(部分数据以 area_id 作为 business_id 存储)
+            if (imageList.isEmpty() && facility.getAreaId() != null && facility.getAreaId() > 0) {
+                LambdaQueryWrapper<StoreImg> imageWrapperByArea = new LambdaQueryWrapper<>();
+                imageWrapperByArea.eq(StoreImg::getStoreId, facility.getStoreId())
+                        .eq(StoreImg::getBusinessId, facility.getAreaId())
+                        .eq(StoreImg::getImgType, IMG_TYPE_SPORTS_EQUIPMENT)
+                        .orderByAsc(StoreImg::getImgSort);
+                List<StoreImg> imageListByArea = storeImgMapper.selectList(imageWrapperByArea);
+                if (!CollectionUtils.isEmpty(imageListByArea)) {
+                    imageList = imageListByArea.stream().map(StoreImg::getImgUrl)
+                            .collect(Collectors.toList());
+                    log.debug("详情图片从区域维度补齐,facilityId={},areaId={},数量={}", facility.getId(), facility.getAreaId(), imageList.size());
+                }
+            }
         }
         vo.setImageList(imageList);