Files
yunzerwebsiteallinone/go/models/tenant_crm_bidding_bid.go
2026-09-24 17:06:46 +08:00

143 lines
9.8 KiB
Go

package models
import "time"
// =============================================================
// 投标方(我要投标):主表 + 文件 + 审批 + 任务(4 张)
// =============================================================
// TenantCrmBiddingBid 投标项目主表: yz_backend_crm_bidding_bid
//
// 状态机:
// 0草稿 -> 1立项审批中 -> 2投标中 -> 3已开标 -> (4中标 | 5落标) -> (6已转合同 | 7已归档)
//
// 来源关联:
// - source_type: 0独立 1商机 2项目
// - source_id: 来源ID(商机/项目)
type TenantCrmBiddingBid struct {
ID uint64 `orm:"column(id);pk;auto" json:"id"`
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
BidNo string `orm:"column(bid_no);size(50)" json:"bid_no"` // 投标编号
Title string `orm:"column(title);size(200)" json:"title"` // 投标标题
BidType string `orm:"column(bid_type);size(20);default(1)" json:"bid_type"`
Status int8 `orm:"column(status);default(0)" json:"status"` // 状态
SourceType int8 `orm:"column(source_type);default(0)" json:"source_type"`
SourceID *uint64 `orm:"column(source_id);null" json:"source_id"`
BusinessID *uint64 `orm:"column(business_id);null" json:"business_id"` // 关联商机
BusinessName string `orm:"column(business_name);size(200)" json:"business_name"`
ProjectID *uint64 `orm:"column(project_id);null" json:"project_id"` // 关联项目(中转)
ProjectName string `orm:"column(project_name);size(200)" json:"project_name"`
TenderID *uint64 `orm:"column(tender_id);null" json:"tender_id"` // 关联招标项目
TenderNo string `orm:"column(tender_no);size(50)" json:"tender_no"`
CustomerID *uint64 `orm:"column(customer_id);null" json:"customer_id"` // 招标方
CustomerName string `orm:"column(customer_name);size(200)" json:"customer_name"`
PublishOrg string `orm:"column(publish_org);size(200)" json:"publish_org"`
BidAmount float64 `orm:"column(bid_amount);digits(14);decimals(2);default(0)" json:"bid_amount"`
BidDeposit float64 `orm:"column(bid_deposit);digits(14);decimals(2);default(0)" json:"bid_deposit"`
PublishDate *time.Time `orm:"column(publish_date);type(date);null" json:"publish_date"`
RegisterEndDate *time.Time `orm:"column(register_end_date);type(datetime);null" json:"register_end_date"`
BidEndDate *time.Time `orm:"column(bid_end_date);type(datetime);null" json:"bid_end_date"`
OpenBidDate *time.Time `orm:"column(open_bid_date);type(datetime);null" json:"open_bid_date"`
ContactPerson string `orm:"column(contact_person);size(50)" json:"contact_person"`
ContactPhone string `orm:"column(contact_phone);size(20)" json:"contact_phone"`
BidAddress string `orm:"column(bid_address);size(255)" json:"bid_address"`
OpenAddress string `orm:"column(open_address);size(255)" json:"open_address"`
WinStatus int8 `orm:"column(win_status);default(0)" json:"win_status"` // 0未开标 1中标 2未中标 3废标 4流标
WinDate *time.Time `orm:"column(win_date);type(datetime);null" json:"win_date"`
OurRanking uint32 `orm:"column(our_ranking);default(0)" json:"our_ranking"`
TotalScore float64 `orm:"column(total_score);digits(6);decimals(2);default(0)" json:"total_score"`
CompetitorCount uint32 `orm:"column(competitor_count);default(0)" json:"competitor_count"`
ContractID *uint64 `orm:"column(contract_id);null" json:"contract_id"` // 转合同ID
NewProjectID *uint64 `orm:"column(new_project_id);null" json:"new_project_id"` // 中标后新建项目ID
OwnerUserID string `orm:"column(owner_user_id);size(64)" json:"owner_user_id"`
OwnerUserName string `orm:"column(owner_user_name);size(128)" json:"owner_user_name"`
DepartmentID uint64 `orm:"column(department_id);default(0)" json:"department_id"`
Description string `orm:"column(description);type(text);null" json:"description"`
Remark string `orm:"column(remark);type(text);null" json:"remark"`
Locked int8 `orm:"column(locked);default(0)" json:"locked"`
CreateUserID string `orm:"column(create_user_id);size(64)" json:"create_user_id"`
CreateUserName string `orm:"column(create_user_name);size(128)" json:"create_user_name"`
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
}
func (m *TenantCrmBiddingBid) TableName() string {
return "yz_backend_crm_bidding_bid"
}
// TenantCrmBiddingBidFile 投标文件: yz_backend_crm_bidding_bid_file
type TenantCrmBiddingBidFile struct {
ID uint64 `orm:"column(id);pk;auto" json:"id"`
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
BidID uint64 `orm:"column(bid_id);default(0)" json:"bid_id"`
FileType string `orm:"column(file_type);size(20);default(1)" json:"file_type"`
FileName string `orm:"column(file_name);size(255)" json:"file_name"`
FileURL string `orm:"column(file_url);size(500)" json:"file_url"`
FileSize uint64 `orm:"column(file_size);default(0)" json:"file_size"`
FileExt string `orm:"column(file_ext);size(20)" json:"file_ext"`
Version string `orm:"column(version);size(20);default(1.0)" json:"version"`
UploadUserID string `orm:"column(upload_user_id);size(64)" json:"upload_user_id"`
UploadUserName string `orm:"column(upload_user_name);size(128)" json:"upload_user_name"`
Remark string `orm:"column(remark);size(500)" json:"remark"`
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
}
func (m *TenantCrmBiddingBidFile) TableName() string {
return "yz_backend_crm_bidding_bid_file"
}
// TenantCrmBiddingBidApproval 投标立项审批: yz_backend_crm_bidding_bid_approval
type TenantCrmBiddingBidApproval struct {
ID uint64 `orm:"column(id);pk;auto" json:"id"`
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
BidID uint64 `orm:"column(bid_id);default(0)" json:"bid_id"`
ApprovalType string `orm:"column(approval_type);size(20);default(1)" json:"approval_type"`
ApprovalStatus int8 `orm:"column(approval_status);default(0)" json:"approval_status"`
ApprovalFlowID *uint64 `orm:"column(approval_flow_id);null" json:"approval_flow_id"`
CurrentUserID string `orm:"column(current_user_id);size(64)" json:"current_user_id"`
CurrentUserName string `orm:"column(current_user_name);size(128)" json:"current_user_name"`
ApprovalUsers string `orm:"column(approval_users);type(text);null" json:"approval_users"`
SubmitUserID string `orm:"column(submit_user_id);size(64)" json:"submit_user_id"`
SubmitUserName string `orm:"column(submit_user_name);size(128)" json:"submit_user_name"`
SubmitTime *time.Time `orm:"column(submit_time);type(datetime);null" json:"submit_time"`
CompleteTime *time.Time `orm:"column(complete_time);type(datetime);null" json:"complete_time"`
Comment string `orm:"column(comment);type(text);null" json:"comment"`
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
}
func (m *TenantCrmBiddingBidApproval) TableName() string {
return "yz_backend_crm_bidding_bid_approval"
}
// TenantCrmBiddingBidTask 投标任务: yz_backend_crm_bidding_bid_task
type TenantCrmBiddingBidTask struct {
ID uint64 `orm:"column(id);pk;auto" json:"id"`
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
BidID uint64 `orm:"column(bid_id);default(0)" json:"bid_id"`
TaskName string `orm:"column(task_name);size(100)" json:"task_name"`
TaskType string `orm:"column(task_type);size(20);default(1)" json:"task_type"`
Content string `orm:"column(content);type(text);null" json:"content"`
OwnerUserID string `orm:"column(owner_user_id);size(64)" json:"owner_user_id"`
OwnerUserName string `orm:"column(owner_user_name);size(128)" json:"owner_user_name"`
StartDate *time.Time `orm:"column(start_date);type(date);null" json:"start_date"`
EndDate *time.Time `orm:"column(end_date);type(date);null" json:"end_date"`
CompleteTime *time.Time `orm:"column(complete_time);type(datetime);null" json:"complete_time"`
Status int8 `orm:"column(status);default(0)" json:"status"`
Progress int8 `orm:"column(progress);default(0)" json:"progress"`
Files string `orm:"column(files);type(text);null" json:"files"`
Remark string `orm:"column(remark);size(500)" json:"remark"`
CreateUserID string `orm:"column(create_user_id);size(64)" json:"create_user_id"`
CreateUserName string `orm:"column(create_user_name);size(128)" json:"create_user_name"`
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
}
func (m *TenantCrmBiddingBidTask) TableName() string {
return "yz_backend_crm_bidding_bid_task"
}