liujiandao
2023-10-23 4041b5571482c5515d15857f59b14a72045350c6
controllers/operation.go
@@ -128,8 +128,8 @@
      return errors.New("请填入源单号")
   }
   if params.OperationTypeId == 0 {
      return errors.New("operationTypeId为0")
   if params.OperationTypeId == 0 || int(params.BaseOperationType) == 0 {
      return errors.New("未识别该记录类型")
   }
   if params.OperationDate == "" {
@@ -177,6 +177,9 @@
   search.SetPage(params.Page, params.PageSize)
   if params.Number != "" {
      search.SetKeyword(params.Number)
   }
   if int(params.Status) != 0 {
      search.SetStatus(params.Status)
   }
   list, total, err := search.SetOperationTypeId(params.OperationTypeId).SetPreload(true).SetOrder("created_at desc").Find()
   if err != nil {
@@ -440,14 +443,14 @@
   util.ResponseFormat(c, code.Success, "操作成功")
}
// ListAll
// listTransfer
// @Tags      入库/出库
// @Summary   调拨
// @Summary   库存调拨列表
// @Produce   application/json
// @Param     object  body  request.OperationAllList true  "参数"
// @Success   200 {object} util.Response "成功"
// @Router    /api-wms/v1/operation/listAll [post]
func (slf OperationController) ListAll(c *gin.Context) {
// @Router    /api-wms/v1/operation/listTransfer [post]
func (slf OperationController) ListTransfer(c *gin.Context) {
   var params request.OperationAllList
   if err := c.BindJSON(&params); err != nil {
      util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误:"+err.Error())
@@ -463,7 +466,7 @@
   if params.Number != "" {
      search.SetKeyword(params.Number)
   }
   list, total, err := search.SetPreload(true).SetOrder("created_at desc").Find()
   list, total, err := search.SetPreload(true).SetBaseOperationType(constvar.BaseOperationTypeInternal).SetOrder("created_at desc").Find()
   if err != nil {
      util.ResponseFormat(c, code.RequestError, "查找失败:"+err.Error())
      return