|
@@ -10,6 +10,7 @@ import (
|
|
|
"eta/eta_chart_lib/services/excel"
|
|
|
"eta/eta_chart_lib/utils"
|
|
|
"fmt"
|
|
|
+ "github.com/shopspring/decimal"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -22,6 +23,7 @@ type ExcelInfoController struct {
|
|
|
// @Title 获取表格表详情
|
|
|
// @Description 获取表格表详情接口
|
|
|
// @Param UniqueCode query string true "表格表唯一编码,如果是管理后台访问,传固定字符串:7c69b590249049942070ae9dcd5bf6dc"
|
|
|
+// @Param FromScene query int true "场景来源,1:智能研报,2:研报列表;3:英文研报;4:中文PPT;5:英文PPT"
|
|
|
// @Success 200 {object} response.ExcelTableDetailResp
|
|
|
// @router /detail [get]
|
|
|
func (this *ExcelInfoController) GetTableDetail() {
|
|
@@ -37,6 +39,7 @@ func (this *ExcelInfoController) GetTableDetail() {
|
|
|
br.ErrMsg = "参数错误,uniqueCode is empty"
|
|
|
return
|
|
|
}
|
|
|
+ fromScene, _ := this.GetInt("FromScene", 0)
|
|
|
key := utils.HZ_CHART_LIB_EXCEL_TABLE_DETAIL + ":" + uniqueCode
|
|
|
resp := new(response.ExcelTableDetailResp)
|
|
|
//判断是否有缓存
|
|
@@ -128,6 +131,21 @@ func (this *ExcelInfoController) GetTableDetail() {
|
|
|
}
|
|
|
|
|
|
tableData = excel.HandleTableCell(tableData)
|
|
|
+ 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.TableInfo = tableData
|
|
|
resp.Source = excelInfo.Source
|
|
@@ -135,6 +153,7 @@ func (this *ExcelInfoController) GetTableDetail() {
|
|
|
resp.ExcelName = excelInfo.ExcelName
|
|
|
resp.ExcelImage = excelInfo.ExcelImage
|
|
|
resp.UniqueCode = excelInfo.UniqueCode
|
|
|
+ resp.Config = config
|
|
|
|
|
|
if utils.Re == nil {
|
|
|
data, _ := json.Marshal(resp)
|