This commit is contained in:
邹宗楠
2023-09-22 16:46:39 +08:00
parent 725496ec95
commit 8874f336e8
2 changed files with 4 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ import (
) )
// CopyOnStoreSkuToOther 将一个美团门店分类和商品复制到另一个门店 // CopyOnStoreSkuToOther 将一个美团门店分类和商品复制到另一个门店
func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromVendorStoreId, toStoreId int, isAsync bool) (hint string, err error) { func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromVendorStoreId, toStoreId int, isAsync bool, offSet int) (hint string, err error) {
var ( var (
db = dao.GetDB() db = dao.GetDB()
) )
@@ -76,7 +76,7 @@ func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromVendorStoreId, toStoreId
//} //}
case 3: case 3:
i := 3 i := offSet
for { for {
// 同步商品 // 同步商品
fromFoodList, err1 := fromApi.RetailListAll(utils.Int2Str(fromVendorStoreId), i) fromFoodList, err1 := fromApi.RetailListAll(utils.Int2Str(fromVendorStoreId), i)

View File

@@ -1051,12 +1051,13 @@ func (c *StoreSkuController) CopyMtToJd() {
// @Param token header string true "认证token" // @Param token header string true "认证token"
// @Param fromStoreID formData string true "被复制门店id" // @Param fromStoreID formData string true "被复制门店id"
// @Param toStoreID formData string true "复制到门店id" // @Param toStoreID formData string true "复制到门店id"
// @Param offSet formData int true "跳过页码"
// @Success 200 {object} controllers.CallResult // @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult
// @router /CopyMtToMt [post] // @router /CopyMtToMt [post]
func (c *StoreSkuController) CopyMtToMt() { func (c *StoreSkuController) CopyMtToMt() {
c.callCopyMtToMt(func(params *tStoreSkuCopyMtToMtParams) (retVal interface{}, errCode string, err error) { c.callCopyMtToMt(func(params *tStoreSkuCopyMtToMtParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.CopyOnStoreSkuToOther(params.Ctx, utils.Str2Int(params.FromStoreID), utils.Str2Int(params.ToStoreID), false) retVal, err = cms.CopyOnStoreSkuToOther(params.Ctx, utils.Str2Int(params.FromStoreID), utils.Str2Int(params.ToStoreID), false, params.OffSet)
return retVal, errCode, err return retVal, errCode, err
}) })
} }