aa
This commit is contained in:
@@ -1663,7 +1663,7 @@ func TransferJdsOrder(ctx *jxcontext.Context, vendorOrderID string, storeID int)
|
||||
Remark: "订单转移被取消",
|
||||
}
|
||||
jxutils.CallMsgHandlerAsync(func() {
|
||||
err = partner.CurOrderManager.OnOrderStatusChanged("", orderStatus)
|
||||
err = partner.CurOrderManager.OnOrderStatusChanged(order.VendorOrgCode, orderStatus)
|
||||
}, jxutils.ComposeUniversalOrderID(vendorOrderID, model.VendorIDJX))
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
@@ -3889,13 +3889,25 @@ func UpdateBrand(ctx *jxcontext.Context, payload map[string]interface{}, isDel b
|
||||
}
|
||||
|
||||
func CreateVendorStore(ctx *jxcontext.Context, storeID, vendorID int, payload map[string]interface{}) (err error) {
|
||||
// var (
|
||||
// db = dao.GetDB()
|
||||
// )
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
storeDetail *dao.StoreDetail
|
||||
)
|
||||
if storeDetail, err = dao.GetStoreDetail(db, storeID, vendorID, ""); err != nil {
|
||||
return fmt.Errorf("获取门店信息失败,请联系技术部!")
|
||||
}
|
||||
if payload["vendorOrgCode"] == nil {
|
||||
return fmt.Errorf("请选择平台账号!")
|
||||
}
|
||||
// storeDetail, _ := dao.GetStoreDetail(db, storeID, vendorID, payload["vendorOrgCode"].(string))
|
||||
if vendorID == model.VendorIDMTWM {
|
||||
if brands, err := dao.GetBrands(db, "", storeDetail.BrandID); err == nil {
|
||||
if len(brands) > 0 {
|
||||
if strings.Contains(brands[0].Name, "无品牌") {
|
||||
return fmt.Errorf("无品牌店铺不允许创建美团门店!")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// handler := partner.GetPurchasePlatformFromVendorID(vendorID)
|
||||
// vendorStoreID, err := handler.CreateStore2(db, storeID, ctx.GetUserName(), payload)
|
||||
// if err != nil {
|
||||
|
||||
@@ -245,7 +245,7 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
db2 = dao.GetDB()
|
||||
}
|
||||
if model.IsSyncStatusNew(storeMap.SyncStatus) {
|
||||
if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil); err == nil {
|
||||
if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil, nil); err == nil {
|
||||
resultList = append(resultList, 1)
|
||||
} else {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(nil, err, storeMap.StoreID, model.VendorChineseNames[storeMap.VendorID], "创建门店")
|
||||
@@ -283,7 +283,7 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
var vendorStoreID string
|
||||
storeMap := loopMapInfo.StoreMapList[0]
|
||||
if model.IsSyncStatusNew(storeMap.SyncStatus) {
|
||||
if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil); err == nil {
|
||||
if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil, nil); err == nil {
|
||||
resultList = append(resultList, 1)
|
||||
} else {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(nil, err, storeMap.StoreID, model.VendorChineseNames[storeMap.VendorID], "创建门店")
|
||||
|
||||
@@ -469,6 +469,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
now := jxutils.OperationTime2HourMinuteFormat(time.Now())
|
||||
var failedList []*partner.StoreSkuInfoWithErr
|
||||
for _, sku := range skus {
|
||||
globals.SugarLogger.Debugf("syncStoreSkuNew sku sync:%v", sku.SkuSyncStatus)
|
||||
if !useVendorPriceDirectly &&
|
||||
!isSkuLockTimeValid(sku) {
|
||||
sku.VendorPrice = 0
|
||||
|
||||
@@ -149,7 +149,7 @@ type IPurchasePlatformHandler interface {
|
||||
// Store
|
||||
ReadStore(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID string) (store *dao.StoreDetail, err error)
|
||||
UpdateStore(db *dao.DaoDB, storeID int, userName string) (err error)
|
||||
CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}) (vendorStoreID string, err error)
|
||||
CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}, storeDetail *dao.StoreDetail) (vendorStoreID string, err error)
|
||||
DeleteStore(db *dao.DaoDB, storeID int, userName string) (err error)
|
||||
GetStoreStatus(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string) (storeStatus int, err error)
|
||||
UpdateStoreCustomID(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID string, storeID int64) (err error)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user