| | |
| | | // @Summary 入库/出库列表 |
| | | // @Produce application/json |
| | | // |
| | | // @Param number path string true "单号" |
| | | // @Param id path string true "id" |
| | | // |
| | | // @Success 200 {object} util.Response "成功" |
| | | // @Router /api-wms/v1/operation/getOperationInfo/{number} [post] |
| | | // @Router /api-wms/v1/operation/getOperationInfo/{id} [get] |
| | | func (slf OperationController) GetOperationInfo(c *gin.Context) { |
| | | number := c.Param("number") |
| | | number := c.Param("id") |
| | | if number == "" { |
| | | util.ResponseFormat(c, code.RequestParamError, "参数解析失败,参数不能为空") |
| | | return |
| | | } |
| | | operation, err := models.NewOperationSearch().SetNumber(number).SetPreload(true).First() |
| | | id, _ := strconv.Atoi(number) |
| | | operation, err := models.NewOperationSearch().SetID(id).SetPreload(true).First() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | |
| | | } |
| | | |
| | | detailsSearch.Orm = detailsSearch.Orm.Model(&models.MoveHistory{}). |
| | | Select("number, updated_at as date, product_name as product_name, from_location_id," + |
| | | Select("number, updated_at as date, product_name as product_name, from_location_id, operation_id," + |
| | | "to_location_id, amount, unit, operator as contacted_name, base_operation_type, weight, product_id, from_location, to_location").Order("id desc") |
| | | if len(ids) > 0 { |
| | | detailsSearch.Orm = detailsSearch.Orm.Where("id in ?", ids) |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/operation/getOperationInfo/{number}": { |
| | | "post": { |
| | | "/api-wms/v1/operation/getOperationInfo/{id}": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "description": "单号", |
| | | "name": "number", |
| | | "description": "id", |
| | | "name": "id", |
| | | "in": "path", |
| | | "required": true |
| | | } |
| | |
| | | "description": "单号", |
| | | "type": "string" |
| | | }, |
| | | "operationId": { |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "type": "string" |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/operation/getOperationInfo/{number}": { |
| | | "post": { |
| | | "/api-wms/v1/operation/getOperationInfo/{id}": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "description": "单号", |
| | | "name": "number", |
| | | "description": "id", |
| | | "name": "id", |
| | | "in": "path", |
| | | "required": true |
| | | } |
| | |
| | | "description": "单号", |
| | | "type": "string" |
| | | }, |
| | | "operationId": { |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "type": "string" |
| | | }, |
| | |
| | | number: |
| | | description: 单号 |
| | | type: string |
| | | operationId: |
| | | type: integer |
| | | productId: |
| | | type: string |
| | | productName: |
| | |
| | | summary: 获取物流公司列表 |
| | | tags: |
| | | - 入库/出库 |
| | | /api-wms/v1/operation/getOperationInfo/{number}: |
| | | post: |
| | | /api-wms/v1/operation/getOperationInfo/{id}: |
| | | get: |
| | | parameters: |
| | | - description: 单号 |
| | | - description: id |
| | | in: path |
| | | name: number |
| | | name: id |
| | | required: true |
| | | type: string |
| | | produces: |
| | |
| | | BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:基础作业类型"` //基础作业类型 |
| | | OperationTypeId int `json:"operationTypeId" gorm:"type:int;not null;comment:作业类型id"` //作业类型id |
| | | OperationTypeName string `json:"operationTypeName" gorm:"type:varchar(127);not null;comment:作业类型名称"` //作业类型名称 |
| | | OperationId int `json:"operationRecordId" gorm:"type:int;not null;comment:操作id"` //操作id |
| | | OperationId int `json:"operationId" gorm:"type:int;not null;comment:操作id"` //操作id |
| | | ProductId string `json:"productId" gorm:"type:varchar(255);not null;comment:产品id"` //产品id |
| | | ProductName string `json:"productName" gorm:"type:varchar(255);not null;comment:产品名称"` //产品名称 |
| | | Amount decimal.Decimal `json:"amount" gorm:"type:decimal(20,2);not null;comment:数量"` //数量 |
| | |
| | | ProductId string `json:"productId"` |
| | | FromLocationId int `json:"fromLocationId"` |
| | | ToLocationId int `json:"toLocationId"` |
| | | OperationId int `json:"operationId"` |
| | | } |
| | | |
| | | type LocationForms struct { |
| | |
| | | operationAPI := r.Group(urlPrefix + "/operation") |
| | | { |
| | | operationAPI.POST("list", operationController.List) |
| | | operationAPI.POST("getOperationInfo/:number", operationController.GetOperationInfo) |
| | | operationAPI.GET("getOperationInfo/:id", operationController.GetOperationInfo) |
| | | operationAPI.POST("operation", operationController.Add) |
| | | operationAPI.POST("update", operationController.Update) |
| | | operationAPI.DELETE("operation/:id", operationController.Delete) |