liujiandao
2023-11-16 d20acf38c36c11ee4428c3e74a17f5870dc61b51
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package purchase
 
import (
    "github.com/shopspring/decimal"
    "srm/global"
    "srm/model/test"
)
 
type PurchaseProducts struct {
    global.GVA_MODEL
    PurchaseId int                   `json:"purchaseId" form:"purchaseType" gorm:"type:int(11);not null;default 0;comment:采购类型id"` // 采购id
    ProductId  string                `json:"productId" form:"productId" gorm:"type:varchar(255);not null;default '';comment:产品id"` // 产品id
    Product    test.SupplierMaterial `json:"-" gorm:"foreignKey:ProductId"`
    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:采购总价"` // 采购总价
    Remark     string                `json:"remark" form:"remark" gorm:"type:varchar(1000);not null; default '';comment:描述"`  //描述
}
 
func (PurchaseProducts) TableName() string {
    return "srm_purchase_products"
}