forked from free-lancers/electricity_bill_calc_service
		
	feat(report):基本完成报表的初始化、基本索引信息获取和步骤信息获取。
This commit is contained in:
		| @@ -8,7 +8,7 @@ type EndUserDetail struct { | ||||
| 	ParkId                   string              `xorm:"varchar(120) pk not null" json:"parkId"` | ||||
| 	MeterId                  string              `xorm:"meter_04kv_id varchar(120) pk not null" json:"meterId"` | ||||
| 	Seq                      int64               `xorm:"bigint not null default 0" json:"seq"` | ||||
| 	Ratio                    decimal.Decimal     `xorm:"numeric(8,4) not null deafult 1" json:"ratio"` | ||||
| 	Ratio                    decimal.Decimal     `xorm:"numeric(8,4) not null default 1" json:"ratio"` | ||||
| 	Address                  *string             `xorm:"varchar(100)" json:"address"` | ||||
| 	CustomerName             *string             `xorm:"varchar(100)" json:"customerName"` | ||||
| 	ContactName              *string             `xorm:"varchar(70)" json:"contactName"` | ||||
|   | ||||
| @@ -2,6 +2,13 @@ package model | ||||
|  | ||||
| import "time" | ||||
|  | ||||
| const ( | ||||
| 	REPORT_NOT_WITHDRAW int8 = iota | ||||
| 	REPORT_WITHDRAW_APPLIED | ||||
| 	REPORT_WITHDRAW_DENIED | ||||
| 	REPORT_WITHDRAW_GRANTED | ||||
| ) | ||||
|  | ||||
| type Report struct { | ||||
| 	CreatedAndModified    `xorm:"extends"` | ||||
| 	Id                    string     `xorm:"varchar(120) pk not null" json:"id"` | ||||
| @@ -27,3 +34,29 @@ type Steps struct { | ||||
| func (Report) TableName() string { | ||||
| 	return "report" | ||||
| } | ||||
|  | ||||
| func NewSteps() Steps { | ||||
| 	return Steps{ | ||||
| 		Summary:     false, | ||||
| 		WillDiluted: false, | ||||
| 		Submeter:    false, | ||||
| 		Calculate:   false, | ||||
| 		Preview:     false, | ||||
| 		Publish:     false, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| type ParkNewestReport struct { | ||||
| 	Park   Park    `xorm:"extends" json:"park"` | ||||
| 	Report *Report `xorm:"extends" json:"report"` | ||||
| } | ||||
|  | ||||
| func (ParkNewestReport) TableName() string { | ||||
| 	return "park" | ||||
| } | ||||
|  | ||||
| func (p *ParkNewestReport) AfterLoad() { | ||||
| 	if p.Report != nil && len(p.Report.Id) == 0 { | ||||
| 		p.Report = nil | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user