109 lines
5.0 KiB
Go
109 lines
5.0 KiB
Go
package controllers
|
||
|
||
import (
|
||
"git.rosy.net.cn/jx-callback/business/jxstore/tempop"
|
||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||
)
|
||
|
||
// @Title 将为份的商品在京东转成SPU
|
||
// @Description 将为份的商品在京东转成SPU
|
||
// @Param token header string true "认证token"
|
||
// @Param count formData int false "转换的数量,缺省0表示全部"
|
||
// @Param isAsync formData bool false "是否异步操作"
|
||
// @Param isContinueWhenError formData bool false "单个同步失败是否继续,缺省false"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /Convert2JDSPU [post]
|
||
func (c *InitDataController) Convert2JDSPU() {
|
||
c.callConvert2JDSPU(func(params *tInitdataConvert2JDSPUParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = tempop.Convert2JDSPU(params.Ctx, params.Count, params.IsAsync, params.IsContinueWhenError)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 将京东商店为份的SPU转换
|
||
// @Description 将京东商店为份的SPU转换
|
||
// @Param token header string true "认证token"
|
||
// @Param step formData int true "门店列表"
|
||
// @Param storeIDs 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 /Change2JDSPU4Store [post]
|
||
func (c *InitDataController) Change2JDSPU4Store() {
|
||
c.callChange2JDSPU4Store(func(params *tInitdataChange2JDSPU4StoreParams) (retVal interface{}, errCode string, err error) {
|
||
var storeIDs []int
|
||
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs); err == nil {
|
||
retVal, err = tempop.Change2JDSPU4Store(params.Ctx, storeIDs, params.Step, params.IsAsync, params.IsContinueWhenError)
|
||
}
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 将遗留JD订单合并
|
||
// @Description 将遗留JD订单合并
|
||
// @Param token header string true "认证token"
|
||
// @Param isAsync formData bool false "是否异步操作"
|
||
// @Param isContinueWhenError formData bool false "单个同步失败是否继续,缺省false"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /TransferLegacyJdOrder [post]
|
||
func (c *InitDataController) TransferLegacyJdOrder() {
|
||
c.callTransferLegacyJdOrder(func(params *tInitdataTransferLegacyJdOrderParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = tempop.TransferLegacyJdOrder(params.Ctx, params.IsAsync, params.IsContinueWhenError)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 将遗留ELM订单合并
|
||
// @Description 将遗留ELM订单合并
|
||
// @Param token header string true "认证token"
|
||
// @Param isAsync formData bool false "是否异步操作"
|
||
// @Param isContinueWhenError formData bool false "单个同步失败是否继续,缺省false"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /TransferLegacyElmOrder [post]
|
||
func (c *InitDataController) TransferLegacyElmOrder() {
|
||
c.callTransferLegacyElmOrder(func(params *tInitdataTransferLegacyElmOrderParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = tempop.TransferLegacyElmOrder(params.Ctx, params.IsAsync, params.IsContinueWhenError)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 拉取京东订单补齐本地
|
||
// @Description 拉取京东订单补齐本地
|
||
// @Param token header string true "认证token"
|
||
// @Param fromTime formData string true "开始时间"
|
||
// @Param toTime 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 /PullJdOrder [post]
|
||
func (c *InitDataController) PullJdOrder() {
|
||
c.callPullJdOrder(func(params *tInitdataPullJdOrderParams) (retVal interface{}, errCode string, err error) {
|
||
timeList, err := jxutils.BatchStr2Time(params.FromTime, params.ToTime)
|
||
if err != nil {
|
||
return retVal, "", err
|
||
}
|
||
retVal, err = tempop.PullJdOrder(params.Ctx, timeList[0], timeList[1], params.IsAsync, params.IsContinueWhenError)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 删除错误创建的SPU
|
||
// @Description 删除错误创建的SPU
|
||
// @Param token header string true "认证token"
|
||
// @Param isAsync formData bool false "是否异步操作"
|
||
// @Param isContinueWhenError formData bool false "单个同步失败是否继续,缺省false"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /DeleteWrongSpu [delete]
|
||
func (c *InitDataController) DeleteWrongSpu() {
|
||
c.callDeleteWrongSpu(func(params *tInitdataDeleteWrongSpuParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = tempop.DeleteWrongSpu(params.Ctx, params.IsAsync, params.IsContinueWhenError)
|
||
return retVal, "", err
|
||
})
|
||
}
|