From ff152dbd6b2da51e6f965af53ae67d0a29f598be Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 15 May 2019 18:12:20 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E9=9D=9E=E4=BA=AC=E4=B8=9C=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E8=A6=81=E6=B1=82=E5=BF=85=E9=A1=BB=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8B=A3=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 518cf41bc..90400fd2d 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -262,11 +262,11 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa panic(r) } }() - globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false)) - globals.SugarLogger.Debug(sql) + // globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false)) + // globals.SugarLogger.Debug(sql) var storeList []*StoreExt if err = dao.GetRows(db, &storeList, sql, sqlParams...); err == nil { - globals.SugarLogger.Debugf("GetStores, len(storeList):%d", len(storeList)) + // globals.SugarLogger.Debugf("GetStores, len(storeList):%d", len(storeList)) mapLimit := false var ( mapLatitude, mapLongitude float64 @@ -564,6 +564,9 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID if storeID == 0 { return nil, fmt.Errorf("storeID不能为0") } + if vendorID != model.VendorIDJD && (storeMap.AutoPickup == 0) { + return nil, fmt.Errorf("非京东平台要求必须自动拣货") + } userName := ctx.GetUserName() if handler := CurVendorSync.GetStoreHandler(vendorID); handler != nil { store, err2 := handler.ReadStore(storeMap.VendorStoreID) @@ -622,6 +625,11 @@ func DeleteStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor } func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID int, payload map[string]interface{}, userName string) (num int64, err error) { + if vendorID != model.VendorIDJD { + if autoPickup, ok := payload["autoPickup"]; ok && autoPickup == 0 { + return 0, fmt.Errorf("非京东平台要求必须自动拣货") + } + } storeHandler := CurVendorSync.GetStoreHandler(vendorID) if storeHandler == nil { return 0, ErrCanNotFindVendor