Dockerfile

This commit is contained in:
2026-03-18 10:18:03 +08:00
parent 5c5dbc7420
commit b65f3439f3
189 changed files with 19027 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
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
}

View File

@@ -0,0 +1,47 @@
package entity
import (
"assets/consts/public"
"gitea.com/red-future/common/beans"
"github.com/gogf/gf/v2/os/gtime"
"go.mongodb.org/mongo-driver/v2/bson"
)
// PurchaseInbound 采购入库记录实体
type PurchaseInbound struct {
beans.MongoBaseDO `bson:",inline"` // 嵌入基础字段Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
// 关联信息
OrderId *bson.ObjectID `bson:"orderId" json:"orderId"` // 采购订单ID
OrderItemId *bson.ObjectID `bson:"orderItemId" json:"orderItemId"` // 采购订单明细ID
// 入库数量和时间
InboundQty int `bson:"inboundQty" json:"inboundQty"` // 本次入库数量
InboundDate *gtime.Time `bson:"inboundDate" json:"inboundDate"` // 入库日期
// 仓储信息(非必填)
WarehouseId *bson.ObjectID `bson:"warehouseId,omitempty" json:"warehouseId,omitempty"` // 仓库ID
WarehouseName string `bson:"warehouseName" json:"warehouseName"` // 仓库名称
ZoneId *bson.ObjectID `bson:"zoneId,omitempty" json:"zoneId,omitempty"` // 库区ID
ZoneName string `bson:"zoneName" json:"zoneName"` // 库区名称
LocationId *bson.ObjectID `bson:"locationId,omitempty" json:"locationId,omitempty"` // 库位ID
LocationName string `bson:"locationName" json:"locationName"` // 库位名称
// 私域SKU和分类
PrivateSkuId *bson.ObjectID `bson:"privateSkuId" json:"privateSkuId"` // 私域SKU ID
PrivateSkuName string `bson:"privateSkuName" json:"privateSkuName"` // 私域SKU名称
PrivateCategoryId *bson.ObjectID `bson:"privateCategoryId" json:"privateCategoryId"` // 私域分类ID
PrivateCategoryPath string `bson:"privateCategoryPath" json:"privateCategoryPath"` // 私域分类路径
// 生成的批次信息
BatchNo string `bson:"batchNo" json:"batchNo"` // 生成的批次号
PrivateStockId *bson.ObjectID `bson:"privateStockId" json:"privateStockId"` // 关联的私域库存ID
InboundNo string `bson:"inboundNo" json:"inboundNo"` // 入库单号(自动生成)
Remark string `bson:"remark" json:"remark"` // 入库备注
}
// CollectionName 获取集合名称
func (PurchaseInbound) CollectionName() string {
return public.PurchaseInboundCollection
}

View File

@@ -0,0 +1,91 @@
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"
)
// ============================================
// 内嵌结构体定义
// ============================================
// DirectPurchaseInfo 指定供应商模式信息
type DirectPurchaseInfo struct {
// 指定供应商信息
SupplierId *bson.ObjectID `bson:"supplierId" json:"supplierId"` // 指定供应商ID
SupplierName string `bson:"supplierName" json:"supplierName"` // 指定供应商名称
SupplierCode string `bson:"supplierCode" json:"supplierCode"` // 供应商编码
AssignReason string `bson:"assignReason" json:"assignReason"` // 指派原因
DeliveryAddress string `bson:"deliveryAddress" json:"deliveryAddress"` // 交付地址
ContactPerson string `bson:"contactPerson" json:"contactPerson"` // 联系人
ContactPhone string `bson:"contactPhone" json:"contactPhone"` // 联系电话
ResponseStatus string `bson:"responseStatus" json:"responseStatus"` // 供应商响应状态
// 时间戳
AssignedAt *gtime.Time `bson:"assignedAt" json:"assignedAt"` // 指派时间
AcceptedAt *gtime.Time `bson:"acceptedAt" json:"acceptedAt"` // 接受时间
RejectedAt *gtime.Time `bson:"rejectedAt" json:"rejectedAt"` // 拒绝时间
DeliveredAt *gtime.Time `bson:"deliveredAt" json:"deliveredAt"` // 交付时间
}
// BiddingInfo 竞价模式信息
type BiddingInfo struct {
// 竞价设置
BidMode consts.BidMode `bson:"bidMode" json:"bidMode"` // 竞价模式price/quality/time/mixed
MinSuppliers int `bson:"minSuppliers" json:"minSuppliers"` // 最少参与供应商数
MaxSuppliers int `bson:"maxSuppliers" json:"maxSuppliers"` // 最多参与供应商数
BidDuration int `bson:"bidDuration" json:"bidDuration"` // 竞价持续时长(分钟)
BidSupplierCount int `bson:"bidSupplierCount" json:"bidSupplierCount"` // 参与竞价的供应商数量
// 时间戳
BidStartAt *gtime.Time `bson:"bidStartAt" json:"bidStartAt"` // 竞价开始时间
BidEndAt *gtime.Time `bson:"bidEndAt" json:"bidEndAt"` // 竞价结束时间
ResultPublishedAt *gtime.Time `bson:"resultPublishedAt" json:"resultPublishedAt"` // 结果发布时间
}
// ============================================
// 主实体定义
// ============================================
// PurchaseOrder 采购订单实体(统一模式,结构化设计)
type PurchaseOrder struct {
beans.MongoBaseDO `bson:",inline"` // 嵌入基础字段Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
// ============================================
// 基础订单信息(所有模式共用)
// ============================================
OrderNo string `bson:"orderNo" json:"orderNo"` // 订单编号
Title string `bson:"title" json:"title"` // 订单标题
Description string `bson:"description" json:"description"` // 订单描述
OrderType consts.PurchaseOrderType `bson:"orderType" json:"orderType"` // 订单类型direct/assignment/bidding
// 需求方信息
BuyerId *bson.ObjectID `bson:"buyerId" json:"buyerId"` // 采购方ID经销商/门店)
BuyerName string `bson:"buyerName" json:"buyerName"` // 采购方名称
BuyerType string `bson:"buyerType" json:"buyerType"` // 采购方类型
// 通用状态信息
Status consts.PurchaseOrderStatus `bson:"status" json:"status"` // 订单状态
Priority int `bson:"priority" json:"priority"` // 优先级
// ============================================
// 模式特定信息(内嵌结构体)
// ============================================
DirectPurchase *DirectPurchaseInfo `bson:"directPurchase,omitempty" json:"directPurchase,omitempty"` // 指定供应商模式信息
BiddingInfo *BiddingInfo `bson:"biddingInfo,omitempty" json:"biddingInfo,omitempty"` // 竞价模式信息
// ============================================
// 通用字段
// ============================================
ExpectedDelivery *gtime.Time `bson:"expectedDelivery" json:"expectedDelivery"` // 期望交付时间
ExpiryTime *gtime.Time `bson:"expiryTime" json:"expiryTime"` // 订单有效期/竞价结束时间
}
// CollectionName 获取集合名称
func (PurchaseOrder) CollectionName() string {
return public.PurchaseOrderCollection
}

View File

@@ -0,0 +1,42 @@
package entity
import (
"assets/consts/public"
"gitea.com/red-future/common/beans"
"go.mongodb.org/mongo-driver/v2/bson"
)
// PurchaseOrderItem 采购订单明细实体
type PurchaseOrderItem struct {
beans.MongoBaseDO `bson:",inline"` // 嵌入基础字段Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
// 关联信息
OrderId *bson.ObjectID `bson:"orderId" json:"orderId"` // 订单ID
AssetId *bson.ObjectID `bson:"assetId" json:"assetId"` // 资产ID
AssetSkuId *bson.ObjectID `bson:"assetSkuId" json:"assetSkuId"` // 资产SKU ID
// 商品信息
ProductName string `bson:"productName" json:"productName"` // 商品名称
Specification string `bson:"specification" json:"specification"` // 规格描述
Brand string `bson:"brand" json:"brand"` // 品牌
// 数量和价格
Quantity int `bson:"quantity" json:"quantity"` // 订购数量
Unit string `bson:"unit" json:"unit"` // 单位
UnitPrice int `bson:"unitPrice" json:"unitPrice"` // 单价(分)
TotalPrice int `bson:"totalPrice" json:"totalPrice"` // 总价(分)
DiscountPrice int `bson:"discountPrice" json:"discountPrice"` // 折扣价(分)
// 签收和入库
PassQuantity int `bson:"passQuantity" json:"passQuantity"` // 签收数量(与订购数量有差异时应生成退换单)
InboundQty int `bson:"inboundQty" json:"inboundQty"` // 已入库累计数量
// 要求信息
RequirementDesc string `bson:"requirementDesc" json:"requirementDesc"` // 特殊要求描述
DeliveryAddress string `bson:"deliveryAddress" json:"deliveryAddress"` // 交付地址
}
// CollectionName 获取集合名称
func (PurchaseOrderItem) CollectionName() string {
return public.PurchaseOrderItemCollection
}

View File

@@ -0,0 +1,74 @@
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"
)
// PurchaseReturn 采购退换单主表实体
type PurchaseReturn struct {
beans.MongoBaseDO `bson:",inline"` // 嵌入基础字段Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
// 退换单基本信息
ReturnNo string `bson:"returnNo" json:"returnNo"` // 退换单编号
Title string `bson:"title" json:"title"` // 退换单标题
Description string `bson:"description" json:"description"` // 退换说明
ReturnType consts.ReturnType `bson:"returnType" json:"returnType"` // 退换类型return退货/refund退款/exchange换货
// 关联订单信息
OrderId *bson.ObjectID `bson:"orderId" json:"orderId"` // 关联采购订单ID
OrderNo string `bson:"orderNo" json:"orderNo"` // 关联采购订单编号
AssignmentId *bson.ObjectID `bson:"assignmentId" json:"assignmentId"` // 关联指派单ID如果有
BiddingId *bson.ObjectID `bson:"biddingId" json:"biddingId"` // 关联竞价单ID如果有
// 供应商信息
SupplierId *bson.ObjectID `bson:"supplierId" json:"supplierId"` // 供应商ID
SupplierName string `bson:"supplierName" json:"supplierName"` // 供应商名称
SupplierCode string `bson:"supplierCode" json:"supplierCode"` // 供应商编码
// 退换货物信息
TotalItems int `bson:"totalItems" json:"totalItems"` // 退换商品种类数
TotalQuantity int `bson:"totalQuantity" json:"totalQuantity"` // 退换商品总数量
TotalAmount int `bson:"totalAmount" json:"totalAmount"` // 退换总金额(分)
RefundAmount int `bson:"refundAmount" json:"refundAmount"` // 实际退款金额(分)
// 状态和流程信息
Status consts.ReturnStatus `bson:"status" json:"status"` // 退换状态
Priority int `bson:"priority" json:"priority"` // 优先级
// 地址信息
ReturnAddress string `bson:"returnAddress" json:"returnAddress"` // 退货地址
ReturnContact string `bson:"returnContact" json:"returnContact"` // 退货联系人
ReturnPhone string `bson:"returnPhone" json:"returnPhone"` // 退货联系电话
ReceiveAddress string `bson:"receiveAddress" json:"receiveAddress"` // 收货地址(换货时使用)
// 物流信息
LogisticsCompany string `bson:"logisticsCompany" json:"logisticsCompany"` // 物流公司
TrackingNo string `bson:"trackingNo" json:"trackingNo"` // 物流单号
ShipAt *gtime.Time `bson:"shipAt" json:"shipAt"` // 发货时间
ReceiveAt *gtime.Time `bson:"receiveAt" json:"receiveAt"` // 收货时间
// 审批信息
ApprovalStatus consts.ApprovalStatus `bson:"approvalStatus" json:"approvalStatus"` // 审批状态
ApprovedBy string `bson:"approvedBy" json:"approvedBy"` // 审批人ID
ApprovedAt *gtime.Time `bson:"approvedAt" json:"approvedAt"` // 审批时间
ApprovalRemark string `bson:"approvalRemark" json:"approvalRemark"` // 审批备注
// 时间戳
RequestedAt *gtime.Time `bson:"requestedAt" json:"requestedAt"` // 申请时间
ExpectedProcessAt *gtime.Time `bson:"expectedProcessAt" json:"expectedProcessAt"` // 期望处理时间
CompletedAt *gtime.Time `bson:"completedAt" json:"completedAt"` // 完成时间
// 备注信息
Remark string `bson:"remark" json:"remark"` // 备注
InternalRemark string `bson:"internalRemark" json:"internalRemark"` // 内部备注
}
// CollectionName 获取集合名称
func (PurchaseReturn) CollectionName() string {
return public.PurchaseReturnCollection
}

View File

@@ -0,0 +1,57 @@
package entity
import (
consts "assets/consts/procurement"
"assets/consts/public"
"gitea.com/red-future/common/beans"
"go.mongodb.org/mongo-driver/v2/bson"
)
// PurchaseReturnItem 采购退换单明细实体
type PurchaseReturnItem struct {
beans.MongoBaseDO `bson:",inline"` // 嵌入基础字段Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
// 关联信息
ReturnId *bson.ObjectID `bson:"returnId" json:"returnId"` // 退换单ID
OrderId *bson.ObjectID `bson:"orderId" json:"orderId"` // 采购订单ID
OrderItemId *bson.ObjectID `bson:"orderItemId" json:"orderItemId"` // 订单明细ID
// 商品信息
AssetId *bson.ObjectID `bson:"assetId" json:"assetId"` // 资产ID
AssetSkuId *bson.ObjectID `bson:"assetSkuId" json:"assetSkuId"` // 资产SKU ID
ProductName string `bson:"productName" json:"productName"` // 商品名称
Specification string `bson:"specification" json:"specification"` // 规格
Brand string `bson:"brand" json:"brand"` // 品牌
Unit string `bson:"unit" json:"unit"` // 单位
// 数量和价格信息
OriginalQuantity int `bson:"originalQuantity" json:"originalQuantity"` // 原始采购数量
ReturnQuantity int `bson:"returnQuantity" json:"returnQuantity"` // 退换数量
UnitPrice int `bson:"unitPrice" json:"unitPrice"` // 单价(分)
TotalPrice int `bson:"totalPrice" json:"totalPrice"` // 退换小计(分)
RefundPrice int `bson:"refundPrice" json:"refundPrice"` // 实际退款金额(分)
// 退换原因和处理信息
Reason consts.ReturnReason `bson:"reason" json:"reason"` // 退换原因
ReasonDetail string `bson:"reasonDetail" json:"reasonDetail"` // 详细原因说明
ProblemDesc string `bson:"problemDesc" json:"problemDesc"` // 问题描述
ProblemImages []string `bson:"problemImages" json:"problemImages"` // 问题图片URL列表
// 状态信息
Status consts.ReturnItemStatus `bson:"status" json:"status"` // 明细状态
ProcessMethod consts.ProcessMethod `bson:"processMethod" json:"processMethod"` // 处理方式
// 处理结果
ProcessedQuantity int `bson:"processedQuantity" json:"processedQuantity"` // 已处理数量
RemainingQuantity int `bson:"remainingQuantity" json:"remainingQuantity"` // 剩余待处理数量
ProcessResult string `bson:"processResult" json:"processResult"` // 处理结果描述
// 备注
Remark string `bson:"remark" json:"remark"` // 备注
}
// CollectionName 获取集合名称
func (PurchaseReturnItem) CollectionName() string {
return public.PurchaseReturnItemCollection
}

View File

@@ -0,0 +1,87 @@
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
}