Przeglądaj źródła

Merge branch 'feature/eta1.8.5_excel_balance' into debug

xyxie 10 miesięcy temu
rodzic
commit
693ed343a4

+ 1 - 0
models/data_manage/excel/excel_chart_edb.go

@@ -30,6 +30,7 @@ type ExcelChartEdb struct {
 	FromTag         string    `description:"标签"`
 	ModifyTime      time.Time `description:"修改时间"`
 	CreateTime      time.Time `description:"创建时间"`
+	ChartWidth      float64   `description:"线条大小"`
 }
 
 type ExcelChartEdbView struct {

+ 2 - 1
services/data/chart_info_excel_balance.go

@@ -81,6 +81,7 @@ func AddBalanceExcelChart(excelInfo *excelModel.ExcelInfo, req request.AddBalanc
 		excelEdb.LeadUnit = chartEdb.LeadUnit
 		excelEdb.CreateTime = time.Now()
 		excelEdb.ModifyTime = time.Now()
+		excelEdb.ChartWidth = 1
 		var dateList []string
 		var dataList []float64
 		if excelInfo.BalanceType == 1 {
@@ -640,7 +641,7 @@ func GetBalanceExcelChartDetail(chartInfo *data_manage.ChartInfoView, mappingLis
 			ChartStyle:        "",
 			ChartColor:        "",
 			PredictChartColor: "",
-			ChartWidth:        0,
+			ChartWidth:        v.ChartWidth,
 			ChartType:         chartType,
 			LatestDate:        endDateStr,
 			LatestValue:       endVal,

+ 0 - 86
services/data/excel/balance_table.go

@@ -336,92 +336,6 @@ func GetBalanceExcelEdbData(excelEdbMappingItem *excelModel.ExcelChartEdb, newMi
 	return
 }
 
-// 获取平衡表指标绑定详情
-func GetBalanceExcelChartSimple(excelInfo *excelModel.ExcelInfo, chartInfoId int, lang string) (list []*data_manage.ChartInfoView, mappingListMap map[int][]*excelModel.ExcelChartEdb, dataListMap map[int][]*data_manage.EdbDataList, err error, errMsg string) {
-	mappingListTmp, err := excelModel.GetExcelChartEdbMappingByChartInfoId(chartInfoId)
-	if err != nil {
-		errMsg = "获取失败"
-		err = fmt.Errorf(" 获取图表,指标信息失败 Err:%s", err.Error())
-		return
-	}
-	mappingList := make([]*excelModel.ExcelChartEdbView, 0)
-	for _, v := range mappingListTmp {
-		tmp :=
-			&excelModel.ExcelChartEdbView{
-				ExcelChartEdbId: v.ExcelChartEdbId,
-				ExcelInfoId:     v.ExcelInfoId,
-				ChartInfoId:     v.ChartInfoId,
-				EdbCode:         v.EdbCode,
-				EdbName:         v.EdbName,
-				DateSequenceStr: v.DateSequence,
-				DataSequenceStr: v.DataSequence,
-				/*MaxData:         v.MaxData,
-				MinData:         v.MinData,
-				IsOrder:         v.IsOrder,
-				IsAxis:          v.IsAxis,
-				EdbInfoType:     v.EdbInfoType,
-				LeadValue:       v.LeadValue,
-				LeadUnit:        v.LeadUnit,*/
-				FromTag: v.FromTag,
-			}
-		mappingList = append(mappingList, tmp)
-	}
-
-	return
-}
-
-func GetBalanceExcelChart(excelInfo *excelModel.ExcelInfo, lang string) (list []*data_manage.ChartInfoView, mappingListMap map[int][]*excelModel.ExcelChartEdb, dataListMap map[int][]*data_manage.EdbDataList, err error, errMsg string) {
-	newExcelDataMap, excelAllRows, excelAllCols, err, errMsg := GetBalanceExcelData(excelInfo, lang)
-	if err != nil {
-		return
-	}
-	dataListMap = make(map[int][]*data_manage.EdbDataList)
-	// 相关联指标
-	mappingListTmp, err := excelModel.GetExcelChartEdbMappingByExcelInfoId(excelInfo.ExcelInfoId)
-	if err != nil {
-		errMsg = "获取失败"
-		err = fmt.Errorf(" 获取图表,指标信息失败 Err:%s", err.Error())
-		return
-	}
-	mappingListMap = make(map[int][]*excelModel.ExcelChartEdb, 0)
-	charInfoIds := make([]int, 0)
-	for _, mapping := range mappingListTmp {
-		mappingListMap[mapping.ChartInfoId] = append(mappingListMap[mapping.ChartInfoId], mapping)
-		err, errMsg = GetBalanceExcelEdbData(mapping, newExcelDataMap, dataListMap, excelAllRows, excelAllCols)
-		if err != nil {
-			err = fmt.Errorf(" 获取图表,指标信息失败 Err:%s", err.Error())
-			return
-		}
-	}
-	for k, _ := range mappingListMap {
-		charInfoIds = append(charInfoIds, k)
-	}
-	list = make([]*data_manage.ChartInfoView, 0)
-	if len(charInfoIds) > 0 {
-		chartInfoList, e := data_manage.GetChartInfoViewByIdList(charInfoIds)
-		if e != nil {
-			errMsg = "获取失败"
-			err = fmt.Errorf(" 获取图表,指标信息失败 Err:%s", e.Error())
-			return
-		}
-		list = chartInfoList
-		/*for _, chartInfo := range chartInfoList {
-			mappingList, ok := mappingListMap[chartInfo.ChartInfoId]
-			if !ok {
-				err = fmt.Errorf("未找到图表关联的指标信息")
-				return
-			}
-			var chartInfoResp *data_manage.ChartInfoDetailResp
-			chartInfoResp, err, errMsg = GetBalanceExcelChartDetail(chartInfo, mappingList, sysUser, dataListMap)
-			if err != nil {
-				return
-			}
-			list = append(list, chartInfoResp)
-		}*/
-	}
-	return
-}
-
 // 获取单个图表信息
 func GetBalanceExcelChartSingle(chartInfo *data_manage.ChartInfoView, lang string) (mappingListTmp []*excelModel.ExcelChartEdb, dataListMap map[int][]*data_manage.EdbDataList, err error, errMsg string) {
 	// 相关联指标