doc(calculate): 优化代码格式,删除部分无用打印语句
This commit is contained in:
parent
59a604bab0
commit
0f91b8a332
|
@ -100,7 +100,6 @@ func initNewReportCalculateTask(c *fiber.Ctx) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
ok, err := service.ReportService.CreateNewReport(&form)
|
ok, err := service.ReportService.CreateNewReport(&form)
|
||||||
log.Println("??????????????????????kkkkkkkkkkkkkkkkkkkkkkkkk", ok)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
reportLog.Error("无法创建核算报表", zap.Error(err))
|
reportLog.Error("无法创建核算报表", zap.Error(err))
|
||||||
return result.Error(fiber.StatusInternalServerError, "无法创建核算报表。")
|
return result.Error(fiber.StatusInternalServerError, "无法创建核算报表。")
|
||||||
|
|
|
@ -13,7 +13,6 @@ import (
|
||||||
"github.com/jackc/pgx/v5"
|
"github.com/jackc/pgx/v5"
|
||||||
"github.com/shopspring/decimal"
|
"github.com/shopspring/decimal"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
"log"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/doug-martin/goqu/v9"
|
"github.com/doug-martin/goqu/v9"
|
||||||
|
@ -40,7 +39,7 @@ func (cr _CalculateRepository) UpdateReportCalculateStatus(rid string, status st
|
||||||
|
|
||||||
var atio int
|
var atio int
|
||||||
var err error
|
var err error
|
||||||
log.Println("11111111111", status)
|
|
||||||
currentTime := time.Now()
|
currentTime := time.Now()
|
||||||
if status == "success" {
|
if status == "success" {
|
||||||
atio = 1 //创建报表成功
|
atio = 1 //创建报表成功
|
||||||
|
|
|
@ -217,7 +217,7 @@ func (rs _ReportService) CreateNewReport(createFrom *vo.ReportCreationForm) (boo
|
||||||
rs.log.Error("创建核算报表错误", zap.Error(err))
|
rs.log.Error("创建核算报表错误", zap.Error(err))
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
log.Println("创建成功,successsssssssssssssssssssssssssssssssssssssssssssssssssssss")
|
|
||||||
|
|
||||||
if !state {
|
if !state {
|
||||||
status, err := repository.CalculateRepository.UpdateReportCalculateStatus(report, "InsufficientData",
|
status, err := repository.CalculateRepository.UpdateReportCalculateStatus(report, "InsufficientData",
|
||||||
|
@ -228,13 +228,13 @@ func (rs _ReportService) CreateNewReport(createFrom *vo.ReportCreationForm) (boo
|
||||||
}
|
}
|
||||||
return status, nil
|
return status, nil
|
||||||
}
|
}
|
||||||
log.Println("更新成功succssssssssssssssss")
|
|
||||||
err = rs.CalculateReport(report)
|
err = rs.CalculateReport(report)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
rs.log.Error("计算时出错", zap.Error(err))
|
rs.log.Error("计算时出错", zap.Error(err))
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
log.Println("返回truettttttttttttttttttt")
|
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ func (rs _ReportService) CalculateReport(rid string) error {
|
||||||
//defer semaphore.Unlock()
|
//defer semaphore.Unlock()
|
||||||
|
|
||||||
errs := calculate.MainCalculateProcess(rid)
|
errs := calculate.MainCalculateProcess(rid)
|
||||||
log.Println("开始计算555555555555555555555555555")
|
|
||||||
if errs == nil {
|
if errs == nil {
|
||||||
_, err := repository.CalculateRepository.UpdateReportCalculateStatus(rid, "success", "")
|
_, err := repository.CalculateRepository.UpdateReportCalculateStatus(rid, "success", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user