审核门店
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user