|
@@ -8,6 +8,7 @@ import (
|
|
|
"eta/eta_mobile/services/excel"
|
|
|
"eta/eta_mobile/utils"
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
+ "github.com/shopspring/decimal"
|
|
|
)
|
|
|
|
|
|
// ExcelInfoController ETA表格管理
|
|
@@ -115,6 +116,7 @@ func (this *ExcelInfoController) List() {
|
|
|
// @Title 获取excel表格的table数据
|
|
|
// @Description 获取excel表格的table数据接口
|
|
|
// @Param UniqueCode query string true "表格code"
|
|
|
+// @Param FromScene query int true "场景来源,1:智能研报,2:研报列表;3:英文研报;4:中文PPT;5:英文PPT"
|
|
|
// @Success 200 {object} response.ExcelTableDetailResp
|
|
|
// @router /excel_info/table_data [get]
|
|
|
func (this *ExcelInfoController) GetExcelTableData() {
|
|
@@ -131,6 +133,7 @@ func (this *ExcelInfoController) GetExcelTableData() {
|
|
|
return
|
|
|
}
|
|
|
uniqueCode := this.GetString("UniqueCode")
|
|
|
+ fromScene, _ := this.GetInt("FromScene", 0)
|
|
|
|
|
|
var err error
|
|
|
if uniqueCode == `` {
|
|
@@ -166,12 +169,28 @@ func (this *ExcelInfoController) GetExcelTableData() {
|
|
|
}
|
|
|
|
|
|
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 := response.ExcelTableDetailResp{
|
|
|
UniqueCode: excelInfo.UniqueCode,
|
|
|
ExcelImage: excelInfo.ExcelImage,
|
|
|
ExcelName: excelInfo.ExcelName,
|
|
|
TableInfo: tableData,
|
|
|
+ Config: config,
|
|
|
}
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|