2023-09-15 09:58:45 +00:00
|
|
|
package constants
|
|
|
|
|
2023-09-19 11:17:04 +00:00
|
|
|
// 订单类型
|
|
|
|
const (
|
|
|
|
DELIVERYMETHODDIRECTMAIL int64 = 1
|
|
|
|
DELIVERYMETHODDSCLOUDSTORE int64 = 1
|
|
|
|
)
|
|
|
|
|
2023-09-15 09:58:45 +00:00
|
|
|
// 货币
|
|
|
|
type Currency string
|
|
|
|
|
|
|
|
const (
|
2023-09-19 11:17:04 +00:00
|
|
|
CURRENCYUSD Currency = "usd"
|
2023-09-15 09:58:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// 金额单位
|
2023-09-18 07:39:12 +00:00
|
|
|
type AmountUnit interface{}
|
|
|
|
|
|
|
|
// 汇率单位
|
|
|
|
type ExchangeRateUnit interface{}
|
2023-09-15 09:58:45 +00:00
|
|
|
|
|
|
|
// 交易方式
|
|
|
|
type PayMethods string
|
|
|
|
|
|
|
|
const (
|
2023-09-19 11:17:04 +00:00
|
|
|
PAYMETHODCARD PayMethods = "CARD"
|
|
|
|
PayMethodVISA PayMethods = "VISA"
|
2023-09-15 09:58:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// 支付状态
|
|
|
|
type PayStatusCode int64
|
|
|
|
|
|
|
|
const (
|
2023-09-19 11:17:04 +00:00
|
|
|
PAYSTATUSUNPAID PayStatusCode = 10 //10,未支付
|
|
|
|
PAYSTATUSPAID PayStatusCode = 20 //20,已支付
|
|
|
|
PAYSTATUSREFUNDED PayStatusCode = 30 //30,已退款
|
2023-09-15 09:58:45 +00:00
|
|
|
)
|
|
|
|
|
2023-09-19 05:56:59 +00:00
|
|
|
// 订单支付状态
|
|
|
|
type OrderPayStatusCode int64
|
|
|
|
|
|
|
|
// 0,未付首款
|
|
|
|
// 10,已付首款
|
|
|
|
// 20,已退首款
|
|
|
|
// 30,已付尾款
|
|
|
|
// 40,已退尾款
|
|
|
|
const (
|
2023-09-19 11:17:04 +00:00
|
|
|
ORDERPAYSTATUSUNPAIDDEPOSIT OrderPayStatusCode = 0
|
|
|
|
ORDERPAYSTATUSPAIDDEPOSIT OrderPayStatusCode = 10
|
|
|
|
ORDERPAYSTATUSREFUNDEDDEPOSIT OrderPayStatusCode = 20
|
|
|
|
ORDERPAYSTATUSPAIDDREMAINING OrderPayStatusCode = 30
|
|
|
|
ORDERPAYSTATUSREFUNDEDREMAINING OrderPayStatusCode = 40
|
2023-09-19 05:56:59 +00:00
|
|
|
)
|
|
|
|
|
2023-09-15 09:58:45 +00:00
|
|
|
// 订单状态
|
|
|
|
type OrderStatusCode int64
|
|
|
|
|
|
|
|
const (
|
|
|
|
ORDERSTATUSUNPAIDDEPOSIT OrderStatusCode = 0 // 0,未支付定金
|
|
|
|
ORDERSTATUSDIRECTMAILORDERED OrderStatusCode = 10100 // 10100,直邮单--已下单
|
|
|
|
ORDERSTATUSDIRECTMAILCANCEL OrderStatusCode = 10101 // 10101,直邮单--已取消
|
|
|
|
ORDERSTATUSDIRECTMAILSTARTPRODUCTION OrderStatusCode = 10200 // 10200,直邮单--开始生产
|
|
|
|
ORDERSTATUSDIRECTMAILCOMPLETEPRODUCTION OrderStatusCode = 10300 // 10300,直邮单--生产完成
|
|
|
|
ORDERSTATUSDIRECTMAILSHIPPED OrderStatusCode = 10400 // 10400,直邮单--已发货
|
|
|
|
ORDERSTATUSDIRECTMAILARRIVED OrderStatusCode = 10500 // 10500,直邮单--已到达
|
|
|
|
ORDERSTATUSCLOUDSTOREORDERED OrderStatusCode = 20100 // 20100,云仓单--已下单
|
|
|
|
ORDERSTATUSCLOUDSTORECANCEL OrderStatusCode = 20101 // 20101,云仓单--已取消
|
|
|
|
ORDERSTATUSCLOUDSTORESTARTPRODUCTION OrderStatusCode = 20200 // 20200,云仓单--开始生产
|
|
|
|
ORDERSTATUSCLOUDSTOREOMPLETEPRODUCTION OrderStatusCode = 20300 // 20300,云仓单--生产完成
|
|
|
|
ORDERSTATUSCLOUDSTOREARRIVEDWAREHOUSE OrderStatusCode = 20400 // 20400,云仓单--直达仓库
|
|
|
|
)
|
|
|
|
|
|
|
|
// 订单状态名称
|
|
|
|
var OrderStatusMessage map[OrderStatusCode]string
|
|
|
|
|
|
|
|
// 支付状态名称
|
|
|
|
var PayStatusMessage map[PayStatusCode]string
|
|
|
|
|
2023-09-20 03:39:56 +00:00
|
|
|
// 订单状态--用户可见--直邮
|
|
|
|
var OrderStatusUserDIRECTMAIL []OrderStatusCode
|
|
|
|
|
|
|
|
// 订单状态--用户可见--云仓
|
|
|
|
var OrderStatusUserCLOUDSTORE []OrderStatusCode
|
2023-09-15 09:58:45 +00:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
// 订单状态名称
|
|
|
|
PayStatusMessage = make(map[PayStatusCode]string)
|
2023-09-19 11:17:04 +00:00
|
|
|
PayStatusMessage[PAYSTATUSUNPAID] = "Paid"
|
|
|
|
PayStatusMessage[PAYSTATUSPAID] = "Unpaid"
|
|
|
|
PayStatusMessage[PAYSTATUSREFUNDED] = "Refunded"
|
2023-09-15 09:58:45 +00:00
|
|
|
|
|
|
|
// 订单状态名称
|
|
|
|
OrderStatusMessage = make(map[OrderStatusCode]string)
|
|
|
|
OrderStatusMessage[ORDERSTATUSUNPAIDDEPOSIT] = "未支付定金"
|
|
|
|
|
|
|
|
OrderStatusMessage[ORDERSTATUSDIRECTMAILORDERED] = "直邮单--已下单"
|
|
|
|
OrderStatusMessage[ORDERSTATUSDIRECTMAILSTARTPRODUCTION] = "直邮单--开始生产"
|
|
|
|
OrderStatusMessage[ORDERSTATUSDIRECTMAILCOMPLETEPRODUCTION] = "直邮单--生产完成"
|
|
|
|
OrderStatusMessage[ORDERSTATUSDIRECTMAILSHIPPED] = "直邮单--已发货"
|
|
|
|
OrderStatusMessage[ORDERSTATUSDIRECTMAILARRIVED] = "直邮单--已到达"
|
|
|
|
|
|
|
|
OrderStatusMessage[ORDERSTATUSCLOUDSTOREORDERED] = "云仓单--已下单"
|
|
|
|
OrderStatusMessage[ORDERSTATUSCLOUDSTORESTARTPRODUCTION] = "云仓单--开始生产"
|
|
|
|
OrderStatusMessage[ORDERSTATUSCLOUDSTOREOMPLETEPRODUCTION] = "云仓单--生产完成"
|
|
|
|
OrderStatusMessage[ORDERSTATUSCLOUDSTOREARRIVEDWAREHOUSE] = "云仓单--直达仓库"
|
|
|
|
|
2023-09-20 03:39:56 +00:00
|
|
|
// 订单状态--用户可见--直邮
|
|
|
|
OrderStatusUserDIRECTMAIL = []OrderStatusCode{
|
2023-09-15 09:58:45 +00:00
|
|
|
ORDERSTATUSUNPAIDDEPOSIT,
|
|
|
|
ORDERSTATUSDIRECTMAILORDERED, ORDERSTATUSDIRECTMAILSTARTPRODUCTION, ORDERSTATUSDIRECTMAILCOMPLETEPRODUCTION, ORDERSTATUSDIRECTMAILSHIPPED, ORDERSTATUSDIRECTMAILARRIVED,
|
2023-09-20 03:39:56 +00:00
|
|
|
}
|
|
|
|
// 订单状态--用户可见--云仓
|
|
|
|
OrderStatusUserCLOUDSTORE = []OrderStatusCode{
|
|
|
|
ORDERSTATUSUNPAIDDEPOSIT,
|
2023-09-15 09:58:45 +00:00
|
|
|
ORDERSTATUSCLOUDSTOREORDERED, ORDERSTATUSCLOUDSTORESTARTPRODUCTION, ORDERSTATUSCLOUDSTOREOMPLETEPRODUCTION, ORDERSTATUSCLOUDSTOREARRIVEDWAREHOUSE,
|
|
|
|
}
|
|
|
|
}
|