sync: 同步 v1.0.4 并脱敏配置与镜像
This commit is contained in:
@@ -0,0 +1,115 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// 卡基础信息查询 / 月历史用量查询 共用的输入模式。
|
||||
const (
|
||||
SimCardQueryModeExcel = "excel" // Excel 模板导入
|
||||
SimCardQueryModeInput = "input" // 多行文本批量输入
|
||||
SimCardQueryModeRange = "range" // 连号(起止号段)
|
||||
SimCardQueryModeDept = "dept" // 按所属公司查询(仅月历史用量查询支持)
|
||||
)
|
||||
|
||||
// 单次查询的号码条数上限。
|
||||
//
|
||||
// 取值依据:
|
||||
// - 与现有批量卡操作上限 20000 保持一致,避免用户对「批量」能力的容量认知分裂;
|
||||
// - t_export_task.query_params 是 JSON 列,20000 条号码快照约 1MB,仍在可控范围;
|
||||
// - 20000 行 xlsx 约 3~5MB,导出中心单任务 10 分钟超时内可以写完。
|
||||
const SimCardQueryMaxRows = 20000
|
||||
|
||||
// SimCardQueryExportParam 卡基础信息查询导出参数。
|
||||
// Excel 模式用 File,批量输入用 BatchInput,连号模式用 Dimension/StartNum/EndNum。
|
||||
type SimCardQueryExportParam struct {
|
||||
Mode string `json:"mode" dc:"输入方式 excel/input/range"`
|
||||
BatchInput string `json:"batchInput" dc:"批量输入内容,每行 ICCID 或 ICCID MSISDN IMSI"`
|
||||
Dimension string `json:"dimension" dc:"连号维度 iccid/msisdn/imsi"`
|
||||
StartNum string `json:"startNum" dc:"起始号段"`
|
||||
EndNum string `json:"endNum" dc:"结束号段"`
|
||||
Iccid string `json:"iccid" dc:"仅按 ICCID 精确查询"`
|
||||
ExportColumnsJson string `json:"exportColumnsJson" dc:"导出列(JSON字符串)"`
|
||||
ExportColumns []ExportColumn `json:"exportColumns" dc:"导出列"`
|
||||
}
|
||||
|
||||
// SimCardUsageHistoryExportParam 月历史用量查询导出参数。
|
||||
// 在卡基础信息查询的基础上增加「按所属公司」模式。
|
||||
type SimCardUsageHistoryExportParam struct {
|
||||
SimCardQueryExportParam
|
||||
DeptId int64 `json:"deptId" dc:"所属公司部门ID,mode=dept 时必填"`
|
||||
// 到期日期区间,仅 dept 模式生效;为空表示不限。
|
||||
ExpireStartTime string `json:"expireStartTime" dc:"到期日期起(含)"`
|
||||
ExpireEndTime string `json:"expireEndTime" dc:"到期日期止(含)"`
|
||||
}
|
||||
|
||||
// SimCardQuerySubmitRes 提交导出后的回执。
|
||||
// 文件不在本次响应里返回,用户到「下载中心」下载;执行日志里看汇总结果。
|
||||
type SimCardQuerySubmitRes struct {
|
||||
TaskId int64 `json:"taskId" dc:"任务ID"`
|
||||
TaskNo string `json:"taskNo" dc:"任务编号"`
|
||||
Total int `json:"total" dc:"预计导出行数"`
|
||||
}
|
||||
|
||||
// SimCardQueryResolveResult 输入解析结果。
|
||||
// Rows 为按输入顺序展开的待导出行,未命中的行同样保留,用于在文件里写明失败原因。
|
||||
type SimCardQueryResolveResult struct {
|
||||
Rows []*SimCardBaseQueryRow
|
||||
HitCount int
|
||||
MissCount int
|
||||
// Summaries 输入侧的错误(如某行格式错误),按行记录,最终汇总进执行日志。
|
||||
Summaries []string
|
||||
}
|
||||
|
||||
// SimCardBaseQueryRow 卡基础信息查询的导出行。
|
||||
// 字段顺序即无列清单时的默认导出顺序;Field 名与前端列配置的 field 一一对应。
|
||||
type SimCardBaseQueryRow struct {
|
||||
Iccid string `json:"iccid" dc:"ICCID"`
|
||||
Msisdn string `json:"msisdn" dc:"MSISDN"`
|
||||
Imsi string `json:"imsi" dc:"IMSI"`
|
||||
Imei string `json:"imei" dc:"IMEI"`
|
||||
UsedFlowMb float64 `json:"usedFlowMb" dc:"当月用量(MB)"`
|
||||
RemainFlowMb float64 `json:"remainFlowMb" dc:"当月剩余用量(MB)"`
|
||||
PackageTotalMb float64 `json:"packageTotalMb" dc:"套餐总流量(MB)"`
|
||||
CardStatus int `json:"cardStatus" dc:"卡状态"`
|
||||
NetModel int `json:"netModel" dc:"网络类型"`
|
||||
Operators string `json:"operators" dc:"运营商"`
|
||||
ActivateAt *gtime.Time `json:"activateAt" dc:"激活时间"`
|
||||
OutStockTime *gtime.Time `json:"outStockTime" dc:"出库时间"`
|
||||
ExpireAt *gtime.Time `json:"expireAt" dc:"到期时间"`
|
||||
OutboundBatch string `json:"outboundBatch" dc:"出库批次"`
|
||||
InboundBatch string `json:"inboundBatch" dc:"入库批次"`
|
||||
PackageName string `json:"packageName" dc:"当前套餐名称"`
|
||||
DeptName string `json:"deptName" dc:"所属企业"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
ExtraRemark string `json:"extraRemark" dc:"其他备注"`
|
||||
// QueryResult / FailReason 固定在文件末尾两列,保证「部分成功」时失败原因可追溯到具体输入。
|
||||
QueryResult string `json:"queryResult" dc:"查询结果"`
|
||||
FailReason string `json:"failReason" dc:"失败原因"`
|
||||
}
|
||||
|
||||
// SimCardUsageHistoryRow 月历史用量查询的导出行。
|
||||
// 近 12 个月的用量按月份动态列展开,MonthValues 与请求里的月份顺序一致。
|
||||
type SimCardUsageHistoryRow struct {
|
||||
Iccid string `json:"iccid" dc:"ICCID"`
|
||||
Msisdn string `json:"msisdn" dc:"MSISDN"`
|
||||
Imsi string `json:"imsi" dc:"IMSI"`
|
||||
OutStockTime *gtime.Time `json:"outStockTime" dc:"出库时间"`
|
||||
ExpireAt *gtime.Time `json:"expireAt" dc:"到期时间"`
|
||||
// MonthValues 由调用方按月份顺序拼成 "2026-09" 这样的键,导出时逐列取值。
|
||||
// 键不存在表示「查询成功但该月没有流量记录」,导出为 "-"。
|
||||
MonthValues map[string]float64 `json:"monthValues" dc:"近12个月用量(MB)"`
|
||||
// UsageQueryFailed 该卡的流量数据整体查询失败(服务抖动),导出时月份列写「查询失败」,
|
||||
// 与「无记录(-)」「零用量(0)」区分开,避免客户误解。
|
||||
UsageQueryFailed bool `json:"usageQueryFailed" dc:"流量数据是否查询失败"`
|
||||
QueryResult string `json:"queryResult" dc:"查询结果"`
|
||||
FailReason string `json:"failReason" dc:"失败原因"`
|
||||
}
|
||||
|
||||
// SimCardQueryDeptOption 所属公司下拉项。
|
||||
type SimCardQueryDeptOption struct {
|
||||
DeptId int64 `json:"deptId" dc:"部门ID"`
|
||||
DeptName string `json:"deptName" dc:"公司名称"`
|
||||
CardCount int64 `json:"cardCount" dc:"名下卡数量"`
|
||||
ParentId int64 `json:"parentId" dc:"上级部门ID"`
|
||||
}
|
||||
Reference in New Issue
Block a user