forked from free-lancers/electricity_bill_calc_service
		
	enhance(report):基本完成报表查询部分的综合服务部分。
This commit is contained in:
		
							
								
								
									
										29
									
								
								vo/park.go
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								vo/park.go
									
									
									
									
									
								
							| @@ -3,6 +3,8 @@ package vo | ||||
| import ( | ||||
| 	"electricity_bill_calc/model" | ||||
| 	"electricity_bill_calc/tools" | ||||
|  | ||||
| 	"github.com/shopspring/decimal" | ||||
| ) | ||||
|  | ||||
| type ParkInformationForm struct { | ||||
| @@ -65,3 +67,30 @@ type ParkBuildingInformationForm struct { | ||||
| 	Name   string `json:"name"` | ||||
| 	Floors string `json:"floors"` | ||||
| } | ||||
|  | ||||
| type SimplifiedParkDetail struct { | ||||
| 	Id          string  `json:"id"` | ||||
| 	UserId      string  `json:"user_id"` | ||||
| 	Name        string  `json:"name"` | ||||
| 	TenementStr *string `json:"tenement"` | ||||
| 	AreaStr     *string `json:"area"` | ||||
| 	CapacityStr *string `json:"capacity"` | ||||
| 	Category    int16   `json:"category"` | ||||
| 	MeterType   int16   `json:"meter04kvType"` | ||||
| 	Region      *string `json:"region"` | ||||
| 	Address     *string `json:"address"` | ||||
| 	Contact     *string `json:"contact"` | ||||
| 	Phone       *string `json:"phone"` | ||||
| } | ||||
|  | ||||
| func (spd *SimplifiedParkDetail) TenementQuantity(tq decimal.NullDecimal) { | ||||
| 	spd.TenementStr = tools.NullDecimalToString(tq) | ||||
| } | ||||
|  | ||||
| func (spd *SimplifiedParkDetail) Area(area decimal.NullDecimal) { | ||||
| 	spd.AreaStr = tools.NullDecimalToString(area) | ||||
| } | ||||
|  | ||||
| func (spd *SimplifiedParkDetail) Capacity(capacity decimal.NullDecimal) { | ||||
| 	spd.CapacityStr = tools.NullDecimalToString(capacity) | ||||
| } | ||||
|   | ||||
							
								
								
									
										30
									
								
								vo/report.go
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								vo/report.go
									
									
									
									
									
								
							| @@ -40,3 +40,33 @@ type ReportModifyForm struct { | ||||
| 	BasicFee    decimal.Decimal `json:"basicFee"` | ||||
| 	AdjustFee   decimal.Decimal `json:"adjustFee"` | ||||
| } | ||||
|  | ||||
| type SimplifiedReportIndex struct { | ||||
| 	Id                    string          `json:"id"` | ||||
| 	Park                  string          `json:"parkId"` | ||||
| 	PeriodBegin           types.Date      `json:"periodBegin"` | ||||
| 	PeriodEnd             types.Date      `json:"periodEnd"` | ||||
| 	Published             bool            `json:"published"` | ||||
| 	PublishedAt           *types.DateTime `json:"publishedAt"` | ||||
| 	Withdraw              int16           `json:"withdraw"` | ||||
| 	LastWithdrawAppliedAt *types.DateTime `json:"lastWithdrawAppliedAt"` | ||||
| 	LastWithdrawAuditAt   *types.DateTime `json:"lastWithdrawAuditAt"` | ||||
| 	Status                int16           `json:"status"` | ||||
| 	Message               *string         `json:"message"` | ||||
| } | ||||
|  | ||||
| func (sri *SimplifiedReportIndex) Period(p types.DateRange) { | ||||
| 	sri.PeriodBegin = p.SafeLower() | ||||
| 	sri.PeriodEnd = p.SafeUpper() | ||||
| } | ||||
|  | ||||
| type ReportIndexQueryResponse struct { | ||||
| 	Park   SimplifiedParkDetail   `json:"park"` | ||||
| 	Report *SimplifiedReportIndex `json:"report"` | ||||
| } | ||||
|  | ||||
| type ComprehensiveReportQueryResponse struct { | ||||
| 	Report SimplifiedReportIndex `json:"report"` | ||||
| 	Park   SimplifiedParkDetail  `json:"park"` | ||||
| 	User   SimplifiedUserDetail  `json:"user"` | ||||
| } | ||||
|   | ||||
							
								
								
									
										14
									
								
								vo/user.go
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								vo/user.go
									
									
									
									
									
								
							| @@ -2,6 +2,7 @@ package vo | ||||
|  | ||||
| import ( | ||||
| 	"electricity_bill_calc/model" | ||||
| 	"electricity_bill_calc/tools" | ||||
| 	"electricity_bill_calc/types" | ||||
| 	"time" | ||||
|  | ||||
| @@ -125,3 +126,16 @@ type RepasswordForm struct { | ||||
| 	Username    string `json:"uname"` | ||||
| 	NewPassword string `json:"newPass"` | ||||
| } | ||||
|  | ||||
| type SimplifiedUserDetail struct { | ||||
| 	Id      string  `json:"id"` | ||||
| 	NameStr string  `json:"name"` | ||||
| 	Contact *string `json:"contact"` | ||||
| 	Phone   *string `json:"phone"` | ||||
| 	Region  *string `json:"region"` | ||||
| 	Address *string `json:"address"` | ||||
| } | ||||
|  | ||||
| func (sud *SimplifiedUserDetail) Name(n *string) { | ||||
| 	sud.NameStr = tools.DefaultTo(n, "") | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user