electricity_bill_calc_service/model/withdraw.go

85 lines
4.3 KiB
Go
Raw Permalink 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 model
import (
"electricity_bill_calc/types"
"github.com/shopspring/decimal"
"time"
)
type Withdraw struct {
Park SimplifiedPark `json:"park"`
Report SimplifiedReport `json:"report"`
User UserInfos `json:"user"` // 简易用户详细信息
}
// 简易园区信息
type SimplifiedPark struct {
Address *string `json:"address"` // 园区地址
Area *string `json:"area"` // 园区面积
Capacity *string `json:"capacity"` // 供电容量
Category int16 `json:"category"` // 用电分类0两部制1单一峰谷2单一单一
Contact *string `json:"contact"` // 园区联系人
ID string `json:"id"` // 园区ID
Meter04KvType int16 `json:"meter04kvType"` // 户表计量类型0非峰谷1峰谷
Name string `json:"name"` // 园区名称
Phone *string `json:"phone"` // 园区联系人电话
Region *string `json:"region"` // 园区所在行政区划
Tenement *string `json:"tenement"` // 园区住户数量
UserID string `json:"userId"` // 园区所属用户ID
}
// 简易核算报表信息
type SimplifiedReport struct {
ID string `json:"id"` // 报表ID
LastWithdrawAppliedAt *string `json:"lastWithdrawAppliedAt"` // 最后一次申请撤回的时间,格式为 yyyy-MM-dd HH:mm:ss
LastWithdrawAuditAt *string `json:"lastWithdrawAuditAt"` // 最后一次申请审核的时间,格式为 yyyy-MM-dd HH:mm:ss
Message *string `json:"message"` // 当前状态的错误提示
ParkID string `json:"parkId"` // 所属园区ID
PeriodBegin string `json:"periodBegin"` // 核算起始日期,格式为 yyyy-MM-dd
PeriodEnd string `json:"periodEnd"` // 核算结束日期,格式为 yyyy-MM-dd
Published bool `json:"published"` // 是否已发布
PublishedAt *string `json:"publishedAt"` // 发布时间
Status float64 `json:"status,omitempty"` // 当前状态0计算任务已队列1计算任务已完成2计算数据不足
Withdraw int16 `json:"withdraw"` // 报表撤回状态0未撤回1申请撤回中2申请拒绝3申请批准
}
// 简易用户信息
type UserInfos struct {
Address *string `json:"address"` // 用户地址
Contact *string `json:"contact"` // 用户联系人
ID string `json:"id"` // 用户ID
Name *string `json:"name"` // 用户名称
Phone *string `json:"phone"` // 用户联系人电话
Region *string `json:"region"` // 用户所在行政区划
}
//用于映射数据库的报表结构体
type ReportRes struct {
ReportId string `db:"report_id"`
LastWithdrawAppliedAt *time.Time `db:"last_withdraw_applied_at"`
LastWithdrawAuditAt *time.Time `db:"last_withdraw_audit_at"`
ParkID string `db:"report_park_id"`
Period types.DateRange `db:"period"`
Published bool `db:"published"`
PublishedAt *time.Time `db: "published_at"`
Withdraw int16 `db:"withdraw"`
ParkAddress *string `db:"park_address"`
Area decimal.NullDecimal `db:"area"`
Capacity decimal.NullDecimal `db:"capacity"`
Category int16
ParkContact *string `db:"park_contact"`
ParkId string `db:"park_id"`
Meter04KVType int16 `db:"meter_04kv_type"`
ParkName string `db:"park_name"`
ParkPhone *string `db:"park_phone"`
ParkRegion string `db:"park_region"`
TenementQuantity decimal.NullDecimal `db:"tenement_quantity"`
UserID string `db:"user_id"`
Address *string
Contact string `db:"user_detail_contact"`
ID string `db:"ud_id"`
Name *string `db:"user_detail_name"`
Phone string `db:"user_detail_phone"`
Region *string `db:"user_detail_region"`
}