- wrong use and implementation of GetMultiStoreHandler
This commit is contained in:
@@ -291,7 +291,7 @@ func GetStoreVendorMaps(ctx *jxcontext.Context, db *dao.DaoDB, storeID int, vend
|
|||||||
}
|
}
|
||||||
|
|
||||||
func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID int, storeMap *model.StoreMap, userName string) (outStoreMap *model.StoreMap, err error) {
|
func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID int, storeMap *model.StoreMap, userName string) (outStoreMap *model.StoreMap, err error) {
|
||||||
if handler := CurVendorSync.GetMultiStoreHandler(vendorID); handler != nil {
|
if handler := CurVendorSync.GetStoreHandler(vendorID); handler != nil {
|
||||||
store, err2 := handler.ReadStore(storeMap.VendorStoreID)
|
store, err2 := handler.ReadStore(storeMap.VendorStoreID)
|
||||||
if err = err2; err == nil {
|
if err = err2; err == nil {
|
||||||
dao.WrapAddIDCULDEntity(storeMap, userName)
|
dao.WrapAddIDCULDEntity(storeMap, userName)
|
||||||
@@ -347,7 +347,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
|
|||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
}
|
}
|
||||||
if vendorStoreID := utils.Interface2String(payload["vendorStoreID"]); vendorStoreID != "" {
|
if vendorStoreID := utils.Interface2String(payload["vendorStoreID"]); vendorStoreID != "" {
|
||||||
if handler := CurVendorSync.GetMultiStoreHandler(vendorID); handler != nil {
|
if handler := CurVendorSync.GetStoreHandler(vendorID); handler != nil {
|
||||||
jdStore, err2 := handler.ReadStore(vendorStoreID)
|
jdStore, err2 := handler.ReadStore(vendorStoreID)
|
||||||
if err = err2; err == nil {
|
if err = err2; err == nil {
|
||||||
payload["deliveryType"] = jdStore.DeliveryType
|
payload["deliveryType"] = jdStore.DeliveryType
|
||||||
|
|||||||
@@ -107,15 +107,15 @@ func (v *VendorSync) GetStoreHandler(vendorID int) partner.IPurchasePlatformHand
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *VendorSync) GetMultiStoreHandler(vendorID int) partner.IMultipleStoresHandler {
|
func (v *VendorSync) GetMultiStoreHandler(vendorID int) partner.IMultipleStoresHandler {
|
||||||
if v.PurchaseHandlers[vendorID] != nil {
|
if handler, ok := v.PurchaseHandlers[vendorID].(partner.IMultipleStoresHandler); ok {
|
||||||
return v.PurchaseHandlers[vendorID].(partner.IMultipleStoresHandler)
|
return handler
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *VendorSync) GetSingleStoreHandler(vendorID int) partner.ISingleStoreHandler {
|
func (v *VendorSync) GetSingleStoreHandler(vendorID int) partner.ISingleStoreHandler {
|
||||||
if v.PurchaseHandlers[vendorID] != nil {
|
if handler, ok := v.PurchaseHandlers[vendorID].(partner.ISingleStoreHandler); ok {
|
||||||
return v.PurchaseHandlers[vendorID].(partner.ISingleStoreHandler)
|
return handler
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,8 +120,8 @@ func (c *StoreController) GetStoreVendorMaps() {
|
|||||||
// @Title 修改门店映射信息
|
// @Title 修改门店映射信息
|
||||||
// @Description 修改门店映射信息
|
// @Description 修改门店映射信息
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param storeID query int true "门店ID,payload中的相应字段会被忽略"
|
// @Param storeID query int true "门店ID"
|
||||||
// @Param vendorID query int true "厂商ID,payload中的相应字段会被忽略"
|
// @Param vendorID query int true "厂商ID"
|
||||||
// @Param payload formData string true "json数据,storeMap对象"
|
// @Param payload formData string true "json数据,storeMap对象"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
|||||||
Reference in New Issue
Block a user