Browse Source

fix:eta表格去掉缓存

Roc 10 months ago
parent
commit
dae4a64e9d
1 changed files with 33 additions and 33 deletions
  1. 33 33
      controllers/excel_info.go

+ 33 - 33
controllers/excel_info.go

@@ -9,7 +9,6 @@ import (
 	"eta/eta_chart_lib/services/data/table"
 	"eta/eta_chart_lib/services/excel"
 	"eta/eta_chart_lib/utils"
-	"fmt"
 	"github.com/shopspring/decimal"
 	"time"
 )
@@ -42,39 +41,40 @@ func (this *ExcelInfoController) GetTableDetail() {
 	fromScene, _ := this.GetInt("FromScene", 0)
 	key := utils.HZ_CHART_LIB_EXCEL_TABLE_DETAIL + ":" + uniqueCode
 	resp := new(response.ExcelTableDetailResp)
-	//判断是否有缓存
-	if utils.Re == nil {
-		if utils.Re == nil && utils.Rc.IsExist(key) {
-			if data, err1 := utils.Rc.RedisBytes(key); err1 == nil {
-				err := json.Unmarshal(data, &resp)
-				if err == nil && resp != nil {
-					// 配置项
-					config := response.ExcelTableDetailConfigResp{
-						FontSize: 9,
-					}
-					// 获取配置的字体大小
-					confName := models.FromSceneMap[fromScene]
-					if confName != `` {
-						busConf, err := models.GetBusinessConfByKey(confName)
-						if err == nil {
-							sizeDeci, err := decimal.NewFromString(busConf.ConfVal)
-							if err == nil {
-								config.FontSize = int(sizeDeci.IntPart())
-							}
-						}
-					}
-					resp.Config = config
 
-					br.Ret = 200
-					br.Success = true
-					br.Msg = "获取成功"
-					br.Data = resp
-					fmt.Println("source redis")
-					return
-				}
-			}
-		}
-	}
+	//判断是否有缓存
+	//if utils.Re == nil {
+	//	if utils.Re == nil && utils.Rc.IsExist(key) {
+	//		if data, err1 := utils.Rc.RedisBytes(key); err1 == nil {
+	//			err := json.Unmarshal(data, &resp)
+	//			if err == nil && resp != nil {
+	//				// 配置项
+	//				config := response.ExcelTableDetailConfigResp{
+	//					FontSize: 9,
+	//				}
+	//				// 获取配置的字体大小
+	//				confName := models.FromSceneMap[fromScene]
+	//				if confName != `` {
+	//					busConf, err := models.GetBusinessConfByKey(confName)
+	//					if err == nil {
+	//						sizeDeci, err := decimal.NewFromString(busConf.ConfVal)
+	//						if err == nil {
+	//							config.FontSize = int(sizeDeci.IntPart())
+	//						}
+	//					}
+	//				}
+	//				resp.Config = config
+	//
+	//				br.Ret = 200
+	//				br.Success = true
+	//				br.Msg = "获取成功"
+	//				br.Data = resp
+	//				fmt.Println("source redis")
+	//				return
+	//			}
+	//		}
+	//	}
+	//}
 
 	excelInfo, err := models.GetExcelInfoByUniqueCode(uniqueCode)
 	if err != nil {