This commit is contained in:
2026-02-24 16:29:28 +08:00
parent 5340b07795
commit 24fe2a97cf
8 changed files with 411 additions and 58 deletions

View File

@@ -19,8 +19,7 @@ func (r *RuleFactory) RunRoe(code string) {
var data models.StockFinaIndicator
err := impl.DBService.Where("ts_code = ?", code).Order("period desc").Limit(1).First(&data).Error
if err != nil {
r.Model.GtRoe = -1
r.Model.ValRoe = -1
r.Model.RoeScore = -1
r.Model.AddDesc("最近无财报无ROE值")
return
}
@@ -29,12 +28,13 @@ func (r *RuleFactory) RunRoe(code string) {
r.Model.ValRoe = data.Roe
if data.Roe < MinRoe {
r.Model.GtRoe = -1
r.Model.RoeScore = -1
r.Model.AddDesc(fmt.Sprintf("ROE=%.2f 低于%.2f", data.Roe, MinRoe))
return
}
r.Model.GtRoe = 1
r.Model.RoeScore = 1
r.Model.ValRoe = data.Roe
r.Model.AddDesc(fmt.Sprintf("ROE=%.2f 高于%.2f", data.Roe, MinRoe))
return
}