sync: 同步 v1.0.4 开源代码并脱敏

This commit is contained in:
MiFaZhan
2026-10-29 14:52:43 +08:00
parent 32e4316ee4
commit 6893e21f07
136 changed files with 9851 additions and 436 deletions
@@ -23,7 +23,7 @@ const (
resultFileStatusSuccess = "success"
resultFileStatusFailed = "failed"
validationFailureReason = "batch validation failed; traffic cutoff update skipped"
validationFailureReason = "批次校验未通过,已跳过流量断网更新"
)
type Repository struct {
@@ -338,7 +338,7 @@ func (r *Repository) lockCards(ctx context.Context, tx gdb.TX, tenantID string,
func validateLockedTask(task *trafficcutoff.Task) bool {
if task == nil || len(task.Details) == 0 {
if task != nil {
task.FailureReason = "traffic cutoff batch has no valid details"
task.FailureReason = "流量断网批次无有效明细"
}
return false
}
@@ -360,15 +360,15 @@ func validateLockedTask(task *trafficcutoff.Task) bool {
}
detail.Reason = ""
if detail.Card == nil {
detail.Reason = "ICCID does not exist in SIM card records"
detail.Reason = "ICCID不存在或不属于当前租户"
} else if !detail.Authorized {
detail.Reason = "ICCID is outside the current operator authorization scope"
detail.Reason = "ICCID不在当前操作员授权范围内"
} else if detail.InputMSISDN != "" && detail.InputMSISDN != detail.Card.MSISDN {
detail.Reason = "MSISDN does not match the SIM card record"
detail.Reason = "MSISDN与卡档案不一致"
} else if detail.InputIMSI != "" && detail.InputIMSI != detail.Card.IMSI {
detail.Reason = "IMSI does not match the SIM card record"
detail.Reason = "IMSI与卡档案不一致"
} else if detail.Card.BossCardStatus == trafficcutoff.BossCardStatusCanceled {
detail.Reason = "ICCID is already canceled"
detail.Reason = "ICCID已销户"
}
if detail.Reason != "" {
hasFailure = true
@@ -379,7 +379,7 @@ func validateLockedTask(task *trafficcutoff.Task) bool {
if len(statusSet) > 1 {
for _, detail := range task.Details {
if detail != nil && detail.Reason == "" {
detail.Reason = "same batch contains different card statuses"
detail.Reason = "同一批次内卡状态不一致"
}
}
hasFailure = true
@@ -390,7 +390,7 @@ func validateLockedTask(task *trafficcutoff.Task) bool {
}
for _, detail := range task.Details {
if detail != nil && detail.Reason == "" {
detail.Reason = "same batch has invalid traffic cutoff rows; update skipped"
detail.Reason = "同一批次存在无效流量断网明细,已跳过更新"
}
}
task.FailureReason = validationFailureReason