fix: 单卡导入虚拟号改为可选,非空时保证全局唯一
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m26s

This commit is contained in:
2026-04-08 10:45:23 +08:00
parent 38ef73fd7f
commit 14a8ea5a2c
5 changed files with 35 additions and 31 deletions

View File

@@ -7,8 +7,6 @@ import (
"strings"
"github.com/xuri/excelize/v2"
pkgerrors "github.com/break/junhong_cmp_fiber/pkg/errors"
)
// CardInfo 卡信息(ICCID + MSISDN + VirtualNo)
@@ -228,10 +226,6 @@ func parseCardRows(rows [][]string) (*CSVParseResult, error) {
}
}
if virtualNoCol == -1 {
return nil, pkgerrors.New(pkgerrors.CodeInvalidParam, "Excel 文件缺少 virtual_no 列,请使用最新模板")
}
startLine := 0
if headerSkipped {
startLine = 1
@@ -292,16 +286,6 @@ func parseCardRows(rows [][]string) (*CSVParseResult, error) {
continue
}
if virtualNo == "" {
result.ParseErrors = append(result.ParseErrors, CSVParseError{
Line: lineNum,
ICCID: iccid,
MSISDN: msisdn,
Reason: "虚拟号(virtual_no)不能为空",
})
continue
}
result.Cards = append(result.Cards, CardInfo{
ICCID: iccid,
MSISDN: msisdn,