Merge remote-tracking branch 'origin/mark' into yonghui
This commit is contained in:
@@ -553,6 +553,7 @@ func (c *StoreController) GetStoreListByLocation() {
|
||||
// @Title 老格恢复拓店进度
|
||||
// @Description 老格恢复拓店进度
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorOrgCode formData string false "厂商内组织代码"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /JdStoreInfoCoordinateRecover [post]
|
||||
@@ -560,7 +561,7 @@ func (c *StoreController) JdStoreInfoCoordinateRecover() {
|
||||
c.callJdStoreInfoCoordinateRecover(func(params *tStoreJdStoreInfoCoordinateRecoverParams) (retVal interface{}, errCode string, err error) {
|
||||
r := c.Ctx.Request
|
||||
files := r.MultipartForm.File["userfiles"]
|
||||
err = cms.JdStoreInfoCoordinateRecover(params.Ctx, files)
|
||||
err = cms.JdStoreInfoCoordinateRecover(params.Ctx, params.VendorOrgCode, files)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@ import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
@@ -142,21 +144,61 @@ func (c *SyncController) DeleteRemoteStoreSkus() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 同步SkuName(多门店平台)
|
||||
// @Description 同步SkuName(多门店平台)
|
||||
// @Title 同步商家分类(多门店平台)
|
||||
// @Description 同步商家分类(多门店平台)
|
||||
// @Param token header string true "认证token"
|
||||
// @Param nameIDs formData string false "name ID列表"
|
||||
// @Param vendorID formData int false "平台ID(京东0 美团1 饿百3)"
|
||||
// @Param vendorOrgCode formData string false "平台账号"
|
||||
// @Param isForce formData bool false "是否强制(设置修改标志)"
|
||||
// @Param isAsync formData bool false "是否异步"
|
||||
// @Param isContinueWhenError formData bool false "单个同步失败是否继续,缺省false"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /SyncSkuNames [put]
|
||||
// @router /SyncCategories [post]
|
||||
func (c *SyncController) SyncCategories() {
|
||||
c.callSyncCategories(func(params *tSyncSyncCategoriesParams) (retVal interface{}, errCode string, err error) {
|
||||
var vendorIDs []int
|
||||
if params.MapData["vendorID"] != nil {
|
||||
vendorIDs = append(vendorIDs, params.VendorID)
|
||||
}
|
||||
vendorOrgCodes := jxutils.BatchString2Slice(params.VendorOrgCode)
|
||||
if params.IsForce {
|
||||
dao.SetThingMapSyncStatus(dao.GetDB(), vendorIDs, vendorOrgCodes, model.ThingTypeCategory, nil, model.SyncFlagModifiedMask)
|
||||
}
|
||||
retVal, err = cms.SyncCategories(params.Ctx, nil, vendorIDs, vendorOrgCodes, nil, params.IsAsync)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 同步SkuName(多门店平台)
|
||||
// @Description 同步SkuName(多门店平台)
|
||||
// @Param token header string true "认证token"
|
||||
// @Param nameIDs formData string false "name ID列表"
|
||||
// @Param isForce formData bool false "是否强制(设置修改标志)"
|
||||
// @Param vendorID formData int false "平台ID(京东0 美团1 饿百3)"
|
||||
// @Param vendorOrgCode formData string false "平台账号"
|
||||
// @Param isAsync formData bool false "是否异步"
|
||||
// @Param isContinueWhenError formData bool false "单个同步失败是否继续,缺省false"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /SyncSkuNames [put,post]
|
||||
func (c *SyncController) SyncSkuNames() {
|
||||
c.callSyncSkuNames(func(params *tSyncSyncSkuNamesParams) (retVal interface{}, errCode string, err error) {
|
||||
var nameIDs []int
|
||||
if err = jxutils.Strings2Objs(params.NameIDs, &nameIDs); err == nil {
|
||||
retVal, err = cms.CurVendorSync.SyncSkuNames(params.Ctx, nameIDs, params.IsForce, params.IsAsync, params.IsContinueWhenError)
|
||||
if globals.IsUseThingMap {
|
||||
var vendorIDs []int
|
||||
if params.MapData["vendorID"] != nil {
|
||||
vendorIDs = append(vendorIDs, params.VendorID)
|
||||
}
|
||||
vendorOrgCodes := jxutils.BatchString2Slice(params.VendorOrgCode)
|
||||
if params.IsForce {
|
||||
dao.SetSkuNameSyncStatus(dao.GetDB(), vendorIDs, vendorOrgCodes, nameIDs, model.SyncFlagModifiedMask)
|
||||
}
|
||||
retVal, err = cms.SyncSkus(params.Ctx, nil, vendorIDs, vendorOrgCodes, nameIDs, nil, params.IsAsync)
|
||||
} else {
|
||||
retVal, err = cms.CurVendorSync.SyncSkuNames(params.Ctx, nameIDs, params.IsForce, params.IsAsync, params.IsContinueWhenError)
|
||||
}
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
@@ -201,3 +243,20 @@ func (c *SyncController) AddCreateFlagForJxStoreSku() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 初始化多门店平台商品库(及商家分类)
|
||||
// @Description 初始化多门店平台商品库(及商家分类)
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorID formData int true "平台ID(京东0 美团1 饿百3)"
|
||||
// @Param vendorOrgCode formData string true "平台账号"
|
||||
// @Param isAsync formData bool false "是否异步操作"
|
||||
// @Param isContinueWhenError formData bool false "单个同步失败是否继续,缺省false"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /FullSyncVendorStuff [post]
|
||||
func (c *SyncController) FullSyncVendorStuff() {
|
||||
c.callFullSyncVendorStuff(func(params *tSyncFullSyncVendorStuffParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = cms.FullSyncVendorStuff(params.Ctx, nil, params.VendorID, params.VendorOrgCode, params.IsAsync, params.IsContinueWhenError)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -204,3 +204,7 @@ func (c *DjswController) nullOperation() {
|
||||
c.Data["json"] = c.transferResponse("nullOperation", nil)
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
func (c *DjswController) UpdateSku() {
|
||||
c.nullOperation()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user