|
@@ -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) {
|
|
|
// 相关联指标
|