fix(enduser):调整更新终端用户调整电费统计部分的空指针问题。
This commit is contained in:
parent
502a8bbcee
commit
712d704004
|
@ -114,8 +114,8 @@ type EndUserImport struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type EndUserPeriodStat struct {
|
type EndUserPeriodStat struct {
|
||||||
CustomerName *string `json:"customerName"`
|
CustomerName string `json:"customerName"`
|
||||||
Address *string `json:"address"`
|
Address string `json:"address"`
|
||||||
MeterId string `bun:"meter_04kv_id" json:"meterId"`
|
MeterId string `bun:"meter_04kv_id" json:"meterId"`
|
||||||
IsPublicMeter bool `bun:"public_meter" json:"isPublicMeter"`
|
IsPublicMeter bool `bun:"public_meter" json:"isPublicMeter"`
|
||||||
Kind int8 `bun:"-" json:"pvKind"`
|
Kind int8 `bun:"-" json:"pvKind"`
|
||||||
|
|
|
@ -450,8 +450,16 @@ func (es _EndUserService) StatEndUserRecordInPeriod(requestUser, requestPark, st
|
||||||
return meter.Code == elem.MeterId
|
return meter.Code == elem.MeterId
|
||||||
})
|
})
|
||||||
if has {
|
if has {
|
||||||
elem.Address = archive.Address
|
if archive.Address != nil {
|
||||||
elem.CustomerName = archive.CustomerName
|
elem.Address = *archive.Address
|
||||||
|
} else {
|
||||||
|
elem.Address = ""
|
||||||
|
}
|
||||||
|
if archive.CustomerName != nil {
|
||||||
|
elem.CustomerName = *archive.CustomerName
|
||||||
|
} else {
|
||||||
|
elem.CustomerName = ""
|
||||||
|
}
|
||||||
elem.IsPublicMeter = archive.IsPublicMeter
|
elem.IsPublicMeter = archive.IsPublicMeter
|
||||||
elem.Kind = archive.ParkDetail.SubmeterType
|
elem.Kind = archive.ParkDetail.SubmeterType
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user