zhangqian
2023-11-17 844f645172ebde7e94307004647e4a41f71030be
controllers/report_forms_controller.go
@@ -10,6 +10,7 @@
   "wms/models"
   "wms/request"
   "wms/response"
   "wms/service"
)
type ReportFormsController struct {
@@ -218,17 +219,6 @@
   util.ResponseFormatList(c, code.Success, result, int(total))
}
// GetOutOrInOperationList
// @Tags      报表
// @Summary   获取出入库操作明细
// @Produce   application/json
// @Param     object  body  request.GetLocationForms true  "查询参数"
// @Success   200 {object} util.ResponseList{data=[]response.LocationForms}   "成功"
// @Router    /api-wms/v1/forms/getOutOrInOperationList [post]
func (slf ReportFormsController) GetOutOrInOperationList(c *gin.Context) {
}
// GetLocationForms
// @Tags      报表
// @Summary   获取位置报表
@@ -247,7 +237,7 @@
      ids = append(ids, params.LocationId)
   } else {
      //查询位置
      locations, err := models.NewLocationSearch().SetJointName(params.WareHouseCode).FindAll()
      locations, err := models.NewLocationSearch().SetJointName(params.WareHouseCode).SetType(3).FindAll()
      if err != nil {
         util.ResponseFormat(c, code.RequestParamError, "查询位置失败")
         return
@@ -256,11 +246,19 @@
         ids = append(ids, location.Id)
      }
   }
   amounts, total, err := models.NewLocationProductAmountSearch().SetPage(params.Page, params.PageSize).SetPreload(true).SetKeyword(params.KeyWord).SetProductId(params.ProductId).SetLocationIds(ids).FindByPage()
   if err != nil {
      util.ResponseFormat(c, code.RequestParamError, "查询数量失败")
      return
   var (
      amounts []*models.LocationProductAmount
      total   int64
      err     error
   )
   if params.KeyWord != "" {
      amounts, total, err = service.SearchLocationReport(params.KeyWord, params.Page, params.PageSize)
   } else {
      amounts, total, err = models.NewLocationProductAmountSearch().SetPage(params.Page, params.PageSize).SetPreload(true).SetKeyword(params.KeyWord).SetProductId(params.ProductId).SetLocationIds(ids).FindByPage()
      if err != nil {
         util.ResponseFormat(c, code.RequestParamError, "查询数量失败")
         return
      }
   }
   var result []response.LocationForms