From 4189dbe98f2e1e2ebd1e91cb26016de14b929a58 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 27 Feb 2026 09:36:48 +0800 Subject: [PATCH] =?UTF-8?q?debug:=20=E6=B7=BB=E5=8A=A0=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E5=9B=9E=E6=94=B6=E5=BA=97=E9=93=BA=E6=9F=A5=E8=AF=A2=E7=9A=84?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 RecallCards 方法中添加日志,用于诊断平台账号回收资产失败的问题: - 记录操作者店铺ID - 记录请求查询的店铺IDs - 记录实际查询到的店铺数量和IDs - 记录直属下级店铺集合 Co-Authored-By: Claude Sonnet 4.5 --- internal/service/iot_card/service.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/internal/service/iot_card/service.go b/internal/service/iot_card/service.go index 4e3f9b2..7ae9250 100644 --- a/internal/service/iot_card/service.go +++ b/internal/service/iot_card/service.go @@ -419,11 +419,26 @@ func (s *Service) RecallCards(ctx context.Context, req *dto.RecallStandaloneCard if err != nil { return nil, err } + // 调试日志:记录查询结果 + s.logger.Info("批量查询店铺结果", + zap.Any("operator_shop_id", operatorShopID), + zap.Uints("requested_shop_ids", shopIDs), + zap.Int("returned_shops_count", len(shops)), + zap.Uints("returned_shop_ids", func() []uint { + ids := make([]uint, len(shops)) + for i, shop := range shops { + ids[i] = shop.ID + } + return ids + }())) for _, shop := range shops { if s.isDirectSubordinate(operatorShopID, shop) { directSubordinateSet[shop.ID] = true } } + // 调试日志:记录直属下级集合 + s.logger.Info("直属下级店铺集合", + zap.Any("direct_subordinate_set", directSubordinateSet)) } // 4. 检查绑定设备的卡