forked from free-lancers/electricity_bill_calc_service
		
	enhance(enduser):终端用户统计部分增加终端用户表计类型。
This commit is contained in:
		| @@ -118,6 +118,7 @@ type EndUserPeriodStat struct { | |||||||
| 	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"` | ||||||
| 	Overall          decimal.NullDecimal `json:"overall"` | 	Overall          decimal.NullDecimal `json:"overall"` | ||||||
| 	Critical         decimal.NullDecimal `json:"critical"` | 	Critical         decimal.NullDecimal `json:"critical"` | ||||||
| 	Peak             decimal.NullDecimal `json:"peak"` | 	Peak             decimal.NullDecimal `json:"peak"` | ||||||
|   | |||||||
| @@ -435,7 +435,7 @@ func (es _EndUserService) StatEndUserRecordInPeriod(requestUser, requestPark, st | |||||||
| 	) | 	) | ||||||
| 	meterArchives := make([]model.Meter04KV, 0) | 	meterArchives := make([]model.Meter04KV, 0) | ||||||
| 	if len(meterIds.ToSlice()) > 0 { | 	if len(meterIds.ToSlice()) > 0 { | ||||||
| 		err = global.DB.NewSelect().Model(&meterArchives). | 		err = global.DB.NewSelect().Model(&meterArchives).Relation("ParkDetail"). | ||||||
| 			Where("code in (?)", bun.In(meterIds.ToSlice())). | 			Where("code in (?)", bun.In(meterIds.ToSlice())). | ||||||
| 			Scan(ctx) | 			Scan(ctx) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| @@ -452,6 +452,7 @@ func (es _EndUserService) StatEndUserRecordInPeriod(requestUser, requestPark, st | |||||||
| 				elem.Address = *archive.Address | 				elem.Address = *archive.Address | ||||||
| 				elem.CustomerName = *archive.CustomerName | 				elem.CustomerName = *archive.CustomerName | ||||||
| 				elem.IsPublicMeter = archive.IsPublicMeter | 				elem.IsPublicMeter = archive.IsPublicMeter | ||||||
|  | 				elem.Kind = archive.ParkDetail.SubmeterType | ||||||
| 			} | 			} | ||||||
| 			if !elem.Overall.Decimal.IsZero() { | 			if !elem.Overall.Decimal.IsZero() { | ||||||
| 				elem.AdjustProportion = decimal.NewNullDecimal( | 				elem.AdjustProportion = decimal.NewNullDecimal( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user