| | |
| | | "wms/proto/purchase_wms" |
| | | "wms/proto/supplier" |
| | | "wms/request" |
| | | "wms/service" |
| | | "wms/utils/http" |
| | | "wms/utils/upload" |
| | | ) |
| | |
| | | } |
| | | |
| | | return nil |
| | | } |
| | | |
| | | // GetOperationInfo |
| | | // @Tags 入库/出库 |
| | | // @Summary 入库/出库列表 |
| | | // @Produce application/json |
| | | // |
| | | // @Param number path string true "单号" |
| | | // |
| | | // @Success 200 {object} util.Response "成功" |
| | | // @Router /api-wms/v1/operation/getOperationInfo/{number} [post] |
| | | func (slf OperationController) GetOperationInfo(c *gin.Context) { |
| | | number := c.Param("number") |
| | | if number == "" { |
| | | util.ResponseFormat(c, code.RequestParamError, "参数解析失败,参数不能为空") |
| | | return |
| | | } |
| | | operation, err := models.NewOperationSearch().SetNumber(number).SetPreload(true).First() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | } |
| | | util.ResponseFormat(c, code.Success, operation) |
| | | } |
| | | |
| | | // List |
| | |
| | | OperationTypeId: operation.OperationTypeId, |
| | | OperationTypeName: operation.OperationTypeName, |
| | | OperationId: operation.Id, |
| | | ProductId: v.ProductId, |
| | | ProductName: v.Product.Name, |
| | | Amount: v.Amount, |
| | | Unit: v.Product.Unit, |
| | |
| | | if err := db.Model(&models.MoveHistory{}).Create(&histories).Error; err != nil { |
| | | return err |
| | | } |
| | | for _, history := range histories { |
| | | service.AddNewHistoryReportRecord(history.Id) |
| | | } |
| | | return nil |
| | | } |
| | | |