Browse Source

Merge branch 'eta_mobile_2.0'

xiziwen 1 day ago
parent
commit
6d362d37ca
1 changed files with 43 additions and 0 deletions
  1. 43 0
      controllers/excel_info.go

+ 43 - 0
controllers/excel_info.go

@@ -181,6 +181,49 @@ func (this *ExcelInfoController) GetTableDetail() {
 		}
 		resp.ExcelSource = strings.Join(sourceNameList, ",")
 		resp.ExcelSourceEn = strings.Join(sourceNameEnList, ",")
+	case utils.BALANCE_TABLE:
+		var result request.MixedTableReq
+		err = json.Unmarshal([]byte(excelInfo.Content), &result)
+		if err != nil {
+			br.Msg = "获取失败"
+			br.ErrMsg = "表格json转结构体失败,Err:" + err.Error()
+			return
+		}
+		newResult, tmpErr, tmpErrMsg := excel2.GetMixedTableCellData(result, this.Lang)
+		if tmpErr != nil {
+			br.Msg = "获取失败"
+			if tmpErrMsg != `` {
+				br.Msg = tmpErrMsg
+			}
+			br.ErrMsg = "获取最新的数据失败,Err:" + tmpErr.Error()
+			return
+		}
+		tableData, err = excel.GetTableDataByMixedTableData(newResult, true)
+		if err != nil {
+			br.Msg = "获取失败"
+			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, ",")
 	}
 
 	tableData = excel.HandleTableCell(tableData)