This commit is contained in:
苏尹岚
2021-02-03 18:45:01 +08:00
parent f14fc933dd
commit 9cad16bbaf
10 changed files with 76 additions and 13 deletions

View File

@@ -18,6 +18,24 @@ import (
"git.rosy.net.cn/jx-callback/globals/api"
)
type tEbaiSupplierInfo struct {
SupplierID string `json:"supplierID"`
Logo string `json:"logo"`
}
var (
ebaiSupplierInfo = map[string]*tEbaiSupplierInfo{
EbaiSupplierIDsc: &tEbaiSupplierInfo{
SupplierID: EbaiSupplierIDsc,
Logo: "http://image.jxc4.com/image/4573e7789c647d4961f8955e3733dbd6.tem.jpg",
},
EbaiSupplierIDc4: &tEbaiSupplierInfo{
SupplierID: EbaiSupplierIDc4,
Logo: "",
},
}
)
type tEbaiStoreInfo struct {
model.Store
VendorOrgCode string `orm:"size(32)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空
@@ -550,7 +568,39 @@ func (c *PurchaseHandler) GetShopIDsByPage() (vendorStoreIDs []string, err error
return vendorStoreIDs, err
}
func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}) (vendorStoreID string, err error) {
func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}, storeDetail *dao.StoreDetail) (vendorStoreID string, err error) {
brands, err := dao.GetBrands(db, "", storeDetail.BrandID)
brand := brands[0]
param := make(map[string]interface{})
param["shop_id"] = storeID
if strings.Contains(brand.Name, "京西到家") {
param["name"] = storeDetail.Name
} else {
param["name"] = brand.Name + "(" + storeDetail.Name + ")"
}
param["supplier_id"] = params["supplier_id"]
//省市区
placeCity, err := dao.GetPlaceByCode(db, storeDetail.CityCode)
param["city"] = placeCity.EbaiCode
placeProvince, err := dao.GetPlaceByCode(db, placeCity.ParentCode)
param["province"] = placeProvince.EbaiCode
placeCounty, err := dao.GetPlaceByCode(db, storeDetail.DistrictCode)
param["county"] = placeCounty.EbaiCode
phone := ""
if storeDetail.MarketManPhone != "" {
phone = storeDetail.MarketManPhone
} else {
phone = model.VendorStoreTel
}
param["phone"] = phone
param["ivr_phone"] = phone
param["service_phone"] = storeDetail.Tel1
param["address"] = params["address"]
param["longitude"] = jxutils.IntCoordinate2Standard(storeDetail.Lng)
param["latitude"] = jxutils.IntCoordinate2Standard(storeDetail.Lat)
api.EbaiAPI.ShopCreate(params)
return vendorStoreID, err
}

View File

@@ -522,7 +522,7 @@ func (c *PurchaseHandler) UpdateStoreCustomID(ctx *jxcontext.Context, vendorOrgC
return err
}
func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}) (vendorStoreID string, err error) {
func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}, storeDetail *dao.StoreDetail) (vendorStoreID string, err error) {
return vendorStoreID, err
}

View File

@@ -77,7 +77,7 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
return err
}
func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}) (vendorStoreID string, err error) {
func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}, storeDetail *dao.StoreDetail) (vendorStoreID string, err error) {
store, err := dao.GetStoreDetail(db, storeID, model.VendorIDJDShop, "")
if err != nil {
return vendorStoreID, err

View File

@@ -96,7 +96,7 @@ func (p *PurchaseHandler) CreateStore(db *dao.DaoDB, storeID int, userName strin
return p.UpdateStore(db, storeID, userName)
}
func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}) (vendorStoreID string, err error) {
func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}, storeDetail *dao.StoreDetail) (vendorStoreID string, err error) {
return vendorStoreID, err
}

View File

@@ -15,7 +15,7 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
return err
}
func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}) (vendorStoreID string, err error) {
func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}, storeDetail *dao.StoreDetail) (vendorStoreID string, err error) {
return vendorStoreID, err
}