修改库存刷新机制-美团和饿百分时刷新

This commit is contained in:
Rosy-zhudan
2019-08-07 15:19:29 +08:00
parent e64e0cc4fb
commit 877566cc80
3 changed files with 120 additions and 38 deletions

View File

@@ -276,18 +276,24 @@ 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
})
}