129 lines
5.8 KiB
Go
129 lines
5.8 KiB
Go
package model
|
|
|
|
import (
|
|
"electricity_bill_calc/types"
|
|
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type MeterDetail struct {
|
|
Code string `json:"code" db:"code"`
|
|
Park string `json:"parkId" db:"park_id"`
|
|
Address *string `json:"address" db:"address"`
|
|
MeterType int16 `json:"type" db:"meter_type"`
|
|
Building *string `json:"building" db:"building"`
|
|
BuildingName *string `json:"buildingName" db:"building_name"`
|
|
OnFloor *string `json:"onFloor" db:"on_floor" `
|
|
Area decimal.NullDecimal `json:"area" db:"area"`
|
|
Ratio decimal.Decimal `json:"ratio" db:"ratio"`
|
|
Seq int64 `json:"seq" db:"seq"`
|
|
Enabled bool `json:"enabled" db:"enabled"`
|
|
AttachedAt *types.DateTime `json:"attachedAt" db:"attached_at"`
|
|
DetachedAt *types.DateTime `json:"detachedAt" db:"detached_at"`
|
|
CreatedAt types.DateTime `json:"createdAt" db:"created_at"`
|
|
LastModifiedAt types.DateTime `json:"lastModifiedAt" db:"last_modified_at"`
|
|
DisplayRatio float64 `json:"display_ratio" db:"display_ratio"`
|
|
}
|
|
|
|
type MeterRelation struct {
|
|
Id string `json:"id"`
|
|
Park string `json:"parkId" db:"park_id"`
|
|
MasterMeter string `json:"masterMeterId" db:"master_meter_id"`
|
|
SlaveMeter string `json:"slaveMeterId" db:"slave_meter_id"`
|
|
EstablishedAt types.DateTime `json:"establishedAt"`
|
|
SuspendedAt *types.DateTime `json:"suspendedAt"`
|
|
RevokedAt *types.DateTime `json:"revokedAt"`
|
|
}
|
|
|
|
type MeterSynchronization struct {
|
|
Park string `json:"parkId" db:"park_id"`
|
|
Meter string `json:"meterId" db:"meter_id"`
|
|
ForeignMeter string `json:"foreignMeter"`
|
|
SystemType string `json:"systemType"`
|
|
SystemIdentity string `json:"systemIdentity"`
|
|
Enabled bool `json:"enabled"`
|
|
LastSynchronizedAt types.DateTime `json:"lastSynchronizedAt" db:"last_synchronized_at"`
|
|
RevokeAt *types.DateTime `json:"revokeAt" db:"revoke_at"`
|
|
}
|
|
|
|
type SimpleMeterDocument struct {
|
|
Code string `json:"code"`
|
|
Seq int64 `json:"seq"`
|
|
Address *string `json:"address"`
|
|
Ratio decimal.Decimal `json:"ratio"`
|
|
TenementName *string `json:"tenementName"`
|
|
}
|
|
|
|
type NestedMeter struct {
|
|
MeterId string `json:"meterId"`
|
|
MeterDetail MeterDetail `json:"meterDetail"`
|
|
LastTermReadings Reading `json:"lastTermReadings"`
|
|
CurrentTermReadings Reading `json:"currentTermReadings"`
|
|
Overall ConsumptionUnit `json:"overall"`
|
|
Critical ConsumptionUnit `json:"critical"`
|
|
Peak ConsumptionUnit `json:"peak"`
|
|
Flat ConsumptionUnit `json:"flat"`
|
|
Valley ConsumptionUnit `json:"valley"`
|
|
BasicPooled decimal.Decimal `json:"basicPooled"`
|
|
AdjustPooled decimal.Decimal `json:"adjustPooled"`
|
|
LossPooled decimal.Decimal `json:"lossPooled"`
|
|
PublicPooled decimal.Decimal `json:"publicPooled"`
|
|
FinalTotal decimal.Decimal `json:"finalTotal"`
|
|
Area decimal.Decimal `json:"area"`
|
|
Proportion decimal.Decimal `json:"proportion"`
|
|
}
|
|
|
|
type PooledMeterDetailCompound struct {
|
|
MeterDetail
|
|
BindMeters []MeterDetail `json:"bindedMeters"`
|
|
}
|
|
|
|
// 以下结构体用于导入表计档案数据
|
|
type MeterImportRow struct {
|
|
Code string `json:"code" excel:"code"`
|
|
Address *string `json:"address" excel:"address"`
|
|
MeterType *string `json:"meterType" excel:"meterType"`
|
|
Building *string `json:"building" excel:"building"`
|
|
OnFloor *string `json:"onFloor" excel:"onFloor"`
|
|
Area decimal.NullDecimal `json:"area" excel:"area"`
|
|
Ratio decimal.Decimal `json:"ratio" excel:"ratio"`
|
|
Seq int64 `json:"seq" excel:"seq"`
|
|
ReadAt types.DateTime `json:"readAt" excel:"readAt"`
|
|
Overall decimal.Decimal `json:"overall" excel:"overall"`
|
|
Critical decimal.NullDecimal `json:"critical" excel:"critical"`
|
|
Peak decimal.NullDecimal `json:"peak" excel:"peak"`
|
|
Flat decimal.NullDecimal `json:"flat" excel:"flat"`
|
|
Valley decimal.NullDecimal `json:"valley" excel:"valley"`
|
|
}
|
|
|
|
// 以下结构体用于导入表计抄表数据
|
|
type ReadingImportRow struct {
|
|
Code string `json:"code" excel:"code"`
|
|
ReadAt types.DateTime `json:"readAt" excel:"readAt"`
|
|
Overall decimal.Decimal `json:"overall" excel:"overall"`
|
|
Critical decimal.NullDecimal `json:"critical" excel:"critical"`
|
|
Peak decimal.NullDecimal `json:"peak" excel:"peak"`
|
|
Valley decimal.NullDecimal `json:"valley" excel:"valley"`
|
|
}
|
|
|
|
type ReadAbleMeter struct {
|
|
CreatedAt types.DateTime `json:"createdAt" db:"created_at"`
|
|
LastModifiedAt types.DateTime `json:"lastModifiedAt" db:"last_modified_at"`
|
|
Code string `json:"code" db:"code"`
|
|
|
|
Park string `json:"parkId" db:"park_id"`
|
|
Address *string `json:"address" db:"address"`
|
|
Ratio decimal.Decimal `json:"ratio" db:"ratio"`
|
|
Seq int64 `json:"seq" db:"seq"`
|
|
Enabled bool `json:"enabled" db:"enabled"`
|
|
MeterType int16 `json:"type" db:"meter_type"`
|
|
Building *string `json:"building" db:"building"`
|
|
|
|
OnFloor *string `json:"onFloor" db:"on_floor" `
|
|
Area decimal.NullDecimal `json:"area" db:"area"`
|
|
AttachedAt *types.DateTime `json:"attachedAt" db:"attached_at"`
|
|
DetachedAt *types.DateTime `json:"detachedAt" db:"detached_at"`
|
|
DisplayRatio decimal.Decimal `db:"display_ratio"`
|
|
BuildingName *string `db:"building_name"`
|
|
}
|