Merge remote-tracking branch 'origin/mark' into don

This commit is contained in:
Rosy-zhudan
2019-09-11 17:38:54 +08:00
40 changed files with 754 additions and 289 deletions

View File

@@ -132,6 +132,37 @@ func (c *User2Controller) GetRoleUserList() {
})
}
// @Title 批量得到角色包括的用户列表
// @Description 批量得到角色包括的用户列表
// @Param token header string true "认证token"
// @Param roleNames query string true "角色名"
// @Param storeIDs query string false "门店ID如果是全局角色不用填"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetRolesUserList [get]
func (c *User2Controller) GetRolesUserList() {
c.callGetRolesUserList(func(params *tUser2GetRolesUserListParams) (retVal interface{}, errCode string, err error) {
var roleNames []string
var storeIDs []int
if err = jxutils.Strings2Objs(params.RoleNames, &roleNames, params.StoreIDs, &storeIDs); err == nil {
var roleList []*authz.RoleInfo
for _, roleName := range roleNames {
if len(storeIDs) == 0 {
roleList = append(roleList, autils.NewRole(roleName, 0))
} else {
if roleName == authz.StoreRoleBoss {
for _, storeID := range storeIDs {
roleList = append(roleList, autils.NewRole(roleName, storeID))
}
}
}
}
retVal, err = cms.GetRolesUserList(params.Ctx, roleList)
}
return retVal, "", err
})
}
// @Title 给指定用户添加角色列表
// @Description 给指定用户添加角色列表
// @Param token header string true "认证token"

View File

@@ -173,27 +173,13 @@ func (c *OrderController) CancelWaybill() {
// @Param token header string true "认证token"
// @Param storeID query int true "京西门店ID"
// @Param lastHours query int false "最近多少小时的信息(缺省为两天)"
// @Param isIncludeFake query bool false "是否包括假订单"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetStoreOrderCountInfo [get]
func (c *OrderController) GetStoreOrderCountInfo() {
c.callGetStoreOrderCountInfo(func(params *tOrderGetStoreOrderCountInfoParams) (retVal interface{}, errCode string, err error) {
retVal, err = orderman.FixedOrderManager.GetStoreOrderCountInfo(params.Ctx, params.StoreID, params.LastHours)
return retVal, "", err
})
}
// @Title 得到门店订单信息2
// @Description 得到门店订单信息2
// @Param token header string true "认证token"
// @Param storeID query int true "京西门店ID"
// @Param lastHours query int false "最近多少小时的信息(缺省为两天)"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetStoreOrderCountInfo2 [get]
func (c *OrderController) GetStoreOrderCountInfo2() {
c.callGetStoreOrderCountInfo2(func(params *tOrderGetStoreOrderCountInfo2Params) (retVal interface{}, errCode string, err error) {
retVal, err = orderman.FixedOrderManager.GetStoreOrderCountInfo(params.Ctx, params.StoreID, params.LastHours)
retVal, err = orderman.FixedOrderManager.GetStoreOrderCountInfo(params.Ctx, params.StoreID, params.LastHours, params.IsIncludeFake)
return retVal, "", err
})
}
@@ -289,6 +275,7 @@ func (c *OrderController) ExportMTWaybills() {
// @Param statuss query string false "订单状态列表[1,2,3],缺省不限制"
// @Param lockStatuss query string false "订单锁定状态列表[1,2,3],缺省不限制"
// @Param cities query string false "城市code列表[1,2,3],缺省不限制"
// @Param isIncludeFake query bool false "是否包括假订单"
// @Param offset query int false "结果起始序号以0开始缺省为0"
// @Param pageSize query int false "结果页大小缺省为50-1表示全部"
// @Success 200 {object} controllers.CallResult
@@ -296,7 +283,7 @@ func (c *OrderController) ExportMTWaybills() {
// @router /GetOrders [get]
func (c *OrderController) GetOrders() {
c.callGetOrders(func(params *tOrderGetOrdersParams) (retVal interface{}, errCode string, err error) {
retVal, err = orderman.FixedOrderManager.GetOrders(params.Ctx, params.FromDate, params.ToDate, params.IsDateFinish, params.MapData, params.Offset, params.PageSize)
retVal, err = orderman.FixedOrderManager.GetOrders(params.Ctx, params.IsIncludeFake, params.FromDate, params.ToDate, params.IsDateFinish, params.MapData, params.Offset, params.PageSize)
return retVal, "", err
})
}

View File

@@ -11,13 +11,14 @@ type NetSpiderController struct {
beego.Controller
}
// @Title 同步商家商品信息
// @Description 同步商家商品信息
// @Title 从网页拉取平台门店信息
// @Description 从网页拉取平台门店信息
// @Param token header string true "认证token"
// @Param vendorIDs formData string false "厂商ID列表"
// @Param cityCodes formData string false "城市列表,缺省为后台启用了的城市"
// @Param radius formData int false "区域半径市或街道的半径会自动增加或缩小单位为米缺省8000米"
// @Param gridWith formData int false "网格大小单位为米缺省为2000米"
// @Param isShuffle formData bool false "是否将城市列表随机打乱"
// @Param isAsync formData bool false "是否异步"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
@@ -27,7 +28,7 @@ func (c *NetSpiderController) GetAndStoreCitiesShops() {
var vendorIDs, cityCodes []int
err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDs, params.CityCodes, &cityCodes)
if err == nil {
retVal, err = netspider.GetAndStoreCitiesShops(params.Ctx, vendorIDs, cityCodes, params.Radius, params.GridWith, params.IsAsync)
retVal, err = netspider.GetAndStoreCitiesShops(params.Ctx, vendorIDs, cityCodes, params.Radius, params.GridWith, params.IsShuffle, params.IsAsync)
}
return retVal, "", err
})