From 8f746dcfea83994bb067f1055cd433200c6c5c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 13 Oct 2020 18:09:28 +0800 Subject: [PATCH] fabu renwu --- business/jxstore/cms/job.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/business/jxstore/cms/job.go b/business/jxstore/cms/job.go index 061c1611d..6bd4e1918 100644 --- a/business/jxstore/cms/job.go +++ b/business/jxstore/cms/job.go @@ -26,7 +26,7 @@ func PublishJob(ctx *jxcontext.Context, job *model.Job) (err error) { if job.Count <= 0 { return fmt.Errorf("任务数量不能为0!") } - if job.Address != "" { + if job.Address != "" && (job.Lng == 0 || job.Lat == 0) { lng, lat, err := api.AutonaviAPI.GetCoordinateFromAddressByPage(job.Address) if err != nil { return err @@ -45,6 +45,11 @@ func PublishJob(ctx *jxcontext.Context, job *model.Job) (err error) { } }() err = dao.CreateEntity(db, job) + for _, v := range job.JobSteps { + dao.WrapAddIDCULEntity(v, ctx.GetUserName()) + v.JobID = job.ID + err = dao.CreateEntity(db, v) + } if err != nil { dao.Rollback(db) }