From de6e24dcd314dcbb9b5c5ae3d9cbf4ce74d6ca64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Thu, 22 Sep 2022 14:14:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(enduser):=E4=BF=AE=E6=AD=A3=E5=BD=93?= =?UTF-8?q?=E6=88=B7=E5=9D=80=E4=B8=8E=E6=88=B7=E5=90=8D=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E5=87=BA=E7=8E=B0=E7=9A=84=E7=A9=BA?= =?UTF-8?q?=E6=8C=87=E9=92=88=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/end_user_detail.go | 4 ++-- service/end_user.go | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) 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 },