This commit is contained in:
richboo111
2023-08-21 10:25:09 +08:00
parent 9d2f29bce6
commit e1f0c55ce8

View File

@@ -14,6 +14,8 @@ import (
"strings"
"time"
"git.rosy.net.cn/baseapi/platformapi/sfps2"
"git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
@@ -789,6 +791,21 @@ func GetVendorStore(ctx *jxcontext.Context, vendorID int, vendorOrgCode, vendorS
if vendorID == model.VendorIDJDShop && vendorStoreID == model.JdShopMainVendorStoreID {
return nil, err
}
//绑定顺丰专送门店校验
if vendorID == model.VendorIDSFPS {
flag := false
if store, err := dao.GetStoreDetail(dao.GetDB(), utils.Str2Int(vendorStoreID), 0, ""); err == nil {
globals.SugarLogger.Debugf("store.CityName=%s", store.CityName)
for k, _ := range sfps2.SFCityStoreIDs {
if strings.Contains(store.CityName, k) || store.CityName == k {
flag = true
}
}
}
if !flag {
return nil, errors.New("此门店暂时不在顺丰派送范围,无法绑定")
}
}
if handler := CurVendorSync.GetStoreHandler(vendorID); handler != nil {
result, err2 := handler.ReadStore(ctx, vendorOrgCode, vendorStoreID, "")
if err = err2; err == nil {