refactor(model):重新按照设计要求调整公示报表部分的数据结构。
This commit is contained in:
parent
6fc40e3a93
commit
b426c6a7b1
|
@ -4,28 +4,40 @@ import "github.com/shopspring/decimal"
|
||||||
|
|
||||||
type EndUserDetail struct {
|
type EndUserDetail struct {
|
||||||
CreatedAndModified `xorm:"extends"`
|
CreatedAndModified `xorm:"extends"`
|
||||||
ReportId string `xorm:"varchar(120) pk not null" json:"-"`
|
ReportId string `xorm:"varchar(120) pk not null" json:"reportId"`
|
||||||
|
ParkId string `xorm:"varchar(120) pk not null" json:"parkId"`
|
||||||
MeterId string `xorm:"meter_04kv_id varchar(120) pk not null" json:"meterId"`
|
MeterId string `xorm:"meter_04kv_id varchar(120) pk not null" json:"meterId"`
|
||||||
Seq int64 `xorm:"bigint not null" json:"seq"`
|
Seq int64 `xorm:"bigint not null default 0" json:"seq"`
|
||||||
Ratio decimal.Decimal `xorm:"numeric(8,4) not null" json:"ratio"`
|
Ratio decimal.Decimal `xorm:"numeric(8,4) not null deafult 1" json:"ratio"`
|
||||||
LastPeriodCritical decimal.NullDecimal `xorm:"numeric(14,2)" json:"lastPeriodCritical"`
|
Address *string `xorm:"varchar(100)" json:"address"`
|
||||||
LastPeriodPeek decimal.NullDecimal `xorm:"numeric(14,2)" json:"lastPeriodPeek"`
|
CustomerName *string `xorm:"varchar(100)" json:"customerName"`
|
||||||
LastPeriodFlat decimal.Decimal `xorm:"numeric(14,2) not null" json:"lastPeriodFlat"`
|
ContactName *string `xorm:"varchar(70)" json:"contactName"`
|
||||||
LastPeriodValley decimal.NullDecimal `xorm:"numeric(14,2)" json:"lastPeriodValley"`
|
ContactPhone *string `xorm:"varchar(50)" json:"contactPhone"`
|
||||||
CurrentPeriodCritical decimal.NullDecimal `xorm:"numeric(14,2)" json:"currentPeriodCritical"`
|
IsPublicMeter bool `xorm:"'public_meter' bool not null default false" json:"isPublicMeter"`
|
||||||
CurrentPeriodPeek decimal.NullDecimal `xorm:"numeric(14,2)" json:"currentPeriodPeek"`
|
WillDilute bool `xorm:"'dilute' bool not null default false" json:"willDilute"`
|
||||||
CurrentPeriodFlat decimal.Decimal `xorm:"numeric(14,2) not null" json:"currentPeriodFlat"`
|
LastPeriodOverall decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"lastPeriodOverall"`
|
||||||
CurrentPeriodValley decimal.NullDecimal `xorm:"numeric(14,2)" json:"currentPeriodValley"`
|
LastPeriodCritical decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"lastPeriodCritical"`
|
||||||
AdjustCritical decimal.NullDecimal `xorm:"numeric(14,2)" json:"adjustCritical"`
|
LastPeriodPeek decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"lastPeriodPeek"`
|
||||||
AdjustPeek decimal.NullDecimal `xorm:"numeric(14,2)" json:"adjustPeek"`
|
LastPeriodFlat decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"lastPeriodFlat"`
|
||||||
AdjustFlat decimal.Decimal `xorm:"numeric(14,2) not null" json:"adjustFlat"`
|
LastPeriodValley decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"lastPeriodValley"`
|
||||||
AdjustValley decimal.NullDecimal `xorm:"numeric(14,2)" json:"adjustValley"`
|
CurrentPeriodOverall decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"currentPeriodOverall"`
|
||||||
|
CurrentPeriodCritical decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"currentPeriodCritical"`
|
||||||
|
CurrentPeriodPeek decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"currentPeriodPeek"`
|
||||||
|
CurrentPeriodFlat decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"currentPeriodFlat"`
|
||||||
|
CurrentPeriodValley decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"currentPeriodValley"`
|
||||||
|
AdjustOverall decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"adjustOverall"`
|
||||||
|
AdjustCritical decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"adjustCritical"`
|
||||||
|
AdjustPeek decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"adjustPeek"`
|
||||||
|
AdjustFlat decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"adjustFlat"`
|
||||||
|
AdjustValley decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"adjustValley"`
|
||||||
|
Overall decimal.NullDecimal `xorm:"numeric(14,2)" json:"overall"`
|
||||||
|
OverallFee decimal.NullDecimal `xorm:"numeric(14,2)" json:"overallFee"`
|
||||||
Critical decimal.NullDecimal `xorm:"numeric(14,2)" json:"critical"`
|
Critical decimal.NullDecimal `xorm:"numeric(14,2)" json:"critical"`
|
||||||
CriticalFee decimal.NullDecimal `xorm:"numeric(18,8)" json:"criticalFee"`
|
CriticalFee decimal.NullDecimal `xorm:"numeric(18,8)" json:"criticalFee"`
|
||||||
Peek decimal.NullDecimal `xorm:"numeric(14,2)" json:"peek"`
|
Peek decimal.NullDecimal `xorm:"numeric(14,2)" json:"peek"`
|
||||||
PeekFee decimal.NullDecimal `xorm:"numeric(18,8)" json:"peekFee"`
|
PeekFee decimal.NullDecimal `xorm:"numeric(18,8)" json:"peekFee"`
|
||||||
Flat decimal.Decimal `xorm:"numeric(14,2) not null" json:"flat"`
|
Flat decimal.NullDecimal `xorm:"numeric(14,2)" json:"flat"`
|
||||||
FlatFee decimal.Decimal `xorm:"numeric(18,8) not null" json:"flatFee"`
|
FlatFee decimal.NullDecimal `xorm:"numeric(18,8)" json:"flatFee"`
|
||||||
Valley decimal.NullDecimal `xorm:"numeric(14,2)" json:"valley"`
|
Valley decimal.NullDecimal `xorm:"numeric(14,2)" json:"valley"`
|
||||||
ValleyFee decimal.NullDecimal `xorm:"numeric(18,8)" json:"valleyFee"`
|
ValleyFee decimal.NullDecimal `xorm:"numeric(18,8)" json:"valleyFee"`
|
||||||
BasicFeeDiluted decimal.NullDecimal `xorm:"numeric(18,8)" json:"basicFeeDiluted"`
|
BasicFeeDiluted decimal.NullDecimal `xorm:"numeric(18,8)" json:"basicFeeDiluted"`
|
||||||
|
@ -34,7 +46,6 @@ type EndUserDetail struct {
|
||||||
LossFeeDiluted decimal.NullDecimal `xorm:"numeric(18,8)" json:"lossFeeDiluted"`
|
LossFeeDiluted decimal.NullDecimal `xorm:"numeric(18,8)" json:"lossFeeDiluted"`
|
||||||
MaintenanceFeeDiluted decimal.NullDecimal `xorm:"numeric(18,8)" json:"maintenanceFeeDiluted"`
|
MaintenanceFeeDiluted decimal.NullDecimal `xorm:"numeric(18,8)" json:"maintenanceFeeDiluted"`
|
||||||
PublicConsumptionDiluted decimal.NullDecimal `xorm:"numeric(18,8)" json:"publicConsumptionDiluted"`
|
PublicConsumptionDiluted decimal.NullDecimal `xorm:"numeric(18,8)" json:"publicConsumptionDiluted"`
|
||||||
ServiceFeeDiluted decimal.NullDecimal `xorm:"numeric(18,8)" json:"serviceFeeDiluted"`
|
|
||||||
FinalCharge decimal.NullDecimal `xorm:"numeric(14,2)" json:"finalCharge"`
|
FinalCharge decimal.NullDecimal `xorm:"numeric(14,2)" json:"finalCharge"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,10 @@ import "time"
|
||||||
|
|
||||||
type Report struct {
|
type Report struct {
|
||||||
CreatedAndModified `xorm:"extends"`
|
CreatedAndModified `xorm:"extends"`
|
||||||
Deleted `xorm:"extends"`
|
|
||||||
Id string `xorm:"varchar(120) pk not null" json:"id"`
|
Id string `xorm:"varchar(120) pk not null" json:"id"`
|
||||||
ParkId string `xorm:"varchar(120) not null" json:"parkId"`
|
ParkId string `xorm:"varchar(120) not null" json:"parkId"`
|
||||||
Period time.Time `xorm:"date not null" json:"period" time_format:"simple_date" time_location:"shanghai"`
|
Period time.Time `xorm:"date not null" json:"period" time_format:"simple_date" time_location:"shanghai"`
|
||||||
|
StepState Steps `xorm:"text not null json" json:"stepState"`
|
||||||
Published bool `xorm:"bool not null default false" json:"published"`
|
Published bool `xorm:"bool not null default false" json:"published"`
|
||||||
PublishedAt *time.Time `xorm:"timestampz" json:"publishedAt" time_format:"simple_datetime" time_location:"shanghai"`
|
PublishedAt *time.Time `xorm:"timestampz" json:"publishedAt" time_format:"simple_datetime" time_location:"shanghai"`
|
||||||
Withdraw int8 `xorm:"smallint not null default 0" json:"withdraw"`
|
Withdraw int8 `xorm:"smallint not null default 0" json:"withdraw"`
|
||||||
|
@ -15,6 +15,15 @@ type Report struct {
|
||||||
LastWithdrawAuditAt *time.Time `xorm:"timestampz" json:"lastWithdrawAuditAt" time_format:"simple_datetime" time_location:"shanghai"`
|
LastWithdrawAuditAt *time.Time `xorm:"timestampz" json:"lastWithdrawAuditAt" time_format:"simple_datetime" time_location:"shanghai"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Steps struct {
|
||||||
|
Summary bool `json:"summary"`
|
||||||
|
WillDiluted bool `json:"willDiluted"`
|
||||||
|
Submeter bool `json:"submeter"`
|
||||||
|
Calculate bool `json:"calculate"`
|
||||||
|
Preview bool `json:"preview"`
|
||||||
|
Publish bool `json:"publish"`
|
||||||
|
}
|
||||||
|
|
||||||
func (Report) TableName() string {
|
func (Report) TableName() string {
|
||||||
return "report"
|
return "report"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,33 +4,32 @@ import "github.com/shopspring/decimal"
|
||||||
|
|
||||||
type ReportSummary struct {
|
type ReportSummary struct {
|
||||||
ReportId string `xorm:"varchar(120) pk not null" json:"-"`
|
ReportId string `xorm:"varchar(120) pk not null" json:"-"`
|
||||||
Overall decimal.Decimal `xorm:"numeric(14,2) not null" json:"overall"`
|
Overall decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"overall"`
|
||||||
OverallFee decimal.Decimal `xorm:"numeric(14,2) not null" json:"overallFee"`
|
OverallFee decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"overallFee"`
|
||||||
OverallPrice decimal.Decimal `xorm:"numeric(16,8)" json:"overallPrice"`
|
OverallPrice decimal.Decimal `xorm:"numeric(16,8)" json:"overallPrice"`
|
||||||
Critical decimal.Decimal `xorm:"numeric(14,2) not null" json:"critial"`
|
Critical decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"critial"`
|
||||||
CriticalFee decimal.Decimal `xorm:"numeric(14,2) not null" json:"criticalFee"`
|
CriticalFee decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"criticalFee"`
|
||||||
CriticalPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"criticalPrice"`
|
CriticalPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"criticalPrice"`
|
||||||
Peek decimal.Decimal `xorm:"numeric(14,2) not null" json:"peek"`
|
Peek decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"peek"`
|
||||||
PeekFee decimal.Decimal `xorm:"numeric(14,2) not null" json:"peekFee"`
|
PeekFee decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"peekFee"`
|
||||||
PeekPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"peekPrice"`
|
PeekPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"peekPrice"`
|
||||||
Flat decimal.NullDecimal `xorm:"numeric(14,2)" json:"flat"`
|
Flat decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"flat"`
|
||||||
FlatFee decimal.Decimal `xorm:"numeric(14,2) not null" json:"flatFee"`
|
FlatFee decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"flatFee"`
|
||||||
FlatPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"flatPrice"`
|
FlatPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"flatPrice"`
|
||||||
Valley decimal.Decimal `xorm:"numeric(14,2) not null" json:"valley"`
|
Valley decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"valley"`
|
||||||
ValleyFee decimal.Decimal `xorm:"numeric(14,2) not null" json:"valleyFee"`
|
ValleyFee decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"valleyFee"`
|
||||||
ValleyPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"valleyPrice"`
|
ValleyPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"valleyPrice"`
|
||||||
Loss decimal.NullDecimal `xorm:"numeric(14,2)" json:"loss"`
|
Loss decimal.NullDecimal `xorm:"numeric(14,2)" json:"loss"`
|
||||||
LossFee decimal.NullDecimal `xorm:"numeric(16,2)" json:"lossFee"`
|
LossFee decimal.NullDecimal `xorm:"numeric(16,2)" json:"lossFee"`
|
||||||
PublicConsumption decimal.NullDecimal `xorm:"numeric(14,2)" json:"publicConsumption"`
|
PublicConsumption decimal.NullDecimal `xorm:"numeric(14,2)" json:"publicConsumption"`
|
||||||
PublicConsumptionFee decimal.NullDecimal `xorm:"numeric(14,2)" json:"publicConsumptionFee"`
|
PublicConsumptionFee decimal.NullDecimal `xorm:"numeric(14,2)" json:"publicConsumptionFee"`
|
||||||
BasicFee decimal.Decimal `xorm:"numeric(14,2) not null" json:"basicFee"`
|
BasicFee decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"basicFee"`
|
||||||
BasicDilutedPrice decimal.NullDecimal `xorm:"numeric(18,8)" json:"basicDilutedPrice"`
|
BasicDilutedPrice decimal.NullDecimal `xorm:"numeric(18,8)" json:"basicDilutedPrice"`
|
||||||
AdjustFee decimal.Decimal `xorm:"numeric(14,2) not null" json:"adjustFee"`
|
AdjustFee decimal.Decimal `xorm:"numeric(14,2) not null default 0" json:"adjustFee"`
|
||||||
AdjustDilutedPrice decimal.NullDecimal `xorm:"numeric(18,8)" json:"adjustDilutedPrice"`
|
AdjustDilutedPrice decimal.NullDecimal `xorm:"numeric(18,8)" json:"adjustDilutedPrice"`
|
||||||
MaintenanceDilutedPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"maintencanceDilutedPrice"`
|
MaintenanceDilutedPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"maintencanceDilutedPrice"`
|
||||||
LossDilutedPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"lossDilutedPrice"`
|
LossDilutedPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"lossDilutedPrice"`
|
||||||
PublicConsumptionDilutedPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"publicConsumptionDilutedPrice"`
|
PublicConsumptionDilutedPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"publicConsumptionDilutedPrice"`
|
||||||
ServiceDilutedPrice decimal.NullDecimal `xorm:"numeric(16,8)" json:"serviceDilutedPrice"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ReportSummary) TableName() string {
|
func (ReportSummary) TableName() string {
|
||||||
|
|
|
@ -6,8 +6,9 @@ type WillDilutedFee struct {
|
||||||
CreatedAndModified `xorm:"extends"`
|
CreatedAndModified `xorm:"extends"`
|
||||||
Id string `xorm:"varchar(120) pk not null" json:"id"`
|
Id string `xorm:"varchar(120) pk not null" json:"id"`
|
||||||
ReportId string `xorm:"varchar(120) not null" json:"reportId"`
|
ReportId string `xorm:"varchar(120) not null" json:"reportId"`
|
||||||
|
SourceId *string `xorm:"varchar(120)" json:"sourceId"`
|
||||||
Name string `xorm:"varchar(50) not null" json:"name"`
|
Name string `xorm:"varchar(50) not null" json:"name"`
|
||||||
Fee decimal.Decimal `xorm:"numeric(8,2) not null" json:"fee"`
|
Fee decimal.Decimal `xorm:"numeric(8,2) not null default 0" json:"fee"`
|
||||||
Memo *string `xorm:"text" json:"memo"`
|
Memo *string `xorm:"text" json:"memo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user