forked from free-lancers/electricity_bill_calc_service
enhance(report):增加检查录入园区电量的功能。
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/shopspring/decimal"
|
||||
"xorm.io/builder"
|
||||
)
|
||||
|
||||
@@ -151,3 +152,8 @@ func (_ReportService) RetreiveParkSummary(rid string) (*model.ReportSummary, err
|
||||
}
|
||||
return summary, nil
|
||||
}
|
||||
|
||||
func (_ReportService) CheckSummaryOverall(summary model.ReportSummary) bool {
|
||||
var sum = decimal.Sum(summary.Critical, summary.Peak, summary.Valley)
|
||||
return sum.LessThan(summary.Overall)
|
||||
}
|
||||
|
Reference in New Issue
Block a user