Browse Source

fix: update auto socre consume

master
shenjiachi 1 week ago
parent
commit
db36558395
1 changed files with 4 additions and 6 deletions
  1. +4
    -6
      consume/egg_energy_auto_score_consume.go

+ 4
- 6
consume/egg_energy_auto_score_consume.go View File

@@ -7,7 +7,6 @@ import (
"applet/consume/md"
"bytes"
"code.fnuoos.com/EggPlanet/egg_system_rules.git"
md3 "code.fnuoos.com/EggPlanet/egg_system_rules.git/md"
md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md"
es2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/utils/es"
"code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es"
@@ -121,17 +120,16 @@ func handleEggEnergyAutoScoreDataConsume(msgData []byte) error {
}

// 3. 更新上周得分
esScore := md3.EggEnergyUserEggScoreEs{
ScoreValue: score.PredictedScore,
ScoreValueKind: 2,
}
updateMap := make(map[string]interface{})
updateMap["score_value"] = score.PredictedScore
updateMap["score_value_kind"] = 2
now := time.Now()
lastWeek := now.AddDate(0, 0, -7)
year, week := lastWeek.ISOWeek()
yearString := utils2.IntToStr(year)
weekString := utils2.IntToStr(week)
LastWeekIndex := es2.GetAppointIndexFromAlias(yearString, weekString)
updateDocRet, err := es.UpdateDoc(LastWeekIndex, msg.DocId, esScore)
updateDocRet, err := es.UpdateDoc(LastWeekIndex, msg.DocId, updateMap)
if err != nil {
fmt.Println("EggEnergyAutoScoreConsumeFailedUpdateEs_ERR:::::", err.Error())
return err


Loading…
Cancel
Save