|
|
@@ -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 |
|
|
|