| | |
| | | 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 == "" { |
| | |
| | | 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 { |
| | |
| | | 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(¶ms); err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误:"+err.Error()) |
| | |
| | | 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 |