From b69af23f1344a1a3320b63de508e85fb0cc7f427 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 27 Dec 2024 18:31:36 +0800 Subject: [PATCH 1/3] fix: return index id when get user egg flow --- app/svc/egg_energy/svc_egg_energy.go | 1 + go.mod | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/svc/egg_energy/svc_egg_energy.go b/app/svc/egg_energy/svc_egg_energy.go index d62586c..1fc916e 100644 --- a/app/svc/egg_energy/svc_egg_energy.go +++ b/app/svc/egg_energy/svc_egg_energy.go @@ -91,6 +91,7 @@ func QueryElasticsearch(req md2.UserEggFlowReq, indexName string) (resp []md2.Us if err != nil { return } + doc.IndexId = hit.Index resp = append(resp, doc) } total = searchResult.Hits.TotalHits.Value diff --git a/go.mod b/go.mod index 8ace5cf..134ed62 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( ) require ( - code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241227063935-e6bf4d057f14 + code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241227102847-f4a6450c27aa code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241227073118-a441564375e2 code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 From 4f406b8bf4ac69f9fa3b3e81cbe1568342df8df4 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 27 Dec 2024 18:36:53 +0800 Subject: [PATCH 2/3] fix: change personAddActivityValue struct when ManualScore --- app/hdl/institutional_management/egg_energy/hdl_egg_point.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/hdl/institutional_management/egg_energy/hdl_egg_point.go b/app/hdl/institutional_management/egg_energy/hdl_egg_point.go index cad2359..36f673e 100644 --- a/app/hdl/institutional_management/egg_energy/hdl_egg_point.go +++ b/app/hdl/institutional_management/egg_energy/hdl_egg_point.go @@ -323,7 +323,7 @@ func ManualScore(c *gin.Context) { CollegeLearningNums: scoreDoc.CollegeLearningNums, ViolateNums: scoreDoc.ViolateNums, BrowseInterfaceNums: scoreDoc.BrowseInterfaceNums, - PersonAddActivityValue: scoreDoc.PersonAddActivityValue, + PersonAddActivityValue: utils.Float64ToStr(scoreDoc.PersonAddActivityValue), Score: req.Score, Date: fmt.Sprintf("%s-%s", year, week), CreateAt: now.Format("2006-01-02 15:04:05"), From 94983d8468f82df585585a074adb40e433814a91 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 27 Dec 2024 19:19:42 +0800 Subject: [PATCH 3/3] update --- app/svc/egg_energy/svc_egg_energy.go | 2 +- app/task/svc/svc_egg_energy_automatic_scoring_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/svc/egg_energy/svc_egg_energy.go b/app/svc/egg_energy/svc_egg_energy.go index 1fc916e..86903b2 100644 --- a/app/svc/egg_energy/svc_egg_energy.go +++ b/app/svc/egg_energy/svc_egg_energy.go @@ -91,7 +91,7 @@ func QueryElasticsearch(req md2.UserEggFlowReq, indexName string) (resp []md2.Us if err != nil { return } - doc.IndexId = hit.Index + doc.IndexId = hit.Id resp = append(resp, doc) } total = searchResult.Hits.TotalHits.Value diff --git a/app/task/svc/svc_egg_energy_automatic_scoring_test.go b/app/task/svc/svc_egg_energy_automatic_scoring_test.go index 4724d68..b024e0b 100644 --- a/app/task/svc/svc_egg_energy_automatic_scoring_test.go +++ b/app/task/svc/svc_egg_energy_automatic_scoring_test.go @@ -8,8 +8,8 @@ import ( ) func TestCreateEsIndex(t *testing.T) { - es.Init("http://123.57.140.192:9200", "elastic", "fnuo123") - nextWeekIndex := "egg_energy_user_egg_score_202453" + es.Init("http://120.55.48.175:9200", "elastic", "fnuo123") + nextWeekIndex := "egg_energy_user_egg_score_202452" for { err := es.CreateIndexIfNotExists(nextWeekIndex, md.EggEnergyUserEggScoreEsMapping) if err != nil {