254 lines
11 KiB
Go
254 lines
11 KiB
Go
|
|
package dto
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"assets/consts/procurement"
|
|||
|
|
|
|||
|
|
"github.com/gogf/gf/v2/frame/g"
|
|||
|
|
"go.mongodb.org/mongo-driver/v2/bson"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// GenerateSupplierTestDataReq 生成供应商测试数据请求
|
|||
|
|
type GenerateSupplierTestDataReq struct {
|
|||
|
|
g.Meta `path:"/generateTestData" method:"post" tags:"供应商管理" summary:"生成测试数据" dc:"生成供应商测试数据"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// CreateSupplierReq 创建供应商请求
|
|||
|
|
type CreateSupplierReq struct {
|
|||
|
|
g.Meta `path:"/createSupplier" method:"post" tags:"供应商管理" summary:"创建供应商" dc:"创建新的供应商(仅基础信息)"`
|
|||
|
|
|
|||
|
|
// 基础信息(最小必要字段)
|
|||
|
|
Name string `json:"name" v:"required|max-length:100#供应商名称不能为空|供应商名称不能超过100个字符" dc:"供应商名称(必填)"`
|
|||
|
|
Code string `json:"code" v:"required|max-length:50#供应商编码不能为空|供应商编码不能超过50个字符" dc:"供应商编码(必填)"`
|
|||
|
|
ShortName string `json:"shortName" dc:"供应商简称"`
|
|||
|
|
Alias []string `json:"alias" dc:"别名列表"`
|
|||
|
|
Logo string `json:"logo" dc:"供应商LOGO URL"`
|
|||
|
|
|
|||
|
|
// 联系信息
|
|||
|
|
Phone string `json:"phone" dc:"供应商电话"`
|
|||
|
|
Mobile string `json:"mobile" dc:"手机号码"`
|
|||
|
|
Email string `json:"email" dc:"邮箱地址"`
|
|||
|
|
Website string `json:"website" dc:"官网地址"`
|
|||
|
|
ContactPerson string `json:"contactPerson" dc:"联系人姓名"`
|
|||
|
|
ContactPhone string `json:"contactPhone" dc:"联系人电话"`
|
|||
|
|
ContactEmail string `json:"contactEmail" dc:"联系人邮箱"`
|
|||
|
|
ContactPosition string `json:"contactPosition" dc:"联系人职位"`
|
|||
|
|
|
|||
|
|
// 地址信息
|
|||
|
|
Country string `json:"country" dc:"国家"`
|
|||
|
|
Province string `json:"province" dc:"省份"`
|
|||
|
|
City string `json:"city" dc:"城市"`
|
|||
|
|
District string `json:"district" dc:"区县"`
|
|||
|
|
Address string `json:"address" dc:"详细地址"`
|
|||
|
|
PostalCode string `json:"postalCode" dc:"邮政编码"`
|
|||
|
|
|
|||
|
|
// 企业资质信息
|
|||
|
|
BusinessLicense string `json:"businessLicense" dc:"营业执照号"`
|
|||
|
|
LegalPerson string `json:"legalPerson" dc:"法定代表人"`
|
|||
|
|
TaxNumber string `json:"taxNumber" dc:"税务登记号"`
|
|||
|
|
BankName string `json:"bankName" dc:"开户银行"`
|
|||
|
|
BankAccount string `json:"bankAccount" dc:"银行账号"`
|
|||
|
|
BankAccountName string `json:"bankAccountName" dc:"账户名称"`
|
|||
|
|
|
|||
|
|
// 业务合作信息
|
|||
|
|
SupplierLevel string `json:"supplierLevel" dc:"供应商等级"`
|
|||
|
|
PaymentMethod string `json:"paymentMethod" dc:"结算方式"`
|
|||
|
|
PaymentPeriod int `json:"paymentPeriod" dc:"付款周期(天)"`
|
|||
|
|
TaxRate float64 `json:"taxRate" dc:"税率(如0.13表示13%)"`
|
|||
|
|
MinOrderAmount int `json:"minOrderAmount" dc:"最小订货金额(分)"`
|
|||
|
|
|
|||
|
|
// 经营品类信息
|
|||
|
|
MainCategories []string `json:"mainCategories" dc:"主营品类ID列表"`
|
|||
|
|
BusinessScope string `json:"businessScope" dc:"经营范围"`
|
|||
|
|
|
|||
|
|
// 状态信息
|
|||
|
|
Status consts.SupplierStatus `json:"status" dc:"供应商状态"`
|
|||
|
|
|
|||
|
|
// 备注和标签
|
|||
|
|
Remark string `json:"remark" dc:"备注信息"`
|
|||
|
|
Tags []string `json:"tags" dc:"标签列表"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// CreateSupplierRes 创建供应商响应
|
|||
|
|
type CreateSupplierRes struct {
|
|||
|
|
ID *bson.ObjectID `json:"id"` // 供应商ID
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// BatchCreateSuppliersReq 批量创建供应商请求
|
|||
|
|
type BatchCreateSuppliersReq struct {
|
|||
|
|
g.Meta `path:"/batchCreateSuppliers" method:"post" tags:"供应商管理" summary:"批量创建供应商" dc:"批量创建供应商"`
|
|||
|
|
|
|||
|
|
Suppliers []CreateSupplierReq `json:"suppliers" v:"required" dc:"供应商列表"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// BatchCreateSuppliersRes 批量创建供应商响应
|
|||
|
|
type BatchCreateSuppliersRes struct {
|
|||
|
|
IDs []*bson.ObjectID `json:"ids"` // 创建的ID列表
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// UpdateSupplierReq 更新供应商请求
|
|||
|
|
type UpdateSupplierReq struct {
|
|||
|
|
g.Meta `path:"/updateSupplier" method:"put" tags:"供应商管理" summary:"更新供应商" dc:"更新供应商信息"`
|
|||
|
|
|
|||
|
|
ID *bson.ObjectID `json:"id" v:"required" dc:"供应商ID"`
|
|||
|
|
|
|||
|
|
// 基础信息
|
|||
|
|
Name string `json:"name" dc:"供应商名称"`
|
|||
|
|
Code string `json:"code" dc:"供应商编码"`
|
|||
|
|
ShortName string `json:"shortName" dc:"供应商简称"`
|
|||
|
|
Alias []string `json:"alias" dc:"别名列表"`
|
|||
|
|
Logo string `json:"logo" dc:"供应商LOGO URL"`
|
|||
|
|
|
|||
|
|
// 联系信息
|
|||
|
|
Phone string `json:"phone" dc:"供应商电话"`
|
|||
|
|
Mobile string `json:"mobile" dc:"手机号码"`
|
|||
|
|
Email string `json:"email" dc:"邮箱地址"`
|
|||
|
|
Website string `json:"website" dc:"官网地址"`
|
|||
|
|
ContactPerson string `json:"contactPerson" dc:"联系人姓名"`
|
|||
|
|
ContactPhone string `json:"contactPhone" dc:"联系人电话"`
|
|||
|
|
ContactEmail string `json:"contactEmail" dc:"联系人邮箱"`
|
|||
|
|
ContactPosition string `json:"contactPosition" dc:"联系人职位"`
|
|||
|
|
|
|||
|
|
// 地址信息
|
|||
|
|
Country string `json:"country" dc:"国家"`
|
|||
|
|
Province string `json:"province" dc:"省份"`
|
|||
|
|
City string `json:"city" dc:"城市"`
|
|||
|
|
District string `json:"district" dc:"区县"`
|
|||
|
|
Address string `json:"address" dc:"详细地址"`
|
|||
|
|
PostalCode string `json:"postalCode" dc:"邮政编码"`
|
|||
|
|
|
|||
|
|
// 企业资质信息
|
|||
|
|
BusinessLicense string `json:"businessLicense" dc:"营业执照号"`
|
|||
|
|
LegalPerson string `json:"legalPerson" dc:"法定代表人"`
|
|||
|
|
TaxNumber string `json:"taxNumber" dc:"税务登记号"`
|
|||
|
|
BankName string `json:"bankName" dc:"开户银行"`
|
|||
|
|
BankAccount string `json:"bankAccount" dc:"银行账号"`
|
|||
|
|
BankAccountName string `json:"bankAccountName" dc:"账户名称"`
|
|||
|
|
|
|||
|
|
// 业务合作信息
|
|||
|
|
SupplierLevel string `json:"supplierLevel" dc:"供应商等级"`
|
|||
|
|
PaymentMethod string `json:"paymentMethod" dc:"结算方式"`
|
|||
|
|
PaymentPeriod int `json:"paymentPeriod" dc:"付款周期(天)"`
|
|||
|
|
TaxRate float64 `json:"taxRate" dc:"税率(如0.13表示13%)"`
|
|||
|
|
MinOrderAmount int `json:"minOrderAmount" dc:"最小订货金额(分)"`
|
|||
|
|
|
|||
|
|
// 经营品类信息
|
|||
|
|
MainCategories []string `json:"mainCategories" dc:"主营品类ID列表"`
|
|||
|
|
BusinessScope string `json:"businessScope" dc:"经营范围"`
|
|||
|
|
|
|||
|
|
// 状态信息
|
|||
|
|
Status consts.SupplierStatus `json:"status" dc:"供应商状态"`
|
|||
|
|
|
|||
|
|
// 备注和标签
|
|||
|
|
Remark string `json:"remark" dc:"备注信息"`
|
|||
|
|
Tags []string `json:"tags" dc:"标签列表"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// DeleteSupplierReq 删除供应商请求
|
|||
|
|
type DeleteSupplierReq struct {
|
|||
|
|
g.Meta `path:"/deleteSupplier" method:"delete" tags:"供应商管理" summary:"删除供应商" dc:"删除供应商"`
|
|||
|
|
|
|||
|
|
ID *bson.ObjectID `json:"id" v:"required" dc:"供应商ID"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// GetSupplierReq 获取供应商详情请求
|
|||
|
|
type GetSupplierReq struct {
|
|||
|
|
g.Meta `path:"/getSupplier" method:"get" tags:"供应商管理" summary:"获取供应商详情" dc:"获取供应商详情"`
|
|||
|
|
|
|||
|
|
ID *bson.ObjectID `json:"id" v:"required" dc:"供应商ID"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// GetSupplierRes 获取供应商详情响应(简化版)
|
|||
|
|
type GetSupplierRes struct {
|
|||
|
|
ID *bson.ObjectID `json:"id"`
|
|||
|
|
Name string `json:"name"`
|
|||
|
|
Code string `json:"code"`
|
|||
|
|
ShortName string `json:"shortName"`
|
|||
|
|
Alias []string `json:"alias"`
|
|||
|
|
Logo string `json:"logo"`
|
|||
|
|
Phone string `json:"phone"`
|
|||
|
|
Mobile string `json:"mobile"`
|
|||
|
|
Email string `json:"email"`
|
|||
|
|
Website string `json:"website"`
|
|||
|
|
ContactPerson string `json:"contactPerson"`
|
|||
|
|
ContactPhone string `json:"contactPhone"`
|
|||
|
|
ContactEmail string `json:"contactEmail"`
|
|||
|
|
ContactPosition string `json:"contactPosition"`
|
|||
|
|
Country string `json:"country"`
|
|||
|
|
Province string `json:"province"`
|
|||
|
|
City string `json:"city"`
|
|||
|
|
District string `json:"district"`
|
|||
|
|
Address string `json:"address"`
|
|||
|
|
PostalCode string `json:"postalCode"`
|
|||
|
|
BusinessLicense string `json:"businessLicense"`
|
|||
|
|
LegalPerson string `json:"legalPerson"`
|
|||
|
|
TaxNumber string `json:"taxNumber"`
|
|||
|
|
BankName string `json:"bankName"`
|
|||
|
|
BankAccount string `json:"bankAccount"`
|
|||
|
|
BankAccountName string `json:"bankAccountName"`
|
|||
|
|
SupplierLevel string `json:"supplierLevel"`
|
|||
|
|
PaymentMethod string `json:"paymentMethod"`
|
|||
|
|
PaymentPeriod int `json:"paymentPeriod"`
|
|||
|
|
TaxRate float64 `json:"taxRate"`
|
|||
|
|
MinOrderAmount int `json:"minOrderAmount"`
|
|||
|
|
MainCategories []string `json:"mainCategories"`
|
|||
|
|
BusinessScope string `json:"businessScope"`
|
|||
|
|
Status consts.SupplierStatus `json:"status"`
|
|||
|
|
StatusText string `json:"statusText"`
|
|||
|
|
Rating float64 `json:"rating"`
|
|||
|
|
DeliveryRating float64 `json:"deliveryRating"`
|
|||
|
|
QualityRating float64 `json:"qualityRating"`
|
|||
|
|
ServiceRating float64 `json:"serviceRating"`
|
|||
|
|
TotalOrders int64 `json:"totalOrders"`
|
|||
|
|
TotalAmount int64 `json:"totalAmount"`
|
|||
|
|
Remark string `json:"remark"`
|
|||
|
|
Tags []string `json:"tags"`
|
|||
|
|
CreatedAt string `json:"createdAt"`
|
|||
|
|
UpdatedAt string `json:"updatedAt"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ListSuppliersReq 获取供应商列表请求
|
|||
|
|
type ListSuppliersReq struct {
|
|||
|
|
g.Meta `path:"/listSuppliers" method:"get" tags:"供应商管理" summary:"获取供应商列表" dc:"分页查询供应商列表"`
|
|||
|
|
|
|||
|
|
Name string `json:"name" dc:"供应商名称(模糊查询)"`
|
|||
|
|
Code string `json:"code" dc:"供应商编码(精确查询)"`
|
|||
|
|
Status *consts.SupplierStatus `json:"status" dc:"供应商状态"`
|
|||
|
|
PageNum int `json:"pageNum" dc:"页码"`
|
|||
|
|
PageSize int `json:"pageSize" dc:"每页大小"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ListSuppliersRes 获取供应商列表响应
|
|||
|
|
type ListSuppliersRes struct {
|
|||
|
|
List []*SupplierListItem `json:"list" dc:"供应商列表"`
|
|||
|
|
Total int64 `json:"total" dc:"总数"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// GetSupplierOptionsReq 获取供应商选项请求
|
|||
|
|
type GetSupplierOptionsReq struct {
|
|||
|
|
g.Meta `path:"/getSupplierOptions" method:"get" tags:"供应商管理" summary:"获取供应商选项" dc:"获取供应商选项(用于下拉选择)"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// GetSupplierOptionsRes 获取供应商选项响应
|
|||
|
|
type GetSupplierOptionsRes struct {
|
|||
|
|
List []*SupplierListItem `json:"list" dc:"供应商选项列表"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// SupplierListItem 供应商列表项(简化版)
|
|||
|
|
type SupplierListItem struct {
|
|||
|
|
ID *bson.ObjectID `json:"id"`
|
|||
|
|
Name string `json:"name"`
|
|||
|
|
Code string `json:"code"`
|
|||
|
|
ShortName string `json:"shortName"`
|
|||
|
|
Logo string `json:"logo"`
|
|||
|
|
Phone string `json:"phone"`
|
|||
|
|
Mobile string `json:"mobile"`
|
|||
|
|
Email string `json:"email"`
|
|||
|
|
Website string `json:"website"`
|
|||
|
|
Address string `json:"address"`
|
|||
|
|
Status consts.SupplierStatus `json:"status"`
|
|||
|
|
StatusText string `json:"statusText"`
|
|||
|
|
Rating float64 `json:"rating"`
|
|||
|
|
CreatedAt string `json:"createdAt"`
|
|||
|
|
UpdatedAt string `json:"updatedAt"`
|
|||
|
|
}
|