From 2e8db13fab411b26d334365240a952bcffa7a681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 6 Aug 2020 13:40:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=A1=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/common/common.go | 10 ++++++++-- business/model/dao/store.go | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) 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"`