fix: 第1批 M2、M3、M16、M23 导入与展示类缺陷
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Failing after 8h37m36s
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Failing after 8h37m36s
- M2 批量换绑表头改为“平台登录账号”,只认手机号,细分格式、不存在、多匹配、非平台、已禁用失败原因 - M3 后台订单列表与详情返回 C 端在线购买的交易流水号、支付渠道、商户名称,详情新增全部支付单 payments - M16 预警规则不再返回 real_data_mb,预警列表/详情新增 threshold_mb,导出末列追加“阈值流量(MB)” - M23 设备导入 IMEI 必填,空 IMEI 行记为失败 - OpenSpec Change fix-august-iteration-follow-up-gaps:13/18,导入任务、导出任务的 Worker 端到端验证与前端/运营通知待部署后完成
This commit is contained in:
@@ -56,9 +56,18 @@ func (s *PackageTrafficAlertDataSource) Headers(context.Context, ExportParams) (
|
||||
"资产类型", "资产标识", "对应标识符", "卡标识", "设备类型", "设备型号",
|
||||
"套餐名称", "真流量已用量(MB)", "真流量额度(MB)", "比例(%)", "阈值快照(%)",
|
||||
"到期时间", "剩余天数", "触发时间", "店铺", "业务员", "用户组", "通知投递结果",
|
||||
packageTrafficAlertThresholdMBHeader,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// packageTrafficAlertThresholdMBHeader 阈值对应流量列,固定追加在最后一列;历史任务冻结表头没有该列。
|
||||
const packageTrafficAlertThresholdMBHeader = "阈值流量(MB)"
|
||||
|
||||
// alertHeadersIncludeThresholdMB 判断冻结表头是否为带“阈值流量(MB)”末列的新表头。
|
||||
func alertHeadersIncludeThresholdMB(headers []string) bool {
|
||||
return len(headers) == 0 || headers[len(headers)-1] == packageTrafficAlertThresholdMBHeader
|
||||
}
|
||||
|
||||
// Fetch 按 offset/limit 查询预警导出数据。
|
||||
func (s *PackageTrafficAlertDataSource) Fetch(ctx context.Context, params ExportParams, offset, limit int) ([][]string, error) {
|
||||
if limit <= 0 {
|
||||
@@ -109,9 +118,10 @@ func (s *PackageTrafficAlertDataSource) Fetch(ctx context.Context, params Export
|
||||
return nil, err
|
||||
}
|
||||
now := time.Now().UTC()
|
||||
includeThresholdMB := alertHeadersIncludeThresholdMB(params.ResolvedHeaders)
|
||||
rows := make([][]string, 0, len(items))
|
||||
for _, item := range items {
|
||||
rows = append(rows, []string{
|
||||
row := []string{
|
||||
assetTypeName(item.AssetType),
|
||||
item.AssetIdentifier,
|
||||
item.CounterpartIdentifier,
|
||||
@@ -130,7 +140,11 @@ func (s *PackageTrafficAlertDataSource) Fetch(ctx context.Context, params Export
|
||||
item.CurrentOwnerName,
|
||||
currentOwnerGroupName(groupNames, item.CurrentOwnerID),
|
||||
constants.GetPackageTrafficAlertNotifyStatusName(resolveAlertNotifyStatus(item)),
|
||||
})
|
||||
}
|
||||
if includeThresholdMB {
|
||||
row = append(row, strconv.FormatFloat(packagetrafficalert.ThresholdMB(item.LimitMB, item.ThresholdPercent), 'f', 2, 64))
|
||||
}
|
||||
rows = append(rows, row)
|
||||
}
|
||||
return rows, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user