This commit is contained in:
yanweidong
2026-02-01 14:57:20 +08:00
parent ec0fb57d1f
commit d89d7967b8
7 changed files with 108 additions and 60 deletions

View File

@@ -19,20 +19,22 @@ 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.GtAmount = -1
r.Model.GtRoe = -1
r.Model.ValRoe = -1
r.Model.AddDesc("最近无财报无ROE值")
return
}
data.Roe = utils.FloatRound(data.Roe, 2)
r.Model.ValRoe = data.Roe
if data.Roe < MinRoe {
r.Model.GtAmount = -1
r.Model.GtRoe = -1
r.Model.AddDesc(fmt.Sprintf("ROE=%.2f 低于%.2f", data.Roe, MinRoe))
return
}
r.Model.GtAmount = 1
r.Model.GtRoe = 1
r.Model.AddDesc(fmt.Sprintf("ROE=%.2f 高于%.2f", data.Roe, MinRoe))
return
}