diff --git a/business/jxstore/common/common.go b/business/jxstore/common/common.go index 072f1bf0b..d55e80483 100644 --- a/business/jxstore/common/common.go +++ b/business/jxstore/common/common.go @@ -1,6 +1,7 @@ package common import ( + "fmt" "sort" "git.rosy.net.cn/baseapi/platformapi/autonavi" @@ -66,8 +67,13 @@ func GetNearSupplyGoodsStoreByStoreID(ctx *jxcontext.Context, storeID int) (stor stores []*model.Store db = dao.GetDB() ) - stores2, _ := dao.GetStoreList(db, []int{storeID}, nil, nil, nil, "") - store2 := stores2[0] + store2, _ := dao.GetStoreDetail(db, storeID, model.VendorIDJX) + if store2 == nil { + return nil, fmt.Errorf("该门店未绑定京西平台!storeID: %v", storeID) + } + if store2.IsSupplyGoods == model.YES { + return nil, fmt.Errorf("该门店已经是货源门店,无法从其他货源门店进货!storeID: %v", storeID) + } sql := ` SELECT a.* FROM store a diff --git a/business/model/dao/store.go b/business/model/dao/store.go index c84025405..b8e7cba27 100644 --- a/business/model/dao/store.go +++ b/business/model/dao/store.go @@ -49,8 +49,9 @@ type StoreDetail struct { OperatorName2 string `json:"operatorName2"` OperatorName3 string `json:"operatorName3"` - JdStoreLevel string `json:"jdStoreLevel"` //京东门店等级 - IsOrder int `json:"isOrder"` //是否是下预订单门店 + JdStoreLevel string `json:"jdStoreLevel"` //京东门店等级 + IsOrder int `json:"isOrder"` //是否是下预订单门店 + IsSupplyGoods int `json:"isSupplyGoods"` YbAppID string `orm:"column(yb_app_id)" json:"ybAppID"` YbAppKey string `json:"ybAppKey"`