Files

47 lines
2.2 KiB
Go
Raw Permalink Normal View History

2026-03-18 10:18:03 +08:00
package entity
import (
consts "assets/consts/procurement"
"assets/consts/public"
"gitea.com/red-future/common/beans"
"github.com/gogf/gf/v2/os/gtime"
"go.mongodb.org/mongo-driver/v2/bson"
)
// PurchaseBid 采购投标记录(供应商参与竞价订单的记录)
type PurchaseBid struct {
beans.MongoBaseDO `bson:",inline"` // 嵌入基础字段Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
// 关联信息(核心关联:直接关联到采购订单)
OrderId *bson.ObjectID `bson:"orderId" json:"orderId"` // 采购订单ID必填直接关联
OrderNo string `bson:"orderNo" json:"orderNo"` // 订单编号(冗余存储,便于查询)
// 投标供应商信息
SupplierId *bson.ObjectID `bson:"supplierId" json:"supplierId"` // 供应商ID
SupplierName string `bson:"supplierName" json:"supplierName"` // 供应商名称
SupplierCode string `bson:"supplierCode" json:"supplierCode"` // 供应商编码
// 投标报价信息(核心业务数据)
TotalBidPrice int `bson:"totalBidPrice" json:"totalBidPrice"` // 总投标价格(分)
UnitPrices map[string]int `bson:"unitPrices" json:"unitPrices"` // 各商品单价 {itemId: price}
DeliveryDays int `bson:"deliveryDays" json:"deliveryDays"` // 承诺交付天数
QualityScore float64 `bson:"qualityScore" json:"qualityScore"` // 质量评分0-100
ServiceScore float64 `bson:"serviceScore" json:"serviceScore"` // 服务评分0-100
// 投标文件
BidRemark string `bson:"bidRemark" json:"bidRemark"` // 投标说明
AttachmentUrls []string `bson:"attachmentUrls" json:"attachmentUrls"` // 附件URL列表
// 状态信息单一状态源IsWinner和BidRank通过Status推断
Status consts.BidStatus `bson:"status" json:"status"` // 投标状态draft/submitted/viewed/winning/lost/withdrawn/expired
// 时间戳(仅保留有意义的业务时间)
BidAt *gtime.Time `bson:"bidAt" json:"bidAt"` // 投标时间(核心业务时间)
}
// CollectionName 获取集合名称
func (PurchaseBid) CollectionName() string {
return public.PurchaseBidCollection
}