|
@@ -1204,3 +1204,56 @@ func traceEdbInfoByEdbInfoId(edbInfoId int, traceEdbInfo data_manage.TraceEdbInf
|
|
|
existMap[edbInfoId] = traceEdbInfo
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+// GetEdbSourceByEdbInfoIdListForExcel 获取关联指标的来源
|
|
|
+func GetEdbSourceByEdbInfoIdListForExcel(edbInfoIdList []int) (sourceNameList, sourceNameEnList []string,err error) {
|
|
|
+ sourceNameList = make([]string, 0)
|
|
|
+ sourceNameEnList = make([]string, 0)
|
|
|
+ sourceMap := make(map[int]string)
|
|
|
+ edbInfoList, tmpErr := data_manage.GetEdbInfoByIdList(edbInfoIdList)
|
|
|
+ if tmpErr != nil {
|
|
|
+ err = tmpErr
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range edbInfoList {
|
|
|
+ // 指标类型:1:基础指标,2:计算指标
|
|
|
+ if v.EdbType == 2 {
|
|
|
+ //sourceMap[0] = "弘则研究"
|
|
|
+ baseEdbInfoArr, _, _ := data_manage.GetRefreshEdbInfoFromBase(v.EdbInfoId, v.Source)
|
|
|
+ for _, baseEdbInfo := range baseEdbInfoArr {
|
|
|
+ if baseEdbInfo.EdbInfoType == 0 { //普通指标才参与,预测指标不参与
|
|
|
+ sourceMap[baseEdbInfo.Source] = baseEdbInfo.SourceName
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ sourceMap[v.Source] = v.SourceName
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for source, sourceName := range sourceMap {
|
|
|
+ if utils.InArrayByInt([]int{utils.DATA_SOURCE_MANUAL, utils.DATA_SOURCE_MYSTEEL_CHEMICAL}, source) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ sourceNameList = append(sourceNameList, sourceName)
|
|
|
+
|
|
|
+ sourceNameEn, ok := utils.DataSourceEnMap[source]
|
|
|
+ if !ok {
|
|
|
+ sourceNameEn = sourceName
|
|
|
+ }
|
|
|
+ sourceNameEnList = append(sourceNameEnList, sourceNameEn)
|
|
|
+ }
|
|
|
+ //sourceNameList = append(sourceNameList, utils.ChartDefaultNameCn)
|
|
|
+ //sourceNameEnList = append(sourceNameEnList, utils.ChartDefaultNameEn)
|
|
|
+
|
|
|
+ // 图表来源
|
|
|
+ conf, e := models.GetBusinessConf()
|
|
|
+ if e != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if conf[models.BusinessConfCompanyName] != "" {
|
|
|
+ sourceNameList = append(sourceNameList, conf[models.BusinessConfCompanyName])
|
|
|
+ sourceNameEnList = append(sourceNameEnList, conf[models.BusinessConfCompanyName])
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|