yonghuiexcel

This commit is contained in:
苏尹岚
2019-11-22 19:08:48 +08:00
parent 70bf3a70a9
commit ae6ad69d8c
2 changed files with 61 additions and 14 deletions

View File

@@ -4,6 +4,7 @@ import (
"io"
"git.rosy.net.cn/jx-callback/business/jxstore/yonghui"
"git.rosy.net.cn/jx-callback/business/jxutils"
"github.com/astaxie/beego"
)
@@ -46,17 +47,18 @@ func (c *YongHuiController) LoadExcelByYongHui() {
// @Title 根据微盟商品更新京西价格
// @Description 根据微盟商品更新京西价格
// @Param token header string true "认证token"
// @Param storeIDs formData string false "门店ID列表"
// @Param storeIDs formData string true "门店ID列表"
// @Param isAsync formData bool true "是否异步,缺省是同步"
// @Param isContinueWhenError formData bool true "单个同步失败是否继续缺省false"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /UpdateJxPriceByWeimob [post]
func (c *YongHuiController) UpdateJxPriceByWeimob() {
// c.callLoadExcelByYongHui(func(params *tYonghuiLoadExcelByYongHuiParams) (retVal interface{}, errCode string, err error) {
// r := c.Ctx.Request
// files := r.MultipartForm.File["userfiles"]
// retVal, err = yonghui.LoadExcelByYongHui(params.Ctx, files, params.IsAsync, params.IsContinueWhenError)
// return retVal, "", err
// })
c.callUpdateJxPriceByWeimob(func(params *tYonghuiUpdateJxPriceByWeimobParams) (retVal interface{}, errCode string, err error) {
var storeIDList []int
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDList); err == nil {
retVal, err = yonghui.UpdateJxPriceByWeimob(params.Ctx, storeIDList, isAsync, isContinueWhenError)
}
return retVal, "", err
})
}