From 4fb7e1f1992278e0fc6612d1c5b102645d1332de Mon Sep 17 00:00:00 2001 From: zhangwei <894646498@qq.com> Date: Mon, 26 Jun 2023 09:06:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E4=BB=BB=E5=8A=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 088cc41d99299cd0fd6279b33e63cdf643d9907a --- .../PCM-CORE/api/internal/logic/core/jobtotallogic.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/adaptor/PCM-CORE/api/internal/logic/core/jobtotallogic.go b/adaptor/PCM-CORE/api/internal/logic/core/jobtotallogic.go index 12055e15..f3e4f4d3 100644 --- a/adaptor/PCM-CORE/api/internal/logic/core/jobtotallogic.go +++ b/adaptor/PCM-CORE/api/internal/logic/core/jobtotallogic.go @@ -61,13 +61,16 @@ func (l *JobTotalLogic) JobTotal() (resp *types.JobTotalResp, err error) { json.Unmarshal(jobBytes, jobs) for _, job := range jobs.OtJobs { - resp.TrainJobs = append(resp.TrainJobs, types.TrainJob{ + trainJob := types.TrainJob{ Name: job.Name, Status: job.Status, - ServiceName: job.Tasks[0].CenterName[0], Strategy: 0, SynergyStatus: "未协同", - }) + } + if job.Tasks[0].CenterName != nil { + trainJob.ServiceName = job.Tasks[0].CenterName[0] + } + resp.TrainJobs = append(resp.TrainJobs, trainJob) } var tasks []model.Task