Browse Source

fix:日志记录

zqbao 8 months ago
parent
commit
0d779bef79
1 changed files with 7 additions and 3 deletions
  1. 7 3
      controllers/base_from_mysteel_chemical.go

+ 7 - 3
controllers/base_from_mysteel_chemical.go

@@ -92,6 +92,7 @@ func (this *MySteelChemicalController) Refresh() {
 		br.ErrMsg = "请输入指标ID"
 		return
 	}
+
 	cacheKey = utils.CACHE_EDB_DATA_REFRESH + strconv.Itoa(source) + "_" + req.EdbCode
 	if utils.Rc.IsExist(cacheKey) {
 		br.Ret = 501
@@ -131,10 +132,14 @@ func (this *MySteelChemicalController) Refresh() {
 			return
 		}
 		// 添加指标刷新成功日志
+		isSourceRefresh := 0
+		if utils.MysteelChemicalApiToken != "" {
+			isSourceRefresh = 1
+		}
 		if erDataUpdateDate != "" {
-			_ = services.AddEdbInfoUpdateLog(edbInfo.EdbInfoId, 1, "", 1, "", 0, 0)
+			_ = services.AddEdbInfoUpdateLog(edbInfo.EdbInfoId, 1, "", 1, "", isSourceRefresh, 0)
 		} else {
-			_ = services.AddEdbInfoUpdateLog(edbInfo.EdbInfoId, 1, "", 2, "未刷新到数据", 0, 0)
+			_ = services.AddEdbInfoUpdateLog(edbInfo.EdbInfoId, 1, "", 2, "未刷新到数据", isSourceRefresh, 0)
 		}
 
 		// 更新ES
@@ -146,7 +151,6 @@ func (this *MySteelChemicalController) Refresh() {
 		_ = services.SetMysteelChemicalEdbInfoUpdateStat(false)
 		_ = services.SetEdbSourceStat(false)
 	}
-
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"