133 lines
9.0 KiB
Go
133 lines
9.0 KiB
Go
package model
|
||
|
||
import (
|
||
"time"
|
||
)
|
||
|
||
type UserVendorOrder struct {
|
||
ModelIDCUL
|
||
UserId string `orm:"size(128);column(user_id);index" json:"userID"` // 用户ID
|
||
LocalWayBill string `orm:"size(128);column(local_way_bill);index" json:"localWayBill"` // 本地订单ID
|
||
OtherWayBill string `orm:"size(128);column(other_way_bill);index" json:"otherWayBill"` // 第三方运单ID
|
||
Goods string `orm:"column(goods)" json:"goods"` // 商品名称
|
||
GuaranteeValueAmount float64 `orm:"column(guarantee_value_amount)" json:"guaranteeValueAmount"` // 保价金额
|
||
Weight int `orm:"size(64);column(weight)" json:"weight"` // 重量kg
|
||
Length int `orm:"size(64);column(length)" json:"length"` // 所有包裹累计长cm
|
||
Height int `orm:"size(64);column(height)" json:"height"` // 所有包裹累计高cm
|
||
Width int `orm:"size(64);column(width)" json:"width"` // 所有包裹累计宽cm(向上取整)
|
||
OrderSendTime string `orm:"size(128);column(orderSendTime)" json:"orderSendTime"` // 预约时间
|
||
PackageNum int `orm:"size(128);column(package_num)" json:"packageNum"` // 包裹数量
|
||
ReceiveAddressID int64 `orm:"size(128);column(receive_address_id)" json:"receiveAddressID"` // 收件人地址ID
|
||
Remark string `orm:"size(512);column(remark)" json:"remark"` // 运单备注
|
||
SenderAddressID int64 `orm:"size(128);column(sender_address_id)" json:"senderAddressID"` // 寄件人地址ID
|
||
ThirdPlatform int `orm:"size(16);column(third_platform)" json:"thirdPlatform"` // 第三方平台-京东商家下单传3
|
||
Type int `orm:"size(8);column(type)" json:"type"` // 快递公司
|
||
PromiseTimeType int `orm:"size(8);column(promise_Time_type)" json:"promiseTimeType"` // 快递时效产品
|
||
DeliveryType int `orm:"size(8);column(delivery_type)" json:"deliveryType"` // 产品类型
|
||
ReallyChannelFee float64 `orm:"column(really_channel_fee)" json:"reallyChannelFee"` // 真实价格
|
||
ChannelFee float64 `orm:"column(channel_fee)" json:"channelFee"` // 渠道价
|
||
ServiceCharge float64 `orm:"column(service_charge)" json:"serviceCharge"` // 服务费
|
||
GuarantFee float64 `orm:"column(guarant_fee)" json:"guarantFee"` // 保价费用
|
||
OriginalFee float64 `orm:"column(original_fee)" json:"originalFee"` // 原价
|
||
Bulk float64 `orm:"column(bulk)" json:"bulk"` // 体积抛比系数
|
||
Increment float64 `orm:"column(increment)" json:"increment"` // 增值(物流)
|
||
ChannelType int `orm:"size(8);column(channel_type)" json:"channelType"` // 渠道类型(1-快递,2-物流,3-国际物流,4-整车)
|
||
OrderStatus int `orm:"size(8);column(order_status)" json:"orderType"` // 订单状态(2-待支付,3-支付失败,4-支付成功,5-待取件,6-配送,110-完成,150-取消)
|
||
Img string `orm:"column(img)" json:"img"` // 包裹图片
|
||
IsForward int `orm:"column(is_forward)" json:"isForward"` // 1否,2是 转寄单
|
||
}
|
||
|
||
const (
|
||
OrderStatusWaitPay = 2 // 待支付
|
||
OrderStatusFailPay = 3 // 支付失败
|
||
OrderStatusSuccessPay = 4 // 支付成功
|
||
OrderStatusWaitPickup = 5 // 待取件
|
||
OrderStatusCancel = 150 // 取消订单
|
||
// 。。。。。
|
||
)
|
||
|
||
func (*UserVendorOrder) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"LocalWayBill"},
|
||
[]string{"OtherWayBill"},
|
||
}
|
||
}
|
||
|
||
func (*UserVendorOrder) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"CreatedAt"},
|
||
}
|
||
}
|
||
|
||
// MakeOrderParamReq 下订单请求参数
|
||
type MakeOrderParamReq struct {
|
||
PromiseTimeType int `json:"promiseTimeType"` // 快递时效产品
|
||
DeliveryType int `json:"deliveryType"` // 产品类型
|
||
Goods string `json:"goods"` // 商品名称
|
||
GuaranteeValueAmount float64 `json:"guaranteeValueAmount"` // 保价金额
|
||
Weight int `json:"weight"` // 重量kg
|
||
Length int `json:"length"` // 所有包裹累计长cm
|
||
Height int `json:"height"` // 所有包裹累计高cm
|
||
Width int `json:"width"` // 所有包裹累计宽cm(向上取整)
|
||
OrderSendTime string `json:"orderSendTime"` // 预约时间
|
||
PackageNum int `json:"packageNum"` // 包裹数量
|
||
ReceiveAddressId int64 `json:"receiveAddressId"` // 收件人ID
|
||
ReceiveAddress string `json:"receiveAddress"` // 收件人地址
|
||
ReceiveName string `json:"receiveName"` // 收件人姓名
|
||
ReceivePhone string `json:"receivePhone"` // 收件人手机号
|
||
Remark string `json:"remark"` // 运单备注
|
||
SenderAddressId int64 `json:"senderAddressId"` // 寄件人地址Id
|
||
SenderAddress string `json:"senderAddress"` // 寄件人地址
|
||
SenderName string `json:"senderName"` // 寄件人姓名
|
||
SenderPhone string `json:"senderPhone"` // 寄件人手机号
|
||
ThirdPlatform int `json:"thirdPlatform"` // 第三方平台-京东商家下单传3
|
||
Type int `json:"type"` // 快递公司
|
||
ChannelType int `json:"channelType"` // 渠道类型(1-快递,2-物流,3-国际物流,4-整车)
|
||
Images string `json:"images"` // 包裹图片
|
||
// 快递费
|
||
ChannelFee float64 `json:"channel_fee"` // 渠道价
|
||
Bulk float64 `json:"bulk"` // 体积抛比系数
|
||
ServiceCharge float64 `json:"service_charge"` // 服务费
|
||
GuarantFee float64 `json:"guarant_fee"` // 保价费用
|
||
OriginalFee float64 `json:"original_fee"` // 原价
|
||
Increment float64 `json:"increment"` // 物流
|
||
}
|
||
|
||
// UserOrderList 用户订单列表
|
||
type UserOrderList struct {
|
||
UserId string `orm:"size(128);column(user_id);index" json:"userID"` // 用户ID
|
||
LocalWayBill string `orm:"size(128);column(local_way_bill);index" json:"localWayBill"` // 本地订单ID
|
||
OtherWayBill string `orm:"size(128);column(other_way_bill);index" json:"otherWayBill"` // 第三方运单ID
|
||
Type int `orm:"size(8);column(type)" json:"type"` // 快递公司
|
||
ReceiveAddressID int64 `orm:"size(128);column(receive_address_id)" json:"receiveAddressID"` // 收件人地址ID
|
||
SenderAddressID int64 `orm:"size(128);column(sender_address_id)" json:"senderAddressID"` // 寄件人地址ID
|
||
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"` // 创建时间
|
||
OrderStatus int `orm:"size(8);column(order_status)" json:"orderType"` // 订单状态(1-待支付,2-支付失败,3-支付成功,4-取件,5-配送,6-,4-取消)
|
||
ChannelFee float64 `orm:"column(channel_fee)" json:"channelFee"` // 渠道价
|
||
SendUserName string `orm:"column(send_user_name)" json:"sendUserName"` // 发货人
|
||
ReceiveUserName string `orm:"column(receive_user_name)" json:"receiveUserName"` // 收货人
|
||
SenderAddress string `orm:"column(sender_address)" json:"senderAddress"` // 发货城市
|
||
ReceiveAddress string `orm:"column(receive_address)" json:"receiveAddress"` // 收货城市
|
||
}
|
||
|
||
// OrderListRes 查询订单列表
|
||
type OrderListRes struct {
|
||
UserVendorOrder
|
||
UserName string `orm:"column(user_name)" json:"userName"` // 系统用户
|
||
SendUserName string `orm:"column(send_user_name)" json:"sendUserName"` // 发货人
|
||
ReceiveUserName string `orm:"column(receive_user_name)" json:"receiveUserName"` // 收货人
|
||
SenderAddress string `orm:"column(sender_address)" json:"senderAddress"` // 发货城市
|
||
ReceiveAddress string `orm:"column(receive_address)" json:"receiveAddress"` // 收货城市
|
||
}
|
||
|
||
// OrderListReq 请求参数
|
||
type OrderListReq struct {
|
||
ExpressType int `json:"expressType"` // 快递公司
|
||
OrderNo string `json:"orderNo"` // 订单Id
|
||
OrderStatus int `json:"orderStatus"` // 订单状态
|
||
PageNum int `json:"pageNum"` // 页码
|
||
PageSize int `json:"pageSize"` // 页数
|
||
StartTime time.Time `json:"startTime"` // 开始时间
|
||
EndTime time.Time `json:"endTime"` // 结束时间
|
||
}
|