From 610f44e5b5a56f665a1bc296d1b9b536b91f9c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 24 Sep 2020 10:30:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E9=97=A8=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/delivery/mtps/store.go | 58 +++++++++++++------------ 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/business/partner/delivery/mtps/store.go b/business/partner/delivery/mtps/store.go index e38939f23..9664c736e 100644 --- a/business/partner/delivery/mtps/store.go +++ b/business/partner/delivery/mtps/store.go @@ -44,36 +44,38 @@ func (c *DeliveryHandler) OnStoreStatus(msg *mtpsapi.CallbackShopStatusMsg) (ret } func (c *DeliveryHandler) CreateStore(ctx *jxcontext.Context, storeDetail *dao.StoreDetail2) (vendorStoreID string, status int, err error) { - businessHours := []*mtpsapi.BusinessHour{ - &mtpsapi.BusinessHour{ - BeginTime: "06:00", - EndTime: "22:00", - }, - } - shopInfo := &mtpsapi.ShopInfo{ - ShopID: storeDetail.VendorStoreID, - ShopName: storeDetail.Name, - Category: mtpsapi.ShopCategoryFruit, - SecondCategory: mtpsapi.ShopCategoryFruitFruit, - ContactName: storeDetail.PayeeName, - ContactPhone: storeDetail.Tel1, - ContactEmail: fakeContactEmail, - ShopAddress: storeDetail.Address, - ShopLng: storeDetail.Lng, - ShopLat: storeDetail.Lat, - CoordinateType: mtpsapi.CoordinateTypeMars, - BusinessHours: string(utils.MustMarshal(businessHours)), - } - shopStatus := mtpsapi.ShopStatusAuditCreated if globals.EnableStoreWrite { - shopStatus, err = api.MtpsAPI.ShopCreate(shopInfo) - if err == nil { - vendorStoreID = shopInfo.ShopID - status = getAuditStatus(shopStatus) + businessHours := []*mtpsapi.BusinessHour{ + &mtpsapi.BusinessHour{ + BeginTime: "06:00", + EndTime: "22:00", + }, + } + shopInfo := &mtpsapi.ShopInfo{ + ShopID: storeDetail.VendorStoreID, + ShopName: storeDetail.Name, + Category: mtpsapi.ShopCategoryFruit, + SecondCategory: mtpsapi.ShopCategoryFruitFruit, + ContactName: storeDetail.PayeeName, + ContactPhone: storeDetail.Tel1, + ContactEmail: fakeContactEmail, + ShopAddress: storeDetail.Address, + ShopLng: storeDetail.Lng, + ShopLat: storeDetail.Lat, + CoordinateType: mtpsapi.CoordinateTypeMars, + BusinessHours: string(utils.MustMarshal(businessHours)), + } + shopStatus := mtpsapi.ShopStatusAuditCreated + if globals.EnableStoreWrite { + shopStatus, err = api.MtpsAPI.ShopCreate(shopInfo) + if err == nil { + vendorStoreID = shopInfo.ShopID + status = getAuditStatus(shopStatus) + } + } else { + vendorStoreID = utils.Int64ToStr(jxutils.GenFakeID()) + status = model.StoreAuditStatusOnline } - } else { - vendorStoreID = utils.Int64ToStr(jxutils.GenFakeID()) - status = model.StoreAuditStatusOnline } return vendorStoreID, status, err }