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
+13 -13
View File
@@ -11,14 +11,14 @@ import (
)
const (
cascadeFailureReason = "same batch has invalid traffic cutoff rows; update skipped"
validationSkipReason = "batch validation failed; traffic cutoff update skipped"
emptyICCIDReason = "ICCID cannot be empty"
duplicateICCIDReason = "duplicate ICCID in batch"
unauthorizedReason = "ICCID is outside the current operator authorization scope"
cardMissingReason = "ICCID does not exist in SIM card records"
statusCanceledReason = "ICCID is already canceled"
statusInconsistentReason = "same batch contains different card statuses"
cascadeFailureReason = "同一批次存在无效流量断网明细,已跳过更新"
validationSkipReason = "批次校验未通过,已跳过流量断网更新"
emptyICCIDReason = "ICCID不能为空"
duplicateICCIDReason = "ICCID在批次内重复"
unauthorizedReason = "ICCID不在当前操作员授权范围内"
cardMissingReason = "ICCID不存在或不属于当前租户"
statusCanceledReason = "ICCID已销户"
statusInconsistentReason = "同一批次内卡状态不一致"
)
type executor struct {
@@ -63,17 +63,17 @@ func (e *executor) saveResultFile(ctx context.Context, task *Task) {
func validateTask(task *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
}
if task.TrafficCutoffStatus != 1 {
task.FailureReason = "traffic cutoff batch must enable cutoff"
task.FailureReason = "流量断网批次必须开启断网"
markAllFailed(task, task.FailureReason)
return false
}
if task.TrafficCutoffThreshold <= 0 {
task.FailureReason = "traffic cutoff threshold must be greater than 0"
task.FailureReason = "流量断网阈值必须大于0"
markAllFailed(task, task.FailureReason)
return false
}
@@ -150,11 +150,11 @@ func validateDetail(detail *Detail) {
detail.TrafficCutoffThresholdBefore = detail.Card.TrafficCutoffThreshold
if detail.InputMSISDN != "" && detail.InputMSISDN != detail.MSISDN {
detail.Reason = "MSISDN does not match the SIM card record"
detail.Reason = "MSISDN与卡档案不一致"
return
}
if detail.InputIMSI != "" && detail.InputIMSI != detail.IMSI {
detail.Reason = "IMSI does not match the SIM card record"
detail.Reason = "IMSI与卡档案不一致"
return
}
if detail.BossCardStatusBefore == BossCardStatusCanceled {
@@ -128,7 +128,7 @@ func TestExecuteCommitFailurePropagatesAndSkipsResult(t *testing.T) {
func validTask() *Task {
return &Task{
Batch: Batch{BatchNo: "DCT-1", BatchType: 107, TenantID: "000000"},
TrafficCutoffStatus: 1,
TrafficCutoffStatus: 1,
TrafficCutoffThreshold: 1024.5,
ThresholdUnit: "MB",
Details: []*Detail{