|
@@ -12,6 +12,7 @@ import (
|
|
|
"eta/eta_chart_lib/utils"
|
|
|
"fmt"
|
|
|
"github.com/shopspring/decimal"
|
|
|
+ "strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -124,14 +125,14 @@ func (this *ExcelInfoController) GetTableDetail() {
|
|
|
br.ErrMsg = "转换成table失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- //sourceNameList, sourceNameEnList, err := data.GetEdbSourceByEdbInfoIdListForExcel(result.EdbInfoIdList)
|
|
|
- //if err != nil {
|
|
|
- // br.Msg = "自定义表格数据获取失败"
|
|
|
- // br.ErrMsg = "自定义表格数据获取失败,Err:" + err.Error()
|
|
|
- // return
|
|
|
- //}
|
|
|
- //resp.ExcelSource = strings.Join(sourceNameList, ",")
|
|
|
- //resp.ExcelSourceEn = strings.Join(sourceNameEnList, ",")
|
|
|
+ sourceNameList, sourceNameEnList, err := data.GetEdbSourceByEdbInfoIdListForExcel(result.EdbInfoIdList)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "自定义表格数据获取失败"
|
|
|
+ br.ErrMsg = "自定义表格数据获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.ExcelSource = strings.Join(sourceNameList, ",")
|
|
|
+ resp.ExcelSourceEn = strings.Join(sourceNameEnList, ",")
|
|
|
case utils.MIXED_TABLE:
|
|
|
var result request.MixedTableReq
|
|
|
err = json.Unmarshal([]byte(excelInfo.Content), &result)
|
|
@@ -155,26 +156,26 @@ func (this *ExcelInfoController) GetTableDetail() {
|
|
|
br.ErrMsg = "转换成table失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- //edbInfoIds := make([]int, 0)
|
|
|
- //edbInfoIdExist := make(map[int]bool)
|
|
|
- //if len(newResult) > 0 {
|
|
|
- // for _, t := range newResult {
|
|
|
- // for _, v := range t {
|
|
|
- // if v.EdbInfoId > 0 && !edbInfoIdExist[v.EdbInfoId] {
|
|
|
- // edbInfoIdExist[v.EdbInfoId] = true
|
|
|
- // edbInfoIds = append(edbInfoIds, v.EdbInfoId)
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
- //sourceNameList, sourceNameEnList, err := data.GetEdbSourceByEdbInfoIdListForExcel(edbInfoIds)
|
|
|
- //if err != nil {
|
|
|
- // br.Msg = "自定义表格数据获取失败"
|
|
|
- // br.ErrMsg = "自定义表格数据获取失败,Err:" + err.Error()
|
|
|
- // return
|
|
|
- //}
|
|
|
- //resp.ExcelSource = strings.Join(sourceNameList, ",")
|
|
|
- //resp.ExcelSourceEn = strings.Join(sourceNameEnList, ",")
|
|
|
+ edbInfoIds := make([]int, 0)
|
|
|
+ edbInfoIdExist := make(map[int]bool)
|
|
|
+ if len(newResult) > 0 {
|
|
|
+ for _, t := range newResult {
|
|
|
+ for _, v := range t {
|
|
|
+ if v.EdbInfoId > 0 && !edbInfoIdExist[v.EdbInfoId] {
|
|
|
+ edbInfoIdExist[v.EdbInfoId] = true
|
|
|
+ edbInfoIds = append(edbInfoIds, v.EdbInfoId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sourceNameList, sourceNameEnList, err := data.GetEdbSourceByEdbInfoIdListForExcel(edbInfoIds)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "自定义表格数据获取失败"
|
|
|
+ br.ErrMsg = "自定义表格数据获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.ExcelSource = strings.Join(sourceNameList, ",")
|
|
|
+ resp.ExcelSourceEn = strings.Join(sourceNameEnList, ",")
|
|
|
}
|
|
|
|
|
|
tableData = excel.HandleTableCell(tableData)
|
|
@@ -201,7 +202,7 @@ func (this *ExcelInfoController) GetTableDetail() {
|
|
|
resp.ExcelImage = excelInfo.ExcelImage
|
|
|
resp.UniqueCode = excelInfo.UniqueCode
|
|
|
resp.Config = config
|
|
|
- //resp.SourcesFrom = excelInfo.SourcesFrom
|
|
|
+ resp.SourcesFrom = excelInfo.SourcesFrom
|
|
|
|
|
|
if utils.Re == nil {
|
|
|
data, _ := json.Marshal(resp)
|