设备导出
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m33s

This commit is contained in:
Break
2026-06-15 17:29:36 +08:00
parent 064961471b
commit 6c8594633a

View File

@@ -275,7 +275,7 @@ func (s *DeviceDataSource) fetchBoundCards(ctx context.Context, deviceIDs []uint
c.msisdn, c.msisdn,
c.carrier_name, c.carrier_name,
c.current_month_usage_mb, c.current_month_usage_mb,
c.status c.network_status
`). `).
Joins("JOIN tb_iot_card AS c ON c.id = b.iot_card_id AND c.deleted_at IS NULL"). Joins("JOIN tb_iot_card AS c ON c.id = b.iot_card_id AND c.deleted_at IS NULL").
Where("b.device_id IN ?", deviceIDs). Where("b.device_id IN ?", deviceIDs).
@@ -344,7 +344,7 @@ type deviceExportCardRow struct {
MSISDN string `gorm:"column:msisdn"` MSISDN string `gorm:"column:msisdn"`
CarrierName string `gorm:"column:carrier_name"` CarrierName string `gorm:"column:carrier_name"`
CurrentMonthUsageMB float64 `gorm:"column:current_month_usage_mb"` CurrentMonthUsageMB float64 `gorm:"column:current_month_usage_mb"`
Status int `gorm:"column:status"` NetworkStatus int `gorm:"column:network_status"`
} }
type deviceExportPackageRow struct { type deviceExportPackageRow struct {
@@ -406,7 +406,7 @@ func buildDeviceExportRow(item deviceExportRow, cards []deviceExportCardRow, pkg
card.MSISDN, card.MSISDN,
card.CarrierName, card.CarrierName,
formatMB(card.CurrentMonthUsageMB), formatMB(card.CurrentMonthUsageMB),
constants.GetIotCardStatusName(card.Status), constants.GetNetworkStatusName(card.NetworkStatus),
) )
} }
// 如果表头列数被历史任务固定得比当前绑定卡少,仍保证合计覆盖当前查到的全部卡。 // 如果表头列数被历史任务固定得比当前绑定卡少,仍保证合计覆盖当前查到的全部卡。