Browse Source

fix-kanban

tags/v1.22.11.2^2^2
liuzx 3 years ago
parent
commit
b761e08da6
4 changed files with 6 additions and 5 deletions
  1. +1
    -1
      models/cloudbrain_static.go
  2. +1
    -0
      routers/api/v1/repo/cloudbrain_dashboard.go
  3. +3
    -3
      routers/repo/cloudbrain_statistic.go
  4. +1
    -1
      services/cloudbrain/util.go

+ 1
- 1
models/cloudbrain_static.go View File

@@ -335,7 +335,7 @@ func DeleteCloudbrainDurationStatisticHour(date string, hour int, aiCenterCode s
func GetCanUseCardInfo() ([]*ResourceQueue, error) {
sess := x.NewSession()
defer sess.Close()
sess.OrderBy("resource_queue.cluster DESC, resource_queue.ai_center_code ASC")
sess.OrderBy("resource_queue.cluster DESC, resource_queue.ai_center_name ASC")
ResourceQueues := make([]*ResourceQueue, 0, 10)
if err := sess.Table(&ResourceQueue{}).Find(&ResourceQueues); err != nil {
log.Info("find error.")


+ 1
- 0
routers/api/v1/repo/cloudbrain_dashboard.go View File

@@ -1861,6 +1861,7 @@ func GetResourceQueues(ctx *context.Context) {
for _, resourceQueue := range resourceQueues {
if _, ok := aiCenterCodeMap[resourceQueue.AiCenterCode]; !ok {
resourceQueue.AiCenterName = repo.GetAiCenterNameByCode(resourceQueue.AiCenterCode)
aiCenterCodeMap[resourceQueue.AiCenterCode] = resourceQueue.AiCenterCode
Resource = append(Resource, resourceQueue)
}
}


+ 3
- 3
routers/repo/cloudbrain_statistic.go View File

@@ -124,9 +124,9 @@ func summaryDurationStat(statisticTime time.Time) {

func GetAiCenterNameByCode(centerCode string) string {
var aiCenterName string
c2NetSequenceInfo := cloudbrainService.C2NetSequenceInfoByCode(centerCode)
if c2NetSequenceInfo != nil {
aiCenterName = c2NetSequenceInfo.Content
aiCenterInfo := cloudbrainService.GetAiCenterInfoByCenterCode(centerCode)
if aiCenterInfo != nil {
aiCenterName = aiCenterInfo.Content
} else {
aiCenterName = centerCode
}


+ 1
- 1
services/cloudbrain/util.go View File

@@ -33,7 +33,7 @@ func GetAiCenterShow(aiCenter string, ctx *context.Context) string {

}

func C2NetSequenceInfoByCode(aiCenterCode string) *setting.C2NetSequenceInfo {
func GetAiCenterInfoByCenterCode(aiCenterCode string) *setting.C2NetSequenceInfo {
if setting.AiCenterCodeAndNameMapInfo != nil {
if info, ok := setting.AiCenterCodeAndNameMapInfo[aiCenterCode]; ok {
return info


Loading…
Cancel
Save