fix(设备实名): 无当前卡时按绑定卡实名回退并初始化单槽当前卡
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 14m42s

- 设备资产解析外层 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 d24e777a4c
commit 54c4ec7ba4
12 changed files with 465 additions and 4 deletions

View File

@@ -372,6 +372,8 @@ func (h *DeviceImportHandler) processBatch(ctx context.Context, task *model.Devi
now := time.Now()
validCardIDs := make([]uint, 0, len(validCards))
// 单槽设备导入后有效绑定唯一,当前使用卡只能是该卡
initializeCurrentCard := device.MaxSimSlots == 1 && len(validCards) == 1
for _, slotICCID := range validCards {
cardID := existingCards[slotICCID.ICCID].ID
validCardIDs = append(validCardIDs, cardID)
@@ -382,6 +384,7 @@ func (h *DeviceImportHandler) processBatch(ctx context.Context, task *model.Devi
SlotPosition: slotICCID.SlotPosition,
BindStatus: 1,
BindTime: &now,
IsCurrent: initializeCurrentCard,
}
if err := txBindingStore.Create(ctx, binding); err != nil {
return err