fix(#26): 修复获取公摊表计下的摊薄表计失败[如果没有公摊关系,则无提示,无显示信息]
This commit is contained in:
parent
292a50029f
commit
032d38181a
|
@ -10,7 +10,7 @@ import (
|
|||
"electricity_bill_calc/tools"
|
||||
"electricity_bill_calc/types"
|
||||
"electricity_bill_calc/vo"
|
||||
"fmt"
|
||||
|
||||
"log"
|
||||
"strconv"
|
||||
|
||||
|
@ -291,8 +291,6 @@ func listPublicMetersInReport(c *fiber.Ctx) error {
|
|||
|
||||
var meterResponses []vo.Public
|
||||
for _, meter := range meters {
|
||||
fmt.Println("000",meter.ParkMeterID)
|
||||
fmt.Println("000",meter)
|
||||
meterResponse := vo.Public{
|
||||
Address: meter.Address,
|
||||
AdjustLoss: model.ConsumptionUnit{
|
||||
|
@ -324,7 +322,7 @@ func listPublicMetersInReport(c *fiber.Ctx) error {
|
|||
|
||||
meterResponses = append(meterResponses, meterResponse)
|
||||
}
|
||||
fmt.Println(meterResponses)
|
||||
|
||||
return result.Success(
|
||||
"已经获取到指定核算报表中的分页公共表计的核算信息。",
|
||||
response.NewPagedResponse(page, total).ToMap(),
|
||||
|
|
|
@ -10,6 +10,8 @@ import (
|
|||
"electricity_bill_calc/types"
|
||||
"electricity_bill_calc/vo"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
|
@ -307,7 +309,6 @@ func (rr _ReportRepository) RetrieveReportSummary(rid string) (*model.ReportSumm
|
|||
Select("*").
|
||||
Where(goqu.I("report_id").Eq(rid)).
|
||||
Prepared(true).ToSQL()
|
||||
log.Println(">>>>>>>>>>>>>>>.", querySql)
|
||||
var summary model.ReportSummary
|
||||
if err := pgxscan.Get(ctx, global.DB, &summary, querySql, queryParams...); err != nil {
|
||||
rr.log.Error("获取指定报表的总览信息时出现错误", zap.Error(err))
|
||||
|
@ -503,6 +504,10 @@ func (rr _ReportRepository) ListPooledMeterDetailInReport(rid, mid string) ([]*m
|
|||
rr.log.Error("列出指定核算报表中指定公共表计下参与公共表计费用分摊的表计详细时出现错误", zap.Error(err))
|
||||
return make([]*model.ReportDetailNestedMeterConsumption, 0), err
|
||||
}
|
||||
|
||||
if len(meterDetails) <= 0 {
|
||||
return make([]*model.ReportDetailNestedMeterConsumption, 0), errors.New("暂无分摊关系")
|
||||
}
|
||||
assembled := lo.Map(meter.Diluted, func(m model.NestedMeter, _ int) *model.ReportDetailNestedMeterConsumption {
|
||||
meterDetail, _ := lo.Find(meterDetails, func(elem *model.MeterDetail) bool {
|
||||
return elem.Code == m.MeterId
|
||||
|
|
|
@ -12,9 +12,9 @@ Server:
|
|||
ReadTimeout: 60
|
||||
WriteTimeout: 60
|
||||
Redis:
|
||||
Host: 192.168.88.129
|
||||
Host: 127.0.0.1
|
||||
Port: 6379
|
||||
Password: 123456
|
||||
Password:
|
||||
DB: 1
|
||||
Service:
|
||||
MaxSessionLife: 2h
|
||||
|
|
Loading…
Reference in New Issue
Block a user