| | |
| | | if res := models.NewOperationSearch().Orm.Preload("Details", "product_id=?", v.ProductId).Where("wms_operation.base_operation_type=? and wms_operation.status=? and wms_operation.to_location_id=?", constvar.BaseOperationTypeAdjust, constvar.OperationStatus_Ready, v.LocationId).First(&operation); res.Error != nil { |
| | | if errors.Is(res.Error, gorm.ErrRecordNotFound) { |
| | | records[k].Status = constvar.OperationStatus_Finish |
| | | records[k].BaseOperationType = constvar.BaseOperationTypeAdjust |
| | | continue |
| | | } else { |
| | | util.ResponseFormat(c, code.RequestError, fmt.Errorf("find operation err: %v", res.Error.Error())) |
| | |
| | | records[k].OperationId = operation.Id |
| | | records[k].Status = operation.Status |
| | | } |
| | | records[k].BaseOperationType = constvar.BaseOperationTypeAdjust |
| | | } |
| | | util.ResponseFormatListWithPage(c, code.Success, records, int(total), params.Page, params.PageSize) |
| | | } |
| | |
| | | // @Produce application/json |
| | | // @Param object query request.ListTransfer true "查询参数" |
| | | // @Success 200 {object} util.ResponseList "成功" |
| | | // @Router /api-wms/v1/operationType/operationType [get] |
| | | // @Router /api-wms/v1/operationType/listTransfer [get] |
| | | func (slf OperationTypeController) ListTransfer(c *gin.Context) { |
| | | var params request.GetOperationTypeList |
| | | if err := c.ShouldBindQuery(¶ms); err != nil { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/operationType/operationType": { |
| | | "/api-wms/v1/operationType/listTransfer": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/operationType/operationType": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "业务类型" |
| | | ], |
| | | "summary": "查询作业类型列表", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "keyword", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "页码", |
| | | "name": "page", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "每页大小", |
| | | "name": "pageSize", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "post": { |
| | | "produces": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/operationType/operationType": { |
| | | "/api-wms/v1/operationType/listTransfer": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/operationType/operationType": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "业务类型" |
| | | ], |
| | | "summary": "查询作业类型列表", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "keyword", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "页码", |
| | | "name": "page", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "每页大小", |
| | | "name": "pageSize", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "post": { |
| | | "produces": [ |
| | |
| | | summary: 修改入库/出库信息 |
| | | tags: |
| | | - 入库/出库 |
| | | /api-wms/v1/operationType/operationType: |
| | | /api-wms/v1/operationType/listTransfer: |
| | | get: |
| | | parameters: |
| | | - in: query |
| | |
| | | summary: 调拨类型列表 |
| | | tags: |
| | | - 业务类型 |
| | | /api-wms/v1/operationType/operationType: |
| | | get: |
| | | parameters: |
| | | - in: query |
| | | name: keyword |
| | | type: string |
| | | - description: 页码 |
| | | in: query |
| | | name: page |
| | | type: integer |
| | | - description: 每页大小 |
| | | in: query |
| | | name: pageSize |
| | | type: integer |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | $ref: '#/definitions/util.ResponseList' |
| | | summary: 查询作业类型列表 |
| | | tags: |
| | | - 业务类型 |
| | | post: |
| | | parameters: |
| | | - description: 作业类型信息 |
| | |
| | | |
| | | LocationProductAmountWithOperation struct { |
| | | //LocationProductAmount LocationProductAmount `json:"locationProductAmount"` |
| | | LocationProductAmountId int `json:"locationProductAmountId" gorm:"location_product_amount_id"` |
| | | LocationId int `json:"locationId" gorm:"column:location_id"` |
| | | LocationName string `json:"locationName" gorm:"column:location_name"` |
| | | ProductId string `json:"productId" gorm:"column:product_id"` |
| | | ProductName string `json:"productName" gorm:"column:product_name"` |
| | | Amount decimal.Decimal `json:"amount" gorm:"column:amount"` |
| | | Unit string `json:"unit" gorm:"column:unit"` |
| | | CreateDate string `json:"createDate" gorm:"column:create_date"` |
| | | AdjustAmount decimal.Decimal `json:"adjustAmount" gorm:"column:adjust_amount"` |
| | | DifferenceAmount decimal.Decimal `json:"differenceAmount" gorm:"-"` |
| | | OperationId int `json:"operationId" gorm:"column:operation_id"` |
| | | Status constvar.OperationStatus `json:"status" gorm:"status"` |
| | | LocationProductAmountId int `json:"locationProductAmountId" gorm:"location_product_amount_id"` |
| | | LocationId int `json:"locationId" gorm:"column:location_id"` |
| | | LocationName string `json:"locationName" gorm:"column:location_name"` |
| | | ProductId string `json:"productId" gorm:"column:product_id"` |
| | | ProductName string `json:"productName" gorm:"column:product_name"` |
| | | Amount decimal.Decimal `json:"amount" gorm:"column:amount"` |
| | | Unit string `json:"unit" gorm:"column:unit"` |
| | | CreateDate string `json:"createDate" gorm:"column:create_date"` |
| | | AdjustAmount decimal.Decimal `json:"adjustAmount" gorm:"column:adjust_amount"` |
| | | DifferenceAmount decimal.Decimal `json:"differenceAmount" gorm:"-"` |
| | | OperationId int `json:"operationId" gorm:"column:operation_id"` |
| | | Status constvar.OperationStatus `json:"status" gorm:"status"` |
| | | BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"base_operation_type"` |
| | | } |
| | | ) |
| | | |