Files
2026-06-10 15:40:17 +08:00

47 lines
2.2 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package entity
import (
consts "assets/consts/procurement"
"assets/consts/public"
"gitea.redpowerfuture.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
}