liujiandao
2023-11-16 d20acf38c36c11ee4428c3e74a17f5870dc61b51
model/purchase/request/purchase.go
@@ -23,23 +23,28 @@
   ProductList []*purchase.PurchaseProducts `json:"productList"`
}
type SubmitPurchase struct {
   Id     int                  `json:"id"`
   Status purchase.OrderStatus `json:"status"`
}
type Purchase struct {
   ID                  uint                         `gorm:"primarykey"`                                                                                                // 主键ID
   PurchaseTypeId      int                          `json:"purchaseTypeId" form:"purchaseType" gorm:"type:int(11);not null;default 0;comment:采购类型id"`                  // 采购类型id
   SupplierId          int                          `json:"supplierId" form:"supplierId" gorm:"type:int(11);not null;default 0;comment:供应商id"`                         // 供应商id
   Number              string                       `json:"number" form:"number" gorm:"unique;type:varchar(255);not null;default '';comment:采购编号"`                     // 采购编号
   Name                string                       `json:"name" form:"name" gorm:"type:varchar(255);not null;default '';comment:采购名称"`                                // 采购名称
   Contact             string                       `json:"contact" form:"contact" gorm:"type:varchar(255);not null;default '';comment:联系人"`                           // 联系人
   Phone               string                       `json:"phone" form:"phone" gorm:"type:varchar(255);not null;default '';comment:联系人电话"`                             // 联系人电话
   SigningDate         string                       `json:"signingDate" form:"signingDate" gorm:"type:varchar(255);not null;default '';comment:签约日期"`                  // 签约日期
   DeliveryDate        string                       `json:"deliveryDate" form:"deliveryDate" gorm:"type:varchar(255);not null;default '';comment:交付日期"`                //交付日期
   Remark              string                       `json:"remark" form:"remark" gorm:"type:varchar(1000);not null;default '';comment:备注"`                             //备注
   Status              purchase.OrderStatus         `json:"status" form:"status" gorm:"type:tinyint(1);not null;default 0;comment:状态"`                                 //状态
   Quantity            decimal.Decimal              `json:"quantity" form:"quantity" gorm:"type:decimal(12,4);not null;comment:采购数量"`                                  // 采购数量
   TotalPrice          decimal.Decimal              `json:"totalPrice" form:"totalPrice" gorm:"type:decimal(12,2);not null;default '';comment:价税合计"`                   //价税合计
   WholeDiscountType   purchase.WholeDiscountType   `json:"wholeDiscountType" form:"wholeDiscountType" gorm:"type:decimal(12,2);not null;default '';comment:整单折扣"`     //整单折扣类型
   WholeDiscount       decimal.Decimal              `json:"wholeDiscount" form:"wholeDiscount" gorm:"type:decimal(12,2);not null;default '';comment:整单折扣"`             //整单折扣值
   PriceAdjustmentType purchase.PriceAdjustmentType `json:"priceAdjustmentType" form:"priceAdjustmentType" gorm:"type:decimal(12,2);not null;default '';comment:价格调整"` //价格调整类型
   PriceAdjustment     decimal.Decimal              `json:"priceAdjustment" form:"priceAdjustment" gorm:"type:decimal(12,2);not null;default '';comment:价格调整"`         //价格调整值
   RealTotalPrice      decimal.Decimal              `json:"realTotalPrice" form:"realTotalPrice" gorm:"type:decimal(12,2);not null;default '';comment:最终价格"`           //最终价格
   ID                  uint                         `gorm:"primarykey"`                                                                                                 // 主键ID
   PurchaseTypeId      int                          `json:"purchaseTypeId" form:"purchaseType" gorm:"type:int(11);not null;default 0;comment:采购类型id"`                   // 采购类型id
   SupplierId          int                          `json:"supplierId" form:"supplierId" gorm:"type:int(11);not null;default 0;comment:供应商id"`                          // 供应商id
   Number              string                       `json:"number" form:"number" gorm:"unique;type:varchar(255);not null;default '';comment:采购编号"`                      // 采购编号
   Name                string                       `json:"name" form:"name" gorm:"type:varchar(255);not null;default '';comment:采购名称"`                                 // 采购名称
   Contact             string                       `json:"contact" form:"contact" gorm:"type:varchar(255);not null;default '';comment:联系人"`                            // 联系人
   Phone               string                       `json:"phone" form:"phone" gorm:"type:varchar(255);not null;default '';comment:联系人电话"`                              // 联系人电话
   SigningDate         string                       `json:"signingDate" form:"signingDate" gorm:"type:varchar(255);not null;default '';comment:签约日期"`                   // 签约日期
   DeliveryDate        string                       `json:"deliveryDate" form:"deliveryDate" gorm:"type:varchar(255);not null;default '';comment:交付日期"`                 //交付日期
   Remark              string                       `json:"remark" form:"remark" gorm:"type:varchar(1000);not null;default '';comment:备注"`                              //备注
   Status              purchase.OrderStatus         `json:"status" form:"status" gorm:"type:tinyint(1);not null;default 0;comment:状态"`                                  //状态
   Quantity            decimal.Decimal              `json:"quantity" form:"quantity" gorm:"type:decimal(12,2);not null;default 0;comment:采购数量"`                         // 采购数量
   TotalPrice          decimal.Decimal              `json:"totalPrice" form:"totalPrice" gorm:"type:decimal(12,2);not null;default 0.00;comment:价税合计"`                  //价税合计
   WholeDiscountType   purchase.WholeDiscountType   `json:"wholeDiscountType" form:"wholeDiscountType" gorm:"type:decimal(12,2);not null;default 0.00;comment:整单折扣"`    //整单折扣类型
   WholeDiscount       decimal.Decimal              `json:"wholeDiscount" form:"wholeDiscount" gorm:"type:decimal(12,2);not null;default 0;comment:整单折扣"`               //整单折扣值
   PriceAdjustmentType purchase.PriceAdjustmentType `json:"priceAdjustmentType" form:"priceAdjustmentType" gorm:"type:decimal(12,2);not null;default 0;comment:价格调整类型"` //价格调整类型
   PriceAdjustment     decimal.Decimal              `json:"priceAdjustment" form:"priceAdjustment" gorm:"type:decimal(12,2);not null;default 0.00;comment:价格调整"`        //价格调整值
   RealTotalPrice      decimal.Decimal              `json:"realTotalPrice" form:"realTotalPrice" gorm:"type:decimal(12,2);not null;default 0.00;comment:最终价格"`          //最终价格
}