From 712d704004250e1c6b0afaf23c1ca07953ebddfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Thu, 22 Sep 2022 17:04:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(enduser):=E8=B0=83=E6=95=B4=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=BB=88=E7=AB=AF=E7=94=A8=E6=88=B7=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E7=94=B5=E8=B4=B9=E7=BB=9F=E8=AE=A1=E9=83=A8=E5=88=86=E7=9A=84?= =?UTF-8?q?=E7=A9=BA=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 | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/model/end_user_detail.go b/model/end_user_detail.go index fbf65fb..02522d6 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 60e71da..873a377 100644 --- a/service/end_user.go +++ b/service/end_user.go @@ -450,8 +450,16 @@ func (es _EndUserService) StatEndUserRecordInPeriod(requestUser, requestPark, st return meter.Code == elem.MeterId }) if has { - elem.Address = archive.Address - elem.CustomerName = archive.CustomerName + if archive.Address != nil { + elem.Address = *archive.Address + } else { + elem.Address = "" + } + if archive.CustomerName != nil { + elem.CustomerName = *archive.CustomerName + } else { + elem.CustomerName = "" + } elem.IsPublicMeter = archive.IsPublicMeter elem.Kind = archive.ParkDetail.SubmeterType }