diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index ff91ee17b..f49997f1d 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -1159,6 +1159,10 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend } else { err = ErrCanNotFindVendor } + storeDetail, _ := dao.GetStoreDetailByVendorStoreID(db, storeMap.VendorStoreID, storeMap.VendorID) + if storeDetail != nil { + return nil, fmt.Errorf("此平台门店ID已在京西有绑定,请先解除绑定,平台门店ID :[%v]", storeMap.VendorStoreID) + } } else if vendorID == model.VendorIDJX { ReCalculateJxPriceLight(db, ctx, storeID) } else if vendorID == model.VendorIDYB { @@ -1186,10 +1190,6 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend } } } - storeDetail, _ := dao.GetStoreDetailByVendorStoreID(db, storeMap.VendorStoreID, storeMap.VendorID) - if storeDetail != nil { - return nil, fmt.Errorf("此平台门店ID已在京西有绑定,请先解除绑定,平台门店ID :[%v]", storeMap.VendorStoreID) - } storeMapList, err := dao.GetStoresMapList2(db, []int{vendorID}, []int{storeID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", true) if len(storeMapList) > 0 { _, err = CurVendorSync.SyncStore(ctx, db, storeMap.VendorID, storeID, false, userName)