f84799c3c4
CI / changes (push) Successful in 38s
CI / ad (push) Successful in 29s
CI / admin (push) Successful in 22s
CI / bff (push) Successful in 19s
CI / chore (push) Successful in 22s
CI / equipment (push) Successful in 20s
CI / express (push) Successful in 18s
CI / log (push) Successful in 0s
CI / product (push) Successful in 15s
CI / sale (push) Successful in 16s
CI / task (push) Successful in 17s
CI / user (push) Successful in 16s
CI / wecom (push) Successful in 16s
133 lines
8.8 KiB
Go
133 lines
8.8 KiB
Go
package dao
|
|
|
|
import "lone-services/pkg/utils"
|
|
|
|
const (
|
|
DeliveryTypeOrder = 1 //订单
|
|
DeliveryTypeSupply = 3 //补货
|
|
|
|
SendStatusOver = 1 //为已签收
|
|
SendStatusWait = 2 //为待发货
|
|
SendStatusIn = 3 //为发货中
|
|
SendStatusOk = 4 //为已发货
|
|
SendStatusCancel = 5 //已取消
|
|
|
|
DeliverySendTypeSf uint8 = 1
|
|
DeliverySendTypeJd uint8 = 2
|
|
DeliverySendTypeOther uint8 = 3
|
|
)
|
|
|
|
var DeliverySendType = map[uint8]string{
|
|
DeliverySendTypeSf: "SF", // 示例
|
|
DeliverySendTypeJd: "JD",
|
|
DeliverySendTypeOther: "ZT",
|
|
}
|
|
|
|
type DeliveryOrderCreate struct {
|
|
Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"`
|
|
ObjId string `gorm:"column:obj_id;type:varchar(255);comment:对像id" json:"obj_id"`
|
|
Mobile string `gorm:"column:mobile;type:char(69);comment:收货人手机号" json:"mobile"`
|
|
Address string `gorm:"column:address;type:varchar(255);comment:收货人地址" json:"address"`
|
|
Addressee string `gorm:"column:addressee;type:varchar(255);comment:收货人" json:"addressee"`
|
|
Province string `gorm:"column:province;type:varchar(255);comment:省" json:"province"`
|
|
GroupId int64 `gorm:"column:group_id;type:int(11);default:0;comment:分组ID" json:"group_id"`
|
|
City string `gorm:"column:city;type:varchar(255);comment:市" json:"city"`
|
|
County string `gorm:"column:county;type:varchar(255);comment:县" json:"county"`
|
|
ProductInfo string `gorm:"column:product_info;type:text;comment:产品信息" json:"product_info"`
|
|
Status uint8 `gorm:"column:status;type:tinyint(1);default:2;comment:状态:1为已签收,2为待发货,3为发货中,4为已发货,5已取消;NOT NULL" json:"status"`
|
|
ObjSn string `gorm:"column:obj_sn;type:varchar(255);comment:对像sn" json:"obj_sn"`
|
|
Type uint8 `gorm:"column:type;type:tinyint(1);default:1;comment:类型,1为订单,2为试用,3为补货,4为个人试用;NOT NULL" json:"type"`
|
|
}
|
|
|
|
type DeliveryOrderPrint struct {
|
|
DeliveryOrderPrintEdit
|
|
Weight float32 `gorm:"-:all" json:"weight"`
|
|
Number int `gorm:"-:all" json:"number"`
|
|
ProductItems []DeliveryOrderProduct `gorm:"-:all" json:"product_items"`
|
|
Url string `gorm:"-:all" json:"url"`
|
|
}
|
|
|
|
type DeliveryOrderProduct struct {
|
|
ProductId int `json:"product_id"`
|
|
ProductName string `json:"product_name"`
|
|
ProductNumber int `json:"product_number"`
|
|
OrderSn string `json:"order_sn"`
|
|
Price float32 `json:"price"`
|
|
ProductWeight float32 `json:"product_weight"`
|
|
ProductCubage float32 `json:"product_cubage"`
|
|
ProductLength float32 `json:"product_length"`
|
|
ProductWidth float32 `json:"product_width"`
|
|
ProductHeight float32 `json:"product_height"`
|
|
}
|
|
|
|
type DeliverItems struct {
|
|
Id int `json:"id"`
|
|
ObjID string `json:"obj_id"`
|
|
Mobile string `json:"mobile"`
|
|
OriginalMobile string `gorm:"-" json:"original_mobile"`
|
|
Address string `json:"address"`
|
|
Addressee string `json:"addressee"`
|
|
Type uint8 `json:"type"`
|
|
SendTime utils.CustomTime `gorm:"column:sign_time" json:"send_time"`
|
|
Status uint8 `json:"status"`
|
|
ProductInfo string `gorm:"column:product_info" json:"-"`
|
|
ProductData []DeliveryOrderItemsProduct `gorm:"-" json:"product_data"`
|
|
OrderSn string `gorm:"column:obj_sn" json:"order_sn"`
|
|
CreateTime utils.CustomTime `json:"create_time"`
|
|
}
|
|
|
|
type DeliveryOrderItemsProduct struct {
|
|
ProductId int `json:"product_id"`
|
|
ProductName string `json:"product_name"`
|
|
Number int `json:"number"`
|
|
}
|
|
|
|
type DeliveryOrderUpTransit struct {
|
|
Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"`
|
|
ObjId string `gorm:"column:obj_id;type:varchar(255);comment:对像id" json:"obj_id"`
|
|
EstimatedTime string `gorm:"column:estimated_time;type:varchar(30);comment:预计到达时间" json:"estimated_time"`
|
|
ChangeEstimatedTime uint8 `gorm:"column:change_estimated_time;type:tinyint(1);default:2;comment:是否更新快递预估时间,1为更新,2为不更新" json:"change_estimated_time"`
|
|
TransitQuery string `gorm:"column:transit_query;type:text;comment:查询快递信息" json:"transit_query"`
|
|
TransitId int `gorm:"column:transit_id;type:int(11);comment:快递表ID" json:"transit_id"`
|
|
TransitSn string `gorm:"column:transit_sn;type:varchar(255);comment:快递号" json:"transit_sn"`
|
|
Type uint8 `gorm:"column:type;type:tinyint(1);default:1;comment:类型,1为订单,2为试用,3为补货,4为个人试用;NOT NULL" json:"type"`
|
|
SignTime utils.CustomTime `gorm:"column:sign_time;type:datetime;comment:签收时间" json:"sign_time"`
|
|
Status uint8 `gorm:"column:status;type:tinyint(1);default:2;comment:状态:1为已签收,2为待发货,3为发货中,4为已发货,5已取消;NOT NULL" json:"status"`
|
|
OrderSn string `gorm:"column:order_sn;type:varchar(50);comment:订单SN" json:"order_sn"`
|
|
}
|
|
type DeliveryOrderPrintEdit struct {
|
|
Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"`
|
|
ObjId string `gorm:"column:obj_id;type:varchar(255);comment:对像id" json:"obj_id"`
|
|
Mobile string `gorm:"column:mobile;type:char(60);comment:收货人手机号" json:"mobile"`
|
|
Address string `gorm:"column:address;type:varchar(255);comment:收货人地址" json:"address"`
|
|
Addressee string `gorm:"column:addressee;type:varchar(255);comment:收货人" json:"addressee"`
|
|
Status uint8 `gorm:"column:status;type:tinyint(1);default:2;comment:状态:1为已签收,2为待发货,3为发货中,4为已发货,5已取消;NOT NULL" json:"status"`
|
|
TransitName string `gorm:"column:transit_name;type:varchar(50);comment:快递公司" json:"transit_name"`
|
|
TransitSn string `gorm:"column:transit_sn;type:varchar(255);comment:快递号" json:"transit_sn"`
|
|
TransitInfo string `gorm:"column:transit_info;type:text;comment:快递详情" json:"transit_info"`
|
|
TransitContent string `gorm:"column:transit_content;type:text;comment:发快递时的结果" json:"transit_content"`
|
|
TransitType uint8 `gorm:"column:transit_type;type:tinyint(1);default:1;comment:快递公司,1为顺丰,2为京东,3为。。。" json:"transit_type"`
|
|
TransitId int `gorm:"column:transit_id;type:int(11);comment:快递表ID" json:"transit_id"`
|
|
PrintStatus uint8 `gorm:"column:print_status;type:tinyint(1);default:2;comment:打印状态,1为打印完,2为未打印,3为已绑定" json:"print_status"`
|
|
Express string `gorm:"column:express;type:varchar(255);comment:快递单地址" json:"express"`
|
|
Type uint8 `gorm:"column:type;type:tinyint(1);default:1;comment:类型,1为订单,2为试用,3为补货,4为个人家里试用,5产品先付后用;NOT NULL" json:"type"`
|
|
OrderSn string `gorm:"column:order_sn;type:varchar(50);comment:订单SN" json:"order_sn"`
|
|
AdminName string `gorm:"column:admin_name;type:varchar(255)" json:"admin_name"`
|
|
AdminId int `gorm:"column:admin_id;type:int(11);default:0" json:"admin_id"`
|
|
Province string `gorm:"column:province;type:varchar(255);comment:省" json:"province"`
|
|
City string `gorm:"column:city;type:varchar(255);comment:市" json:"city"`
|
|
County string `gorm:"column:county;type:varchar(255);comment:县" json:"county"`
|
|
ProductInfo string `gorm:"column:product_info;type:text;comment:产品信息" json:"product_info"`
|
|
ObjSn string `gorm:"column:obj_sn;type:varchar(255);comment:对像sn" json:"obj_sn"`
|
|
SendTime utils.CustomTime `gorm:"column:send_time;type:datetime;comment:发货时间" json:"send_time"`
|
|
CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP;comment:添加时间" json:"create_time"`
|
|
}
|
|
|
|
type ProductPrint struct {
|
|
Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"`
|
|
Name string `gorm:"column:name;type:varchar(256);comment:产品名;NOT NULL" json:"name"`
|
|
Weight float32 `gorm:"column:weight;type:decimal(10,3);comment:重量" json:"weight"`
|
|
Cubage string `gorm:"column:cubage;type:varchar(255);comment:体积" json:"cubage"`
|
|
Waybill string `gorm:"column:waybill;type:varchar(255);comment:运货单图片" json:"waybill"`
|
|
}
|