diff --git a/model/end_user_detail.go b/model/end_user_detail.go index 02522d6..fbf65fb 100644 --- a/model/end_user_detail.go +++ b/model/end_user_detail.go @@ -114,8 +114,8 @@ type EndUserImport struct { } type EndUserPeriodStat struct { - CustomerName string `json:"customerName"` - Address string `json:"address"` + CustomerName *string `json:"customerName"` + Address *string `json:"address"` MeterId string `bun:"meter_04kv_id" json:"meterId"` IsPublicMeter bool `bun:"public_meter" json:"isPublicMeter"` Kind int8 `bun:"-" json:"pvKind"` diff --git a/service/end_user.go b/service/end_user.go index ed16e48..3c2c82a 100644 --- a/service/end_user.go +++ b/service/end_user.go @@ -449,15 +449,17 @@ func (es _EndUserService) StatEndUserRecordInPeriod(requestUser, requestPark, st return meter.Code == elem.MeterId }) if has { - elem.Address = *archive.Address - elem.CustomerName = *archive.CustomerName + elem.Address = archive.Address + elem.CustomerName = archive.CustomerName elem.IsPublicMeter = archive.IsPublicMeter elem.Kind = archive.ParkDetail.SubmeterType } - if !elem.Overall.Decimal.IsZero() { + if !elem.OverallFee.Decimal.IsZero() { elem.AdjustProportion = decimal.NewNullDecimal( elem.AdjustFee.Decimal.Div(elem.OverallFee.Decimal).RoundBank(8), ) + } else { + elem.AdjustProportion = decimal.NullDecimal{} } return elem },