fix
This commit is contained in:
@@ -41,7 +41,7 @@ func (l *GetCloudListLogic) GetCloudList(req *types.GetCloudListReq, userinfo *a
|
||||
if req.Page <= 0 {
|
||||
req.Page = constants.DEFAULT_PAGE
|
||||
}
|
||||
if req.PageSize <= 0 || req.PageSize > 200 {
|
||||
if req.PageSize <= 0 || req.PageSize > constants.MAX_PAGE_SIZE {
|
||||
req.PageSize = constants.DEFAULT_PAGE_SIZE
|
||||
}
|
||||
sizeFlag := false
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"fusenapi/constants"
|
||||
"fusenapi/model/gmodel"
|
||||
"fusenapi/utils/auth"
|
||||
"fusenapi/utils/basic"
|
||||
|
||||
@@ -30,6 +32,40 @@ func (l *GetPickupListLogic) GetPickupList(req *types.GetPickupListReq, userinfo
|
||||
if userinfo.GetIdType() != auth.IDTYPE_User {
|
||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, "please login first")
|
||||
}
|
||||
|
||||
if req.Page <= 0 {
|
||||
req.Page = constants.DEFAULT_PAGE
|
||||
}
|
||||
if req.PageSize <= 0 || req.PageSize > constants.MAX_PAGE_SIZE {
|
||||
req.PageSize = constants.DEFAULT_PAGE_SIZE
|
||||
}
|
||||
//获取列表
|
||||
pickListReq := gmodel.GetPickupListByParamReq{
|
||||
UserId: &userinfo.UserId,
|
||||
Page: req.Page,
|
||||
Limit: req.PageSize,
|
||||
}
|
||||
//状态筛选
|
||||
if req.Status != -1 {
|
||||
pickListReq.Status = &req.Status
|
||||
}
|
||||
pickupList, total, err := l.svcCtx.AllModels.FsCloudPickUp.GetPickupListByParam(l.ctx, pickListReq)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get pickup list")
|
||||
}
|
||||
if len(pickupList) == 0 {
|
||||
return resp.SetStatus(basic.CodeOK)
|
||||
}
|
||||
pickupIds := make([]int64, 0, len(pickupList))
|
||||
for _, v := range pickupList {
|
||||
pickupIds = append(pickupIds, v.Id)
|
||||
}
|
||||
//获取详情数据
|
||||
pickupDetailList, err := l.svcCtx.AllModels.FsCloudPickUpDetail.GetAllByIds(l.ctx, pickupIds)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get pickup detail list")
|
||||
}
|
||||
stockIds := make([]int64, 0, len(pickupList))
|
||||
return resp.SetStatus(basic.CodeOK)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user