zhangqian
2023-08-29 e668092cf0bca471e665580c255c04a6ffc3cb8f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package response
 
import (
    "github.com/shopspring/decimal"
    "srm/model/purchase"
)
 
type PurchaseResponse struct {
    Purchase    purchase.Purchase   `json:"purchase"`
    ProductList []*PurchaseProducts `json:"productList"`
}
 
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
    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:采购总价"`      // 采购总价
    Name             string          `json:"name" form:"name" gorm:"column:name;comment:名称;size:255;"`
    Number           string          `json:"number" form:"number" gorm:"column:number;comment:编码;size:255;"`
    Unit             string          `json:"unit" form:"unit" gorm:"column:unit;comment:计量单位;size:255;"`
    PurchasePrice    *float64        `json:"purchasePrice" form:"purchasePrice" gorm:"column:purchase_price;comment:采购价格;"`
    DeliveryTime     *int            `json:"deliveryTime" form:"deliveryTime" gorm:"column:delivery_time;comment:;size:11;"`
    ShippingDuration *int            `json:"shippingDuration" form:"shippingDuration" gorm:"column:shipping_duration;comment:物流时长;size:11;"`
    Specifications   string          `json:"specifications" form:"specifications" gorm:"column:specifications;comment:规格;size:255;"`
    ModelNumber      string          `json:"modelNumber" form:"modelNumber" gorm:"column:model_number;comment:型号;size:255;"`
    ProductType      string          `json:"productType" form:"productType" gorm:"column:product_type;comment:产品类别;size:255;"`
}