diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 468b23af0..f1084d422 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -3570,6 +3570,19 @@ func CreateStoreAudit(ctx *jxcontext.Context, storeAudit *model.StoreAudit) (err if len(storeAudits) > 0 { return fmt.Errorf("您已申请过入驻,请不要重复申请!") } + if storeAudit.Address == "" { + return fmt.Errorf("门店地址必填!") + } + if storeAudit.Lng == 0 || storeAudit.Lat == 0 { + lng, lat, _ := api.AutonaviAPI.GetCoordinateFromAddressByPage(storeAudit.Address) + if lng != 0 && lat != 0 { + storeAudit.Lng = jxutils.StandardCoordinate2Int(lng) + storeAudit.Lat = jxutils.StandardCoordinate2Int(lat) + } else { + return fmt.Errorf("请填写正确的门店地址!") + } + } + if storeAudit.UserID == "" { storeAudit.UserID = ctx.GetUserID() }