fix(report):修复更新指定的核算任务与初始化一个新的核算任务
This commit is contained in:
parent
27a499b8cc
commit
69357f77dd
|
@ -96,7 +96,7 @@ func initNewReportCalculateTask(c *fiber.Ctx) error {
|
|||
if pass, err := checkParkBelongs(form.Park, reportLog, c, &result); !pass {
|
||||
return err
|
||||
}
|
||||
ok, err := repository.ReportRepository.CreateReport(&form)
|
||||
ok, err := service.ReportService.CreateNewReport(&form)
|
||||
if err != nil {
|
||||
reportLog.Error("无法创建核算报表", zap.Error(err))
|
||||
return result.Error(fiber.StatusInternalServerError, "无法创建核算报表。")
|
||||
|
@ -120,7 +120,7 @@ func updateReportCalculateTask(c *fiber.Ctx) error {
|
|||
reportLog.Error("无法解析更新核算报表的请求数据。", zap.Error(err))
|
||||
return result.BadRequest("无法解析更新核算报表的请求数据。")
|
||||
}
|
||||
ok, err := repository.ReportRepository.UpdateReportSummary(reportId, &form)
|
||||
ok, err := service.ReportService.UpdateRepoet(reportId, &form)
|
||||
if err != nil {
|
||||
reportLog.Error("无法更新核算报表", zap.Error(err))
|
||||
return result.Error(fiber.StatusInternalServerError, "无法更新核算报表。")
|
||||
|
|
3
go.mod
3
go.mod
|
@ -11,6 +11,7 @@ require (
|
|||
github.com/jinzhu/copier v0.3.5
|
||||
github.com/liamylian/jsontime/v2 v2.0.0
|
||||
github.com/mozillazg/go-pinyin v0.20.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/rueian/rueidis v0.0.100
|
||||
github.com/samber/lo v1.38.1
|
||||
github.com/shopspring/decimal v1.3.1
|
||||
|
@ -18,6 +19,7 @@ require (
|
|||
github.com/valyala/fasthttp v1.47.0
|
||||
github.com/xuri/excelize/v2 v2.7.1
|
||||
go.uber.org/zap v1.24.0
|
||||
golang.org/x/sync v0.2.0
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1
|
||||
)
|
||||
|
||||
|
@ -37,7 +39,6 @@ require (
|
|||
github.com/tinylib/msgp v1.1.8 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||
golang.org/x/sync v0.2.0 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
|
|
|
@ -3,6 +3,7 @@ package calculate
|
|||
import (
|
||||
"electricity_bill_calc/model"
|
||||
"fmt"
|
||||
"github.com/shopspring/decimal"
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
|
@ -17,7 +18,7 @@ func CheckMeterArea(report *model.ReportIndex, meters []*model.MeterDetail) (boo
|
|||
|
||||
for _, m := range meters {
|
||||
if (m.MeterType == model.METER_INSTALLATION_TENEMENT || m.MeterType == model.METER_INSTALLATION_POOLING) &&
|
||||
m.Area == nil {
|
||||
m.Area.Decimal == decimal.Zero {
|
||||
atomic.AddInt32(&meterWithoutArea, 1)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user