|
@@ -3,6 +3,7 @@ package data_manage
|
|
import (
|
|
import (
|
|
"eta_gn/eta_chart_lib/global"
|
|
"eta_gn/eta_chart_lib/global"
|
|
"eta_gn/eta_chart_lib/utils"
|
|
"eta_gn/eta_chart_lib/utils"
|
|
|
|
+ "gorm.io/gorm"
|
|
"time"
|
|
"time"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -102,7 +103,7 @@ func GetEdbInfoByIdList(edbInfoIdList []int) (items []*EdbInfo, err error) {
|
|
}
|
|
}
|
|
o := global.DmSQL["data"]
|
|
o := global.DmSQL["data"]
|
|
sql := ` SELECT * FROM edb_info WHERE edb_info_id in (` + utils.GetGormInReplace(num) + `) `
|
|
sql := ` SELECT * FROM edb_info WHERE edb_info_id in (` + utils.GetGormInReplace(num) + `) `
|
|
- err = o.Raw(sql, edbInfoIdList).Scan(&items).Error
|
|
|
|
|
|
+ err = o.Raw(sql, edbInfoIdList).Find(&items).Error
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
@@ -184,3 +185,24 @@ type TraceEdbInfoResp struct {
|
|
Child []TraceEdbInfoResp `description:"下级来源"`
|
|
Child []TraceEdbInfoResp `description:"下级来源"`
|
|
EdbInfo *EdbInfo `description:"指标信息" json:"-"`
|
|
EdbInfo *EdbInfo `description:"指标信息" json:"-"`
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func (e *EdbInfo) AfterFind(db *gorm.DB) (err error) {
|
|
|
|
+ tmpLatestDate, err := time.Parse(utils.FormatDateWallWithLoc, e.LatestDate)
|
|
|
|
+ if err != nil {
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
|
|
+ tmpStartDate, err := time.Parse(utils.FormatDateWallWithLoc, e.StartDate)
|
|
|
|
+ if err != nil {
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
|
|
+ tmpEndDate, err := time.Parse(utils.FormatDateWallWithLoc, e.EndDate)
|
|
|
|
+ if err != nil {
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ e.LatestDate = utils.TimeTransferString(utils.FormatDate, tmpLatestDate)
|
|
|
|
+ e.StartDate = utils.TimeTransferString(utils.FormatDate, tmpStartDate)
|
|
|
|
+ e.EndDate = utils.TimeTransferString(utils.FormatDate, tmpEndDate)
|
|
|
|
+
|
|
|
|
+ return nil
|
|
|
|
+}
|