添加抖音授权登录,国美测试接口,修改运单重复骑手,添加推送骑手信息

This commit is contained in:
邹宗楠
2022-05-13 16:05:19 +08:00
parent 977d11ed9c
commit a91f46207f
49 changed files with 3355 additions and 254 deletions

View File

@@ -2,15 +2,19 @@ package controllers
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/auth2"
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
"git.rosy.net.cn/jx-callback/business/jxstore/common"
"git.rosy.net.cn/jx-callback/business/jxstore/misc"
"git.rosy.net.cn/jx-callback/business/jxstore/permission"
"git.rosy.net.cn/jx-callback/business/jxstore/secretNumber"
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/globals/api"
"github.com/astaxie/beego/server/web"
"github.com/pkg/errors"
)
type StoreController struct {
@@ -60,9 +64,10 @@ type StoreController struct {
func (c *StoreController) GetStores() {
c.callGetStores(func(params *tStoreGetStoresParams) (retVal interface{}, errCode string, err error) {
timeList, err := jxutils.BatchStr2Time(params.OrderTimeFrom, params.OrderTimeTo)
if err == nil {
retVal, err = cms.GetStores(params.Ctx, params.Keyword, params.MapData, params.Offset, params.PageSize, timeList[0], timeList[1], params.OrderCountFrom, params.OrderCountTo)
if err != nil {
return nil, "", err
}
retVal, err = cms.GetStores(params.Ctx, params.Keyword, params.MapData, params.Offset, params.PageSize, timeList[0], timeList[1], params.OrderCountFrom, params.OrderCountTo)
return retVal, "", err
})
}
@@ -704,8 +709,39 @@ func (c *StoreController) DeletePrinterSeq() {
// @router /GetStoreCategoryMap [get]
func (c *StoreController) GetStoreCategoryMap() {
c.callGetStoreCategoryMap(func(params *tStoreGetStoreCategoryMapParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetStoreCategoryMap(params.Ctx, params.ParentID, params.Level, params.StoreID)
return retVal, "", err
// 判断门店是不是b2b门店如果是用户必须为系统管理员门店老板和运营人员
store, err := dao.GetStoreList(dao.GetDB(), []int{params.StoreID}, nil, nil, nil, nil, "")
if err != nil {
return nil, "", err
}
if len(store) != model.YES {
return nil, "", errors.New("门店数据异常门店id不唯一" + string(params.StoreID))
}
// 获取门店分类
categoryList, err := cms.GetStoreCategoryMap(params.Ctx, params.ParentID, params.Level, params.StoreID)
// 门店为b2b
if store[0].BrandID == model.B2BNumberId {
// 获取用户权限如果是普通用户不展示b2b相关目录如果是门店老板或者管理则展示全部
userAuth, err := auth2.GetTokenInfo(params.Token)
if err != nil {
return nil, "", err
}
userRole, err := permission.GetUserRole(params.Ctx, userAuth.UserID)
if err != nil {
return nil, "", err
}
if len(userRole) == 0 { // 普通用户,无用户权限
//result := make([]*model.StoreCategoryMap, 0, 0)
//for _, v := range categoryList {
// if !strings.Contains(v.StoreCategoryName, model.B2BTag) {
// result = append(result, v)
// }
//}
return nil, "", errors.New("用户为普通用户无法查看B2B门店信息")
}
}
return categoryList, "", err
})
}

View File

@@ -564,6 +564,23 @@ func (c *StoreSkuController) RefreshJxPriceByExcel() {
})
}
// @Title 根据Excel导入订单,订单状态设置为待拣货
// @Description 根据Excel导入订单,订单状态设置为待拣货
// @Param token header string true "认证token"
// @Param isAsync formData bool true "是否异步,缺省是同步"
// @Param isContinueWhenError formData bool true "单个同步失败是否继续缺省false"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /RefreshJxOrderByExcel [post]
//func (c *StoreSkuController) RefreshJxOrderByExcel() {
// c.callRefreshJxOrderByExcel(func(params *tStoreSkuRefreshJxOrderByExcelParams) (retVal interface{}, errCode string, err error) {
// r := c.Ctx.Request
// files := r.MultipartForm.File["userfiles"]
// retVal, err = cms.RefreshJxPriceByExcel(params.Ctx, storeIDList, files, params.IsAsync, params.IsContinueWhenError)
// return retVal, "", err
// })
//}
// @Title 根据Excel中SkuID批量关注商品
// @Description 根据Excel中SkuID批量关注商品
// @Param token header string true "认证token"