Accept Merge Request #25: (don -> mark)

Merge Request: 修改库存刷新机制-美团和饿百分时刷新
Created By: @Nathan drake
Accepted By: @XJH-Rosy
URL: https://coding.net/u/XJH-Rosy/p/jx-callback/git/merge/25
This commit is contained in:
XJH-Rosy
2019-08-08 15:06:51 +08:00
7 changed files with 515 additions and 55 deletions

View File

@@ -11,6 +11,7 @@ import (
"git.rosy.net.cn/jx-callback/globals/api"
"github.com/astaxie/beego"
"git.rosy.net.cn/jx-callback/business/jxstore/misc"
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
)
type TempOpController struct {
@@ -275,18 +276,44 @@ func (c *TempOpController) TestIt() {
// @Title 开启或结束所有平台商店的额外时间
// @Description 开启或结束所有平台商店的额外时间并且修改所有商品库存为0或99999(开启0 结束99999)
// @Param token header string true "认证token"
// @Param startOrEndStore query bool true "开启或结束"
// @Param startTime query int false "开始营业时间(格式930代表早上9点30分)"
// @Param endTime query int false "结束营业时间"
// @Param isAsync query bool false "是否异步操作"
// @Param isContinueWhenError query bool false "单个同步失败是否继续缺省false"
// @Param token header string true "认证token"
// @Param vendorIDs formData string false "运营商ID列表(美团1 饿百3)"
// @Param storeIDs formData string false "京西门店ID列表"
// @Param startOrEndStore formData bool true "开启或结束"
// @Param startTime formData int false "开始营业时间(格式930代表早上9点30分)"
// @Param endTime formData int false "结束营业时间"
// @Param isAsync formData bool false "是否异步操作"
// @Param isContinueWhenError formData bool false "单个同步失败是否继续缺省false"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /TestStartOrEndOpStore [get]
// @router /TestStartOrEndOpStore [post]
func (c *TempOpController) TestStartOrEndOpStore() {
c.callTestStartOrEndOpStore(func(params *tTempopTestStartOrEndOpStoreParams) (retVal interface{}, errCode string, err error) {
retVal, err = misc.StartOrEndOpStore(params.StartOrEndStore, int16(params.StartTime), int16(params.EndTime), params.IsAsync, params.IsContinueWhenError)
var vendorIDList []int
var storeIDList []int
if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDList, params.StoreIDs, &storeIDList); err == nil {
retVal, err = misc.StartOrEndOpStore(params.StartOrEndStore, vendorIDList, storeIDList, int16(params.StartTime), int16(params.EndTime), params.IsAsync, params.IsContinueWhenError)
}
return retVal, "", err
})
}
// @Title 京西平台和其他平台商品的对比
// @Description 京西平台和其他平台商品的对比
// @Param token header string true "认证token"
// @Param vendorIDs formData string false "运营商ID列表(京东0 美团1 饿百3)"
// @Param storeIDs formData string false "京西门店ID列表"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /CheckSkuDiffBetweenJxAndVendor [post]
func (c *TempOpController) CheckSkuDiffBetweenJxAndVendor() {
c.callCheckSkuDiffBetweenJxAndVendor(func(params *tTempopCheckSkuDiffBetweenJxAndVendorParams) (retVal interface{}, errCode string, err error) {
var vendorIDList []int
var storeIDList []int
if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDList, params.StoreIDs, &storeIDList); err == nil {
cms.CheckSkuDiffBetweenJxAndVendor(vendorIDList, storeIDList)
}
return retVal, "", err
})
}