| | |
| | | // @Security ApiKeyAuth |
| | | // @accept application/json |
| | | // @Produce application/json |
| | | // @Success 200 {object} response.Response{data=[]purchase_wms.SrmGetWarehouseInfoResponse} "获取采购类型列表" |
| | | // @Success 200 {object} response.Response{data=[]purchaseRes.OperationInfo} "获取操作信息" |
| | | // @Router /purchase/getOperationInfo/{id} [get] |
| | | func (e *PurchaseApi) GetOperationInfo(c *gin.Context) { |
| | | id, _ := strconv.Atoi(c.Param("id")) |
| | |
| | | operationInfos := make([]purchaseRes.OperationInfo, 0) |
| | | for _, operation := range info.Operations { |
| | | var oi purchaseRes.OperationInfo |
| | | oi.ProductId = operation.ProductId |
| | | oi.ProductName = operation.ProductName |
| | | oi.Number = operation.Number |
| | | oi.Number = operation.ProductId |
| | | oi.Name = operation.ProductName |
| | | oi.OperationNumber = operation.Number |
| | | oi.Status = operation.Status |
| | | oi.Principal = data.Principal |
| | | oi.WarehouseName = data.Warehouse |
| | |
| | | for _, products := range productList { |
| | | if products.Product.Number == operation.ProductId { |
| | | oi.Amount = products.Amount |
| | | oi.Price = products.Price |
| | | oi.PurchasePrice = products.Price |
| | | oi.Total = products.Total |
| | | oi.Unit = products.Product.Unit |
| | | oi.Specifications = products.Product.Specifications |
| | |
| | | "summary": "获取操作信息", |
| | | "responses": { |
| | | "200": { |
| | | "description": "获取采购类型列表", |
| | | "description": "获取操作信息", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/purchase_wms.SrmGetWarehouseInfoResponse" |
| | | "$ref": "#/definitions/response.OperationInfo" |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "response.OperationInfo": { |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "description": "采购数", |
| | | "type": "number" |
| | | }, |
| | | "modelNumber": { |
| | | "description": "型号", |
| | | "type": "string" |
| | | }, |
| | | "name": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "number": { |
| | | "description": "产品编码", |
| | | "type": "string" |
| | | }, |
| | | "operationNumber": { |
| | | "description": "入库单号", |
| | | "type": "string" |
| | | }, |
| | | "overAmount": { |
| | | "description": "入库数", |
| | | "type": "integer" |
| | | }, |
| | | "overTime": { |
| | | "description": "入库时间", |
| | | "type": "string" |
| | | }, |
| | | "principal": { |
| | | "description": "负责人", |
| | | "type": "string" |
| | | }, |
| | | "purchasePrice": { |
| | | "description": "单价", |
| | | "type": "number" |
| | | }, |
| | | "sendAmount": { |
| | | "description": "发货数", |
| | | "type": "integer" |
| | | }, |
| | | "specifications": { |
| | | "description": "规格", |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "type": "integer" |
| | | }, |
| | | "total": { |
| | | "description": "总价", |
| | | "type": "number" |
| | | }, |
| | | "unit": { |
| | | "description": "单位", |
| | | "type": "string" |
| | | }, |
| | | "warehouseName": { |
| | | "description": "仓库名", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "response.PageResult": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "summary": "获取操作信息", |
| | | "responses": { |
| | | "200": { |
| | | "description": "获取采购类型列表", |
| | | "description": "获取操作信息", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/purchase_wms.SrmGetWarehouseInfoResponse" |
| | | "$ref": "#/definitions/response.OperationInfo" |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "response.OperationInfo": { |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "description": "采购数", |
| | | "type": "number" |
| | | }, |
| | | "modelNumber": { |
| | | "description": "型号", |
| | | "type": "string" |
| | | }, |
| | | "name": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "number": { |
| | | "description": "产品编码", |
| | | "type": "string" |
| | | }, |
| | | "operationNumber": { |
| | | "description": "入库单号", |
| | | "type": "string" |
| | | }, |
| | | "overAmount": { |
| | | "description": "入库数", |
| | | "type": "integer" |
| | | }, |
| | | "overTime": { |
| | | "description": "入库时间", |
| | | "type": "string" |
| | | }, |
| | | "principal": { |
| | | "description": "负责人", |
| | | "type": "string" |
| | | }, |
| | | "purchasePrice": { |
| | | "description": "单价", |
| | | "type": "number" |
| | | }, |
| | | "sendAmount": { |
| | | "description": "发货数", |
| | | "type": "integer" |
| | | }, |
| | | "specifications": { |
| | | "description": "规格", |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "type": "integer" |
| | | }, |
| | | "total": { |
| | | "description": "总价", |
| | | "type": "number" |
| | | }, |
| | | "unit": { |
| | | "description": "单位", |
| | | "type": "string" |
| | | }, |
| | | "warehouseName": { |
| | | "description": "仓库名", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "response.PageResult": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | $ref: '#/definitions/test.SupplierType' |
| | | type: array |
| | | type: object |
| | | response.OperationInfo: |
| | | properties: |
| | | amount: |
| | | description: 采购数 |
| | | type: number |
| | | modelNumber: |
| | | description: 型号 |
| | | type: string |
| | | name: |
| | | description: 产品名称 |
| | | type: string |
| | | number: |
| | | description: 产品编码 |
| | | type: string |
| | | operationNumber: |
| | | description: 入库单号 |
| | | type: string |
| | | overAmount: |
| | | description: 入库数 |
| | | type: integer |
| | | overTime: |
| | | description: 入库时间 |
| | | type: string |
| | | principal: |
| | | description: 负责人 |
| | | type: string |
| | | purchasePrice: |
| | | description: 单价 |
| | | type: number |
| | | sendAmount: |
| | | description: 发货数 |
| | | type: integer |
| | | specifications: |
| | | description: 规格 |
| | | type: string |
| | | status: |
| | | type: integer |
| | | total: |
| | | description: 总价 |
| | | type: number |
| | | unit: |
| | | description: 单位 |
| | | type: string |
| | | warehouseName: |
| | | description: 仓库名 |
| | | type: string |
| | | type: object |
| | | response.PageResult: |
| | | properties: |
| | | list: {} |
| | |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 获取采购类型列表 |
| | | description: 获取操作信息 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/response.Response' |
| | | - properties: |
| | | data: |
| | | items: |
| | | $ref: '#/definitions/purchase_wms.SrmGetWarehouseInfoResponse' |
| | | $ref: '#/definitions/response.OperationInfo' |
| | | type: array |
| | | type: object |
| | | security: |
| | |
| | | |
| | | type PurchaseProducts struct { |
| | | PurchaseId int `json:"purchaseId" form:"purchaseType" gorm:"type:int(11);not null;default 0;comment:采购类型id"` // 采购id |
| | | ProductId int `json:"productId" form:"supplierId" gorm:"type:int(11);not null;default 0;comment:供应商id"` // 产品id |
| | | ProductId int `json:"productId" form:"supplierId" gorm:"type:int(11);not null;default 0;comment:产品id"` // 产品id |
| | | Amount decimal.Decimal `json:"amount" form:"amount" gorm:"type:decimal(12,2);not null;default 0;comment:采购数量"` // 采购数量 |
| | | Price decimal.Decimal `json:"price" form:"price" gorm:"type:decimal(12,2);not null;default 0.00;comment:采购单价"` // 采购单价 |
| | | Total decimal.Decimal `json:"total" form:"total" gorm:"type:decimal(12,2);not null;default 0.00;comment:采购总价"` // 采购总价 |
| | |
| | | } |
| | | |
| | | type OperationInfo struct { |
| | | ProductId string `json:"productId"` |
| | | ProductName string `json:"productName"` |
| | | Specifications string `json:"specifications"` //规格 |
| | | ModelNumber string `json:"modelNumber"` //型号 |
| | | Amount decimal.Decimal `json:"amount"` //采购数 |
| | | SendAmount int64 `json:"sendAmount"` //发货数 |
| | | OverAmount int64 `json:"overAmount"` //入库数 |
| | | Unit string `json:"unit"` //单位 |
| | | Price decimal.Decimal `json:"price"` //单价 |
| | | Total decimal.Decimal `json:"total"` //总价 |
| | | Number string `json:"number"` //入库单号 |
| | | WarehouseName string `json:"warehouseName"` //仓库名 |
| | | OverTime string `json:"overTime"` //入库时间 |
| | | Status int64 `json:"status"` |
| | | Principal string `json:"principal"` //负责人 |
| | | Number string `json:"number"` //产品编码 |
| | | Name string `json:"name"` //产品名称 |
| | | Specifications string `json:"specifications"` //规格 |
| | | ModelNumber string `json:"modelNumber"` //型号 |
| | | Amount decimal.Decimal `json:"amount"` //采购数 |
| | | SendAmount int64 `json:"sendAmount"` //发货数 |
| | | OverAmount int64 `json:"overAmount"` //入库数 |
| | | Unit string `json:"unit"` //单位 |
| | | PurchasePrice decimal.Decimal `json:"purchasePrice"` //单价 |
| | | Total decimal.Decimal `json:"total"` //总价 |
| | | OperationNumber string `json:"operationNumber"` //入库单号 |
| | | WarehouseName string `json:"warehouseName"` //仓库名 |
| | | OverTime string `json:"overTime"` //入库时间 |
| | | Status int64 `json:"status"` |
| | | Principal string `json:"principal"` //负责人 |
| | | } |