fix(设备实名): 无当前卡时按绑定卡实名回退并初始化单槽当前卡
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Failing after 6m26s

- 设备资产解析外层 real_name_status:存在当前使用卡时沿用该卡状态,无任何当前卡时任一有效绑定卡已实名即视为已实名
- 手工绑定与设备导入:设备最大槽位为 1 且有效绑定唯一时,在同一事务内将该绑定初始化为当前使用卡;多卡设备不推断
- 同步 asset-device、personal-customer 主 Spec;归档变更并附存量核对清单(75 条单槽唯一待修复绑定,其中 16 条已实名)
This commit is contained in:
2026-09-18 17:48:17 +08:00
parent 30c6e5bb78
commit 1f2fe4a61a
12 changed files with 465 additions and 3 deletions

View File

@@ -241,13 +241,23 @@ func (s *Service) buildDeviceResolveResponse(ctx context.Context, device *model.
})
}
// RealNameStatus 以当前使用卡为准;无当前卡视为实名
// RealNameStatus 以当前使用卡为准;无当前卡时,任一有效绑定卡已实名即视为实名
hasCurrentCard := false
for _, c := range cards {
if isCurrentMap[c.ID] {
resp.RealNameStatus = c.RealNameStatus
hasCurrentCard = true
break
}
}
if !hasCurrentCard {
for _, c := range cards {
if c.RealNameStatus == constants.RealNameStatusVerified {
resp.RealNameStatus = constants.RealNameStatusVerified
break
}
}
}
// RealNameAt 取所有绑定卡中最早的实名时间
for _, c := range cards {
if c.FirstRealnameAt == nil {