electricity_bill_calc_service/vo/meter.go

123 lines
6.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package vo
import (
"electricity_bill_calc/model"
"electricity_bill_calc/types"
"time"
"github.com/shopspring/decimal"
)
type MeterCreationForm struct {
Code string `json:"code"`
Address *string `json:"address"`
Ratio decimal.Decimal `json:"ratio"`
Seq int64 `json:"seq"`
MeterType int16 `json:"type"`
Building *string `json:"building"`
OnFloor *string `json:"onFloor"`
Area decimal.NullDecimal `json:"area"`
Enabled bool `json:"enabled"`
Reading MeterReadingForm `json:"reading"`
}
type MeterModificationForm struct {
Address *string `json:"address"`
Seq int64 `json:"seq"`
Ratio decimal.Decimal `json:"ratio"`
Enabled bool `json:"enabled"`
MeterType int16 `json:"type"`
Building *string `json:"building"`
OnFloor *string `json:"onFloor"`
Area decimal.NullDecimal `json:"area"`
}
type NewMeterForReplacingForm struct {
Code string `json:"code"`
Ratio decimal.Decimal `json:"ratio"`
Reading MeterReadingForm `json:"reading"`
}
type MeterReplacingForm struct {
OldReading MeterReadingForm `json:"oldReading"`
NewMeter NewMeterForReplacingForm `json:"newMeter"`
}
type SimplifiedMeterQueryResponse struct {
Code string `json:"code"`
Address *string `json:"address"`
Park string `json:"parkId"`
}
type SimplifiedMeterDetailResponse struct {
Code string `json:"code"`
Park string `json:"parkId"`
Address *string `json:"address"`
Seq int64 `json:"seq"`
Ratio decimal.Decimal `json:"ratio"`
Building *string `json:"building"`
BuildingName *string `json:"buildingName"`
OnFloor *string `json:"onFloor"`
Area decimal.Decimal `json:"area"`
Enabled bool `json:"enabled"`
MeterType int16 `json:"type"`
AttachedAt *types.DateTime `json:"attachedAt"`
DetachedAt *types.DateTime `json:"detachedAt"`
}
type ReadableMeterQueryResponse struct {
Code string `json:"code"`
Address *string `json:"address"`
Park string `json:"park"`
}
type ReportPublishResponse struct {
//ID string
ReportID string `json:"report_id" db:"report_id"` // 报告ID
ParkMeterID string `json:"park_meter_id" db:"park_meter_id"` // 停车计费ID
Overall model.ConsumptionUnit `json:"overall" db:"overall"` // 总体信息
Critical model.ConsumptionUnit `json:"critical" db:"critical"` // 关键信息
Peak model.ConsumptionUnit `json:"peak" db:"peak"` // 高峰信息
Flat model.ConsumptionUnit `json:"flat" db:"flat"` // 平峰信息
Valley model.ConsumptionUnit `json:"valley" db:"valley"` // 谷峰信息
LossAdjust model.ConsumptionUnit `json:"loss_adjust" db:"loss_adjust"` // 损耗调整信息
ConsumptionTotal float64 `json:"consumption_total" db:"consumption_total"` // 总消费量
LossAdjustTotal float64 `json:"loss_adjust_total" db:"loss_adjust_total"` // 总损耗调整
FinalTotal float64 `json:"final_total" db:"final_total"` // 最终总量
CreatedAt time.Time `json:"created_at" db:"created_at"` // 创建时间
LastModifiedAt time.Time `json:"last_modified_at" db:"last_modified_at"` // 最后修改时间
Code string `json:"code" db:"code"` // 代码
ParkID string `json:"park_id" db:"park_id"` // 停车场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:"meter_type" db:"meter_type"` // 计量类型
Building *string `json:"building" db:"building"` // 建筑物
OnFloor *string `json:"on_floor" db:"on_floor"` // 楼层
Area decimal.NullDecimal `json:"area" db:"area"` // 面积
AttachedAt *types.DateTime `json:"attached_at" db:"attached_at"` // 附加时间
DetachedAt *types.DateTime `json:"detached_at" db:"detached_at"` // 分离时间
DisplayRatio float64 `json:"display_ratio" db:"display_ratio"` // 显示比例
BuildingName *string `json:"building_name" db:"building_name"` // 建筑物名称
PublicPooled int16 `json:"public_pooled" db:"public_pooled"` // 公共汇总
}
type Public struct {
Address *string `json:"address"` // 户址
AdjustLoss model.ConsumptionUnit `json:"adjustLoss"` // 调整线损数据,仅运维可见,仅使用其中`amount`内容
Area string `json:"area"` // 所辖面积
AttachedAt *types.DateTime `json:"attachedAt"` // 接入系统时间,挂表
Building *string `json:"building"` // 所在建筑ID
BuildingName *string `json:"buildingName"` // 所在建筑名称
Code string `json:"code"` // 表计表号
DetachedAt *types.DateTime `json:"detachedAt"` // 从系统移除时间,拆表
DisplayRatio string `json:"displayRatio"` // 表计表显倍率,仅用于展示。
Enabled bool `json:"enabled"` // 是否可用
OnFloor *string `json:"onFloor"` // 所在楼层
Overall model.ConsumptionUnit `json:"overall"` // 总电量部分
ParkID string `json:"parkId"` // 所属园区ID
Ratio string `json:"ratio"` // 表计计算倍率,参与表计读数计算。
Seq int64 `json:"seq"` // 抄表序号
Type float64 `json:"type"` // 表计类型0商户电表1园区电表2公摊电表
}