| | |
| | | // @Param object body request.UpdateLocationProductAmount true "入库/出库信息" |
| | | // @Success 200 {object} util.Response "成功" |
| | | // @Router /api-wms/v1/locationProductAmount/update [post] |
| | | //func (slf LocationProductAmountController) Update(c *gin.Context) { |
| | | // var reqParams request.UpdateLocationProductAmount |
| | | // if err := c.BindJSON(&reqParams); err != nil { |
| | | // util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误") |
| | | // return |
| | | // } |
| | | // |
| | | // var existCount int64 |
| | | // if err := models.NewOperationSearch().Orm.Table("wms_operation").InnerJoins("inner join wms_operation_details on wms_operation_details.operation_id=wms_operation.id").Where("wms_operation.from_location_id=? and wms_operation_details.product_id=? and wms_operation.base_operation_type=? and wms_operation.status=?", reqParams.LocationId, reqParams.ProductId, constvar.BaseOperationTypeAdjust, constvar.OperationStatus_Ready).Count(&existCount).Error; err != nil { |
| | | // util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | // return |
| | | // } |
| | | // if existCount > 0 { |
| | | // util.ResponseFormat(c, code.RequestError, "该商品在已选中的位置存在未验证的库存盘点信息,无法继续添加相关信息") |
| | | // return |
| | | // } |
| | | // |
| | | // locProduct, err := models.NewLocationProductSearch().SetLocationId(reqParams.LocationId).SetProductId(reqParams.ProductId).First() |
| | | // if err != nil { |
| | | // util.ResponseFormat(c, code.RequestParamError, "参数异常,未找到该上架规则") |
| | | // return |
| | | // } |
| | | // if locProduct.Id == 0 { |
| | | // util.ResponseFormat(c, code.RequestError, "不存在该上架规则,无法进行库存盘点") |
| | | // return |
| | | // } |
| | | // location, err := models.NewLocationSearch().SetType(int(constvar.LocationTypeAdjust)).First() |
| | | // if err != nil { |
| | | // util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | // return |
| | | // } |
| | | // //reqParams.AdjustAmount = reqParams.Amount.Sub(reqParams.DifferenceAmount) |
| | | // reqParams.AdjustAmount = reqParams.DifferenceAmount.Sub(reqParams.Amount) |
| | | // locAmount := models.LocationProductAmount{ |
| | | // LocationProductId: locProduct.Id, |
| | | // Amount: decimal.NewFromInt(0), |
| | | // CreateDate: time.Now().Format("2006-01-02 15:04:05"), |
| | | // } |
| | | // detail := &models.OperationDetails{ |
| | | // ProductId: reqParams.ProductId, |
| | | // Amount: reqParams.AdjustAmount, |
| | | // } |
| | | // operation := models.Operation{ |
| | | // Number: strconv.FormatInt(time.Now().Unix(), 10), |
| | | // Status: constvar.OperationStatus_Ready, |
| | | // OperationDate: time.Now().Format("2006-01-02 15:04:05"), |
| | | // Comment: "库存盘点", |
| | | // BaseOperationType: constvar.BaseOperationTypeAdjust, |
| | | // Details: []*models.OperationDetails{detail}, |
| | | // FromLocationID: location.Id, |
| | | // ToLocationID: reqParams.LocationId, |
| | | // } |
| | | // |
| | | // //if reqParams.AdjustAmount.GreaterThanOrEqual(decimal.NewFromInt(0)) { |
| | | // // operation.FromLocationID = Location.Id |
| | | // // operation.ToLocationID = reqParams.LocationId |
| | | // //} else { |
| | | // // operation.FromLocationID = reqParams.LocationId |
| | | // // operation.ToLocationID = Location.Id |
| | | // //} |
| | | // |
| | | // if err := models.WithTransaction(func(tx *gorm.DB) error { |
| | | // if err := models.NewOperationSearch().SetOrm(tx).Create(&operation); err != nil { |
| | | // return err |
| | | // } |
| | | // if err := models.NewLocationProductAmountSearch().SetOrm(tx).Create(&locAmount); err != nil { |
| | | // return err |
| | | // } |
| | | // return nil |
| | | // }); err != nil { |
| | | // util.ResponseFormat(c, code.RequestError, err.Error()) |
| | | // return |
| | | // } |
| | | // |
| | | // util.ResponseFormat(c, code.Success, "添加成功") |
| | | //} |
| | | func (slf LocationProductAmountController) Update(c *gin.Context) { |
| | | var reqParams request.UpdateLocationProductAmount |
| | | if err := c.BindJSON(&reqParams); err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误") |
| | | return |
| | | } |
| | | reqParams.AdjustAmount = reqParams.DifferenceAmount.Sub(reqParams.Amount) |
| | | operation, err := models.NewOperationSearch().SetID(reqParams.OperationId).First() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "未找到相关数据") |
| | | return |
| | | } |
| | | if operation.Status != constvar.OperationStatus_Ready { |
| | | util.ResponseFormat(c, code.RequestParamError, "该记录已验证通过,无法进行修改") |
| | | return |
| | | } |
| | | |
| | | if err := models.NewOperationDetailsSearch().SetOperationId(reqParams.OperationId).SetProductId(reqParams.ProductId).Update(&models.OperationDetails{Amount: reqParams.AdjustAmount}); err != nil { |
| | | util.ResponseFormat(c, code.RequestError, "修改失败:"+err.Error()) |
| | | return |
| | | } |
| | | |
| | | util.ResponseFormat(c, code.Success, "修改成功") |
| | | } |
| | |
| | | search := models.NewOperationSearch() |
| | | search.SetPage(params.Page, params.PageSize) |
| | | if params.Number != "" { |
| | | search.SetNumber(params.Number) |
| | | } |
| | | if params.SourceNumber != "" { |
| | | search.SetSourceNumber(params.SourceNumber) |
| | | search.SetKeyword(params.Number) |
| | | } |
| | | list, total, err := search.SetOperationTypeId(params.OperationTypeId).SetPreload(true).SetOrder("created_at desc").Find() |
| | | if err != nil { |
| | |
| | | search.SetPage(params.Page, params.PageSize) |
| | | search.SetPage(params.Page, params.PageSize) |
| | | if params.Number != "" { |
| | | search.SetNumber(params.Number) |
| | | } |
| | | if params.SourceNumber != "" { |
| | | search.SetSourceNumber(params.SourceNumber) |
| | | search.SetKeyword(params.Number) |
| | | } |
| | | list, total, err := search.SetPreload(true).SetOrder("created_at desc").Find() |
| | | if err != nil { |
| | |
| | | |
| | | db := models.NewOperationSearch().Orm.Table("wms_operation").Select("wms_operation.id,wms_operation.number,wms_operation.source_number,wms_operation.status,wms_operation.from_location_id,wms_operation.to_location_id,wms_operation.operation_date,wms_operation.contacter_id,wms_operation.contacter_name,wms_operation.company_id,wms_operation.company_name,wms_operation.comment,wms_operation_details.product_id,material.name as product_name,material.unit,wms_operation_details.amount").InnerJoins("inner join wms_operation_details on wms_operation_details.operation_id=wms_operation.id").InnerJoins("inner join material on material.id=wms_operation_details.product_id") |
| | | |
| | | if params.SourceNumber != "" { |
| | | db = db.Where("wms_operation.source_number like ?", fmt.Sprintf("%%%v%%", params.SourceNumber)) |
| | | } |
| | | if params.Number != "" { |
| | | db = db.Where("wms_operation.number like ?", fmt.Sprintf("%%%v%%", params.Number)) |
| | | db = db.Where("wms_operation.number like ? or wms_operation.source_number like ?", fmt.Sprintf("%%%v%%", params.Number), fmt.Sprintf("%%%v%%", params.Number)) |
| | | } |
| | | db = db.Where("wms_operation.operation_type_id=?", 0) |
| | | var ( |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/forms/getHistory": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "报表" |
| | | ], |
| | | "summary": "获取历史信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.GetInventoryHistory" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/response.InventoryHistory" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/forms/getInventoryForms": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "报表" |
| | | ], |
| | | "summary": "获取库存报表", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.GetInventoryForms" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/response.InventoryForms" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/forms/getLocationForms": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "报表" |
| | | ], |
| | | "summary": "获取位置报表", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.PageInfo" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/response.LocationForms" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/location/addLocation": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.PageInfo" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/locationProductAmount/update": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "库存盘点" |
| | | ], |
| | | "summary": "修改库存盘点信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "入库/出库信息", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.UpdateLocationProductAmount" |
| | | } |
| | | } |
| | | ], |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.GetInventoryForms": { |
| | | "type": "object", |
| | | "properties": { |
| | | "categoryIds": { |
| | | "description": "产品类型id", |
| | | "type": "array", |
| | | "items": { |
| | | "type": "integer" |
| | | } |
| | | }, |
| | | "page": { |
| | | "description": "页码", |
| | | "type": "integer" |
| | | }, |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "warehouseCode": { |
| | | "description": "仓库缩写", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.GetInventoryHistory": { |
| | | "type": "object", |
| | | "properties": { |
| | | "page": { |
| | | "description": "页码", |
| | | "type": "integer" |
| | | }, |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "produceId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | | }, |
| | | "productName": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "unit": { |
| | | "description": "单位", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.GetProductList": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "sourceNumber": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "sourceNumber": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | }, |
| | | "productCategoryId": { |
| | | "description": "产品种类id", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdateLocationProductAmount": { |
| | | "type": "object", |
| | | "properties": { |
| | | "Amount": { |
| | | "description": "库存数量", |
| | | "type": "number" |
| | | }, |
| | | "adjustAmount": { |
| | | "description": "LocationProductAmountId int ` + "`" + `json:\"locationProductAmountId\"` + "`" + ` //库存盘点id", |
| | | "type": "number" |
| | | }, |
| | | "differenceAmount": { |
| | | "description": "计数数量", |
| | | "type": "number" |
| | | }, |
| | | "operationId": { |
| | | "description": "出入库id", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "response.InventoryForms": { |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "description": "在库数量", |
| | | "type": "number" |
| | | }, |
| | | "availableNumber": { |
| | | "description": "可用库存", |
| | | "type": "number" |
| | | }, |
| | | "cost": { |
| | | "description": "成本", |
| | | "type": "number" |
| | | }, |
| | | "in": { |
| | | "description": "入库", |
| | | "type": "number" |
| | | }, |
| | | "out": { |
| | | "description": "出库", |
| | | "type": "number" |
| | | }, |
| | | "produceId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | | }, |
| | | "productName": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "productType": { |
| | | "description": "产品类型", |
| | | "type": "string" |
| | | }, |
| | | "unit": { |
| | | "description": "单位", |
| | | "type": "string" |
| | | }, |
| | | "value": { |
| | | "description": "总价值", |
| | | "type": "number" |
| | | } |
| | | } |
| | | }, |
| | | "response.InventoryHistory": { |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "baseOperationType": { |
| | | "description": "基础作业类型", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.BaseOperationType" |
| | | } |
| | | ] |
| | | }, |
| | | "contactedName": { |
| | | "description": "完成者", |
| | | "type": "string" |
| | | }, |
| | | "date": { |
| | | "description": "日期", |
| | | "type": "string" |
| | | }, |
| | | "fromLocation": { |
| | | "description": "源位置", |
| | | "type": "string" |
| | | }, |
| | | "number": { |
| | | "description": "单号", |
| | | "type": "string" |
| | | }, |
| | | "toLocation": { |
| | | "description": "目标位置", |
| | | "type": "string" |
| | | }, |
| | | "unit": { |
| | | "description": "单位", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "response.LocationForms": { |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "locationName": { |
| | | "description": "位置名称", |
| | | "type": "string" |
| | | }, |
| | | "produceId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | | }, |
| | | "productName": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "productTypeName": { |
| | | "description": "产品类别", |
| | | "type": "string" |
| | | }, |
| | | "unit": { |
| | | "description": "单位", |
| | | "type": "string" |
| | | }, |
| | | "value": { |
| | | "description": "总价值", |
| | | "type": "number" |
| | | } |
| | | } |
| | | }, |
| | | "util.Response": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/forms/getHistory": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "报表" |
| | | ], |
| | | "summary": "获取历史信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.GetInventoryHistory" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/response.InventoryHistory" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/forms/getInventoryForms": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "报表" |
| | | ], |
| | | "summary": "获取库存报表", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.GetInventoryForms" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/response.InventoryForms" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/forms/getLocationForms": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "报表" |
| | | ], |
| | | "summary": "获取位置报表", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.PageInfo" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/response.LocationForms" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/location/addLocation": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.PageInfo" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/locationProductAmount/update": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "库存盘点" |
| | | ], |
| | | "summary": "修改库存盘点信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "入库/出库信息", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.UpdateLocationProductAmount" |
| | | } |
| | | } |
| | | ], |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.GetInventoryForms": { |
| | | "type": "object", |
| | | "properties": { |
| | | "categoryIds": { |
| | | "description": "产品类型id", |
| | | "type": "array", |
| | | "items": { |
| | | "type": "integer" |
| | | } |
| | | }, |
| | | "page": { |
| | | "description": "页码", |
| | | "type": "integer" |
| | | }, |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "warehouseCode": { |
| | | "description": "仓库缩写", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.GetInventoryHistory": { |
| | | "type": "object", |
| | | "properties": { |
| | | "page": { |
| | | "description": "页码", |
| | | "type": "integer" |
| | | }, |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "produceId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | | }, |
| | | "productName": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "unit": { |
| | | "description": "单位", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.GetProductList": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "sourceNumber": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "sourceNumber": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | }, |
| | | "productCategoryId": { |
| | | "description": "产品种类id", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdateLocationProductAmount": { |
| | | "type": "object", |
| | | "properties": { |
| | | "Amount": { |
| | | "description": "库存数量", |
| | | "type": "number" |
| | | }, |
| | | "adjustAmount": { |
| | | "description": "LocationProductAmountId int `json:\"locationProductAmountId\"` //库存盘点id", |
| | | "type": "number" |
| | | }, |
| | | "differenceAmount": { |
| | | "description": "计数数量", |
| | | "type": "number" |
| | | }, |
| | | "operationId": { |
| | | "description": "出入库id", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "response.InventoryForms": { |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "description": "在库数量", |
| | | "type": "number" |
| | | }, |
| | | "availableNumber": { |
| | | "description": "可用库存", |
| | | "type": "number" |
| | | }, |
| | | "cost": { |
| | | "description": "成本", |
| | | "type": "number" |
| | | }, |
| | | "in": { |
| | | "description": "入库", |
| | | "type": "number" |
| | | }, |
| | | "out": { |
| | | "description": "出库", |
| | | "type": "number" |
| | | }, |
| | | "produceId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | | }, |
| | | "productName": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "productType": { |
| | | "description": "产品类型", |
| | | "type": "string" |
| | | }, |
| | | "unit": { |
| | | "description": "单位", |
| | | "type": "string" |
| | | }, |
| | | "value": { |
| | | "description": "总价值", |
| | | "type": "number" |
| | | } |
| | | } |
| | | }, |
| | | "response.InventoryHistory": { |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "baseOperationType": { |
| | | "description": "基础作业类型", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.BaseOperationType" |
| | | } |
| | | ] |
| | | }, |
| | | "contactedName": { |
| | | "description": "完成者", |
| | | "type": "string" |
| | | }, |
| | | "date": { |
| | | "description": "日期", |
| | | "type": "string" |
| | | }, |
| | | "fromLocation": { |
| | | "description": "源位置", |
| | | "type": "string" |
| | | }, |
| | | "number": { |
| | | "description": "单号", |
| | | "type": "string" |
| | | }, |
| | | "toLocation": { |
| | | "description": "目标位置", |
| | | "type": "string" |
| | | }, |
| | | "unit": { |
| | | "description": "单位", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "response.LocationForms": { |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "locationName": { |
| | | "description": "位置名称", |
| | | "type": "string" |
| | | }, |
| | | "produceId": { |
| | | "description": "产品id", |
| | | "type": "string" |
| | | }, |
| | | "productName": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "productTypeName": { |
| | | "description": "产品类别", |
| | | "type": "string" |
| | | }, |
| | | "unit": { |
| | | "description": "单位", |
| | | "type": "string" |
| | | }, |
| | | "value": { |
| | | "description": "总价值", |
| | | "type": "number" |
| | | } |
| | | } |
| | | }, |
| | | "util.Response": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | required: |
| | | - code |
| | | type: object |
| | | request.GetInventoryForms: |
| | | properties: |
| | | categoryIds: |
| | | description: 产品类型id |
| | | items: |
| | | type: integer |
| | | type: array |
| | | page: |
| | | description: 页码 |
| | | type: integer |
| | | pageSize: |
| | | description: 每页大小 |
| | | type: integer |
| | | warehouseCode: |
| | | description: 仓库缩写 |
| | | type: string |
| | | type: object |
| | | request.GetInventoryHistory: |
| | | properties: |
| | | page: |
| | | description: 页码 |
| | | type: integer |
| | | pageSize: |
| | | description: 每页大小 |
| | | type: integer |
| | | produceId: |
| | | description: 产品id |
| | | type: string |
| | | productName: |
| | | description: 产品名称 |
| | | type: string |
| | | unit: |
| | | description: 单位 |
| | | type: string |
| | | type: object |
| | | request.GetProductList: |
| | | properties: |
| | | categoryId: |
| | |
| | | pageSize: |
| | | description: 每页大小 |
| | | type: integer |
| | | sourceNumber: |
| | | type: string |
| | | type: object |
| | | request.PageInfo: |
| | | properties: |
| | |
| | | pageSize: |
| | | description: 每页大小 |
| | | type: integer |
| | | sourceNumber: |
| | | type: string |
| | | type: object |
| | | request.QueryOperationHistory: |
| | | properties: |
| | |
| | | type: integer |
| | | productCategoryId: |
| | | description: 产品种类id |
| | | type: integer |
| | | productId: |
| | | description: 产品id |
| | | type: string |
| | | type: object |
| | | request.UpdateLocationProductAmount: |
| | | properties: |
| | | Amount: |
| | | description: 库存数量 |
| | | type: number |
| | | adjustAmount: |
| | | description: LocationProductAmountId int `json:"locationProductAmountId"` |
| | | //库存盘点id |
| | | type: number |
| | | differenceAmount: |
| | | description: 计数数量 |
| | | type: number |
| | | operationId: |
| | | description: 出入库id |
| | | type: integer |
| | | productId: |
| | | description: 产品id |
| | |
| | | warehouseId: |
| | | description: 仓库id |
| | | type: integer |
| | | type: object |
| | | response.InventoryForms: |
| | | properties: |
| | | amount: |
| | | description: 在库数量 |
| | | type: number |
| | | availableNumber: |
| | | description: 可用库存 |
| | | type: number |
| | | cost: |
| | | description: 成本 |
| | | type: number |
| | | in: |
| | | description: 入库 |
| | | type: number |
| | | out: |
| | | description: 出库 |
| | | type: number |
| | | produceId: |
| | | description: 产品id |
| | | type: string |
| | | productName: |
| | | description: 产品名称 |
| | | type: string |
| | | productType: |
| | | description: 产品类型 |
| | | type: string |
| | | unit: |
| | | description: 单位 |
| | | type: string |
| | | value: |
| | | description: 总价值 |
| | | type: number |
| | | type: object |
| | | response.InventoryHistory: |
| | | properties: |
| | | amount: |
| | | description: 数量 |
| | | type: number |
| | | baseOperationType: |
| | | allOf: |
| | | - $ref: '#/definitions/constvar.BaseOperationType' |
| | | description: 基础作业类型 |
| | | contactedName: |
| | | description: 完成者 |
| | | type: string |
| | | date: |
| | | description: 日期 |
| | | type: string |
| | | fromLocation: |
| | | description: 源位置 |
| | | type: string |
| | | number: |
| | | description: 单号 |
| | | type: string |
| | | toLocation: |
| | | description: 目标位置 |
| | | type: string |
| | | unit: |
| | | description: 单位 |
| | | type: string |
| | | type: object |
| | | response.LocationForms: |
| | | properties: |
| | | amount: |
| | | description: 数量 |
| | | type: number |
| | | locationName: |
| | | description: 位置名称 |
| | | type: string |
| | | produceId: |
| | | description: 产品id |
| | | type: string |
| | | productName: |
| | | description: 产品名称 |
| | | type: string |
| | | productTypeName: |
| | | description: 产品类别 |
| | | type: string |
| | | unit: |
| | | description: 单位 |
| | | type: string |
| | | value: |
| | | description: 总价值 |
| | | type: number |
| | | type: object |
| | | util.Response: |
| | | properties: |
| | |
| | | summary: 编辑公司 |
| | | tags: |
| | | - 公司 |
| | | /api-wms/v1/forms/getHistory: |
| | | post: |
| | | parameters: |
| | | - description: 查询参数 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.GetInventoryHistory' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/util.ResponseList' |
| | | - properties: |
| | | data: |
| | | items: |
| | | $ref: '#/definitions/response.InventoryHistory' |
| | | type: array |
| | | type: object |
| | | summary: 获取历史信息 |
| | | tags: |
| | | - 报表 |
| | | /api-wms/v1/forms/getInventoryForms: |
| | | post: |
| | | parameters: |
| | | - description: 查询参数 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.GetInventoryForms' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/util.ResponseList' |
| | | - properties: |
| | | data: |
| | | items: |
| | | $ref: '#/definitions/response.InventoryForms' |
| | | type: array |
| | | type: object |
| | | summary: 获取库存报表 |
| | | tags: |
| | | - 报表 |
| | | /api-wms/v1/forms/getLocationForms: |
| | | post: |
| | | parameters: |
| | | - description: 查询参数 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.PageInfo' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/util.ResponseList' |
| | | - properties: |
| | | data: |
| | | items: |
| | | $ref: '#/definitions/response.LocationForms' |
| | | type: array |
| | | type: object |
| | | summary: 获取位置报表 |
| | | tags: |
| | | - 报表 |
| | | /api-wms/v1/location/addLocation: |
| | | post: |
| | | parameters: |
| | |
| | | summary: 库存盘点列表 |
| | | tags: |
| | | - 库存盘点 |
| | | /api-wms/v1/locationProductAmount/update: |
| | | post: |
| | | parameters: |
| | | - description: 入库/出库信息 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.UpdateLocationProductAmount' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | $ref: '#/definitions/util.Response' |
| | | summary: 修改库存盘点信息 |
| | | tags: |
| | | - 库存盘点 |
| | | /api-wms/v1/operation/finish/{id}: |
| | | put: |
| | | parameters: |
| | |
| | | } |
| | | |
| | | if slf.Keyword != "" { |
| | | db = db.Where("product_name like ?", fmt.Sprintf("%%%v%%", slf.Keyword)) |
| | | db = db.Where("number like ? or source_number like ?", fmt.Sprintf("%%%v%%", slf.Keyword), fmt.Sprintf("%%%v%%", slf.Keyword)) |
| | | } |
| | | |
| | | if slf.SourceNumber != "" { |
| | |
| | | } |
| | | |
| | | type UpdateLocationProductAmount struct { |
| | | LocationProductAmountId int `json:"locationProductAmountId"` //库存盘点id |
| | | AdjustAmount decimal.Decimal `json:"adjustAmount" ` //差值 |
| | | DifferenceAmount decimal.Decimal `json:"differenceAmount"` //计数数量 |
| | | OperationId int `json:"operationId"` //出入库id |
| | | //LocationProductAmountId int `json:"locationProductAmountId"` //库存盘点id |
| | | AdjustAmount decimal.Decimal `json:"adjustAmount" ` //差值 |
| | | DifferenceAmount decimal.Decimal `json:"differenceAmount"` //计数数量 |
| | | OperationId int `json:"operationId"` //出入库id |
| | | Amount decimal.Decimal `json:"Amount"` //库存数量 |
| | | ProductId string `json:"productId"` //产品id |
| | | } |
| | |
| | | PageInfo |
| | | OperationTypeId int `json:"operationTypeId" form:"operationTypeId"` |
| | | Number string `json:"number"` |
| | | SourceNumber string `json:"sourceNumber"` |
| | | } |
| | | |
| | | type UpdateOperation struct { |
| | |
| | | |
| | | type QueryDisuseList struct { |
| | | PageInfo |
| | | Number string `json:"number"` |
| | | SourceNumber string `json:"sourceNumber"` |
| | | Number string `json:"number"` |
| | | } |
| | | |
| | | type UpdateDisuse struct { |
| | |
| | | locationProductAmountController := new(controllers.LocationProductAmountController) |
| | | locationProductAmountAPI := r.Group(urlPrefix + "/locationProductAmount") |
| | | { |
| | | locationProductAmountAPI.POST("add", locationProductAmountController.Add) //添加库存盘点信息 |
| | | locationProductAmountAPI.POST("list", locationProductAmountController.List) //查看库存盘点列表 |
| | | locationProductAmountAPI.POST("add", locationProductAmountController.Add) //添加库存盘点信息 |
| | | locationProductAmountAPI.POST("list", locationProductAmountController.List) //查看库存盘点列表 |
| | | locationProductAmountAPI.POST("update", locationProductAmountController.Update) //修改库存盘点信息 |
| | | } |
| | | |
| | | //报表 |