enhance(publicity):向前端返回的终端用户数据增加公共设施与摊薄标记。

This commit is contained in:
徐涛 2022-09-20 06:39:57 +08:00
parent 794054b831
commit a13193cfa4
2 changed files with 28 additions and 24 deletions

View File

@ -85,18 +85,20 @@ type MaintenancePart struct {
} }
type EndUserSummary struct { type EndUserSummary struct {
CustomerName *string `json:"customerName"` CustomerName *string `json:"customerName"`
Address *string `json:"address"` Address *string `json:"address"`
MeterId string `json:"meterId"` MeterId string `json:"meterId"`
Overall decimal.Decimal `json:"overall"` IsPublicMeter bool `json:"isPublicMeter"`
OverallFee decimal.Decimal `json:"overallFee"` Diluted bool `json:"willDilute"`
Critical decimal.NullDecimal `json:"critical"` Overall decimal.Decimal `json:"overall"`
CriticalFee decimal.NullDecimal `json:"criticalFee"` OverallFee decimal.Decimal `json:"overallFee"`
Peak decimal.NullDecimal `json:"peak"` Critical decimal.NullDecimal `json:"critical"`
PeakFee decimal.NullDecimal `json:"peakFee"` CriticalFee decimal.NullDecimal `json:"criticalFee"`
Valley decimal.NullDecimal `json:"valley"` Peak decimal.NullDecimal `json:"peak"`
ValleyFee decimal.NullDecimal `json:"valleyFee"` PeakFee decimal.NullDecimal `json:"peakFee"`
Maintenance decimal.Decimal `json:"maintenance"` Valley decimal.NullDecimal `json:"valley"`
ValleyFee decimal.NullDecimal `json:"valleyFee"`
Maintenance decimal.Decimal `json:"maintenance"`
} }
type Publicity struct { type Publicity struct {

View File

@ -701,18 +701,20 @@ func (_ReportService) AssembleReportPublicity(reportId string) (*model.Publicity
report.EndUsers, report.EndUsers,
func(elem *model.EndUserDetail, index int) model.EndUserSummary { func(elem *model.EndUserDetail, index int) model.EndUserSummary {
return model.EndUserSummary{ return model.EndUserSummary{
CustomerName: elem.CustomerName, CustomerName: elem.CustomerName,
Address: elem.Address, Address: elem.Address,
MeterId: elem.MeterId, MeterId: elem.MeterId,
Overall: elem.Overall.Decimal, IsPublicMeter: elem.IsPublicMeter,
OverallFee: elem.OverallFee.Decimal, Diluted: elem.WillDilute,
Critical: elem.Critical, Overall: elem.Overall.Decimal,
CriticalFee: elem.CriticalFee, OverallFee: elem.OverallFee.Decimal,
Peak: elem.Peak, Critical: elem.Critical,
PeakFee: elem.PeakFee, CriticalFee: elem.CriticalFee,
Valley: elem.Valley, Peak: elem.Peak,
ValleyFee: elem.ValleyFee, PeakFee: elem.PeakFee,
Maintenance: elem.FinalDiluted.Decimal, Valley: elem.Valley,
ValleyFee: elem.ValleyFee,
Maintenance: elem.FinalDiluted.Decimal,
} }
}, },
) )