88 lines
4.8 KiB
Go
88 lines
4.8 KiB
Go
package entity
|
||
|
||
import (
|
||
consts "assets/consts/procurement"
|
||
"assets/consts/public"
|
||
|
||
"gitea.com/red-future/common/beans"
|
||
"github.com/gogf/gf/v2/os/gtime"
|
||
)
|
||
|
||
// Supplier 供应商实体
|
||
type Supplier struct {
|
||
beans.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||
|
||
// 基础信息
|
||
Name string `bson:"name" json:"name"` // 供应商名称(必填)
|
||
Code string `bson:"code" json:"code"` // 供应商编码(必填,唯一)
|
||
ShortName string `bson:"shortName" json:"shortName"` // 供应商简称
|
||
Alias []string `bson:"alias" json:"alias"` // 别名列表
|
||
Logo string `bson:"logo" json:"logo"` // 供应商LOGO URL
|
||
|
||
// 联系信息
|
||
Phone string `bson:"phone" json:"phone"` // 固定电话
|
||
Mobile string `bson:"mobile" json:"mobile"` // 手机号码
|
||
Email string `bson:"email" json:"email"` // 邮箱地址
|
||
Website string `bson:"website" json:"website"` // 官网地址
|
||
ContactPerson string `bson:"contactPerson" json:"contactPerson"` // 联系人姓名
|
||
ContactPhone string `bson:"contactPhone" json:"contactPhone"` // 联系人电话
|
||
ContactEmail string `bson:"contactEmail" json:"contactEmail"` // 联系人邮箱
|
||
ContactPosition string `bson:"contactPosition" json:"contactPosition"` // 联系人职位
|
||
|
||
// 地址信息
|
||
Country string `bson:"country" json:"country"` // 国家
|
||
Province string `bson:"province" json:"province"` // 省份
|
||
City string `bson:"city" json:"city"` // 城市
|
||
District string `bson:"district" json:"district"` // 区县
|
||
Address string `bson:"address" json:"address"` // 详细地址
|
||
PostalCode string `bson:"postalCode" json:"postalCode"` // 邮政编码
|
||
|
||
// 企业资质信息
|
||
BusinessLicense string `bson:"businessLicense" json:"businessLicense"` // 营业执照号
|
||
LegalPerson string `bson:"legalPerson" json:"legalPerson"` // 法定代表人
|
||
TaxNumber string `bson:"taxNumber" json:"taxNumber"` // 税务登记号
|
||
BankName string `bson:"bankName" json:"bankName"` // 开户银行
|
||
BankAccount string `bson:"bankAccount" json:"bankAccount"` // 银行账号
|
||
BankAccountName string `bson:"bankAccountName" json:"bankAccountName"` // 账户名称
|
||
|
||
// 业务合作信息
|
||
CooperationStart *gtime.Time `bson:"cooperationStart" json:"cooperationStart"` // 合作开始时间
|
||
CooperationEnd *gtime.Time `bson:"cooperationEnd" json:"cooperationEnd"` // 合作结束时间
|
||
SupplierLevel string `bson:"supplierLevel" json:"supplierLevel"` // 供应商等级
|
||
PaymentMethod string `bson:"paymentMethod" json:"paymentMethod"` // 结算方式
|
||
PaymentPeriod int `bson:"paymentPeriod" json:"paymentPeriod"` // 付款周期(天)
|
||
TaxRate float64 `bson:"taxRate" json:"taxRate"` // 税率(如0.13表示13%)
|
||
MinOrderAmount int `bson:"minOrderAmount" json:"minOrderAmount"` // 最小订货金额(分)
|
||
|
||
// 经营品类信息
|
||
MainCategories []string `bson:"mainCategories" json:"mainCategories"` // 主营品类ID列表
|
||
BusinessScope string `bson:"businessScope" json:"businessScope"` // 经营范围
|
||
|
||
// 状态和审核信息
|
||
Status consts.SupplierStatus `bson:"status" json:"status"` // 供应商状态
|
||
ReviewStatus consts.ReviewStatus `bson:"reviewStatus" json:"reviewStatus"` // 审核状态
|
||
ReviewBy string `bson:"reviewBy" json:"reviewBy"` // 审核人ID
|
||
ReviewAt *gtime.Time `bson:"reviewAt" json:"reviewAt"` // 审核时间
|
||
ReviewRemark string `bson:"reviewRemark" json:"reviewRemark"` // 审核备注
|
||
|
||
// 评分和评价
|
||
Rating float64 `bson:"rating" json:"rating"` // 综合评分(0-5分)
|
||
DeliveryRating float64 `bson:"deliveryRating" json:"deliveryRating"` // 交货及时率评分
|
||
QualityRating float64 `bson:"qualityRating" json:"qualityRating"` // 质量合格率评分
|
||
ServiceRating float64 `bson:"serviceRating" json:"serviceRating"` // 服务满意度评分
|
||
TotalOrders int64 `bson:"totalOrders" json:"totalOrders"` // 历史订单总数
|
||
TotalAmount int64 `bson:"totalAmount" json:"totalAmount"` // 历史交易总额(分)
|
||
|
||
// 备注和标签
|
||
Remark string `bson:"remark" json:"remark"` // 备注信息
|
||
Tags []string `bson:"tags" json:"tags"` // 标签列表
|
||
|
||
// 扩展字段
|
||
Extra map[string]interface{} `bson:"extra" json:"extra"` // 扩展字段
|
||
}
|
||
|
||
// CollectionName 获取集合名称
|
||
func (Supplier) CollectionName() string {
|
||
return public.SupplierCollection
|
||
}
|