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 {
CustomerName *string `json:"customerName"`
Address *string `json:"address"`
MeterId string `json:"meterId"`
Overall decimal.Decimal `json:"overall"`
OverallFee decimal.Decimal `json:"overallFee"`
Critical decimal.NullDecimal `json:"critical"`
CriticalFee decimal.NullDecimal `json:"criticalFee"`
Peak decimal.NullDecimal `json:"peak"`
PeakFee decimal.NullDecimal `json:"peakFee"`
Valley decimal.NullDecimal `json:"valley"`
ValleyFee decimal.NullDecimal `json:"valleyFee"`
Maintenance decimal.Decimal `json:"maintenance"`
CustomerName *string `json:"customerName"`
Address *string `json:"address"`
MeterId string `json:"meterId"`
IsPublicMeter bool `json:"isPublicMeter"`
Diluted bool `json:"willDilute"`
Overall decimal.Decimal `json:"overall"`
OverallFee decimal.Decimal `json:"overallFee"`
Critical decimal.NullDecimal `json:"critical"`
CriticalFee decimal.NullDecimal `json:"criticalFee"`
Peak decimal.NullDecimal `json:"peak"`
PeakFee decimal.NullDecimal `json:"peakFee"`
Valley decimal.NullDecimal `json:"valley"`
ValleyFee decimal.NullDecimal `json:"valleyFee"`
Maintenance decimal.Decimal `json:"maintenance"`
}
type Publicity struct {

View File

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