- mtps, dada create waybill

- create legacy jxorder(not finished).
This commit is contained in:
gazebo
2018-07-14 14:35:51 +08:00
parent 52248ca427
commit 805925ff58
19 changed files with 759 additions and 147 deletions

View File

@@ -1,7 +1,7 @@
package model
const (
VenderIDUnknown = -1
VendorIDUnknown = -1
VendorIDPurchaseBegin = 0
VendorIDJD = 0
VendorIDMTWM = 1
@@ -14,14 +14,34 @@ const (
VendorIDDeliveryEnd = 102
)
var (
VendorNames = map[int]string{
VendorIDJD: "JD",
VendorIDELM: "ELEME",
VendorIDMTWM: "MT",
}
)
const (
OrderTypeOrder = 1
OrderTypeWaybill = 2
)
// https://blog.csdn.net/a13570320979/article/details/51366355
// 美团配送:
// 坐标类型0火星坐标高德腾讯地图均采用火星坐标 1百度坐标 默认值为0
// 京东:
// 收货人地址定位类型buyerCoordType值为空或为1时定位类型为gps如为其他值时定位类型为非gps类型。)
// 饿了么:
// 只支持高德坐标
// 达达:
// 只支持高德坐标
// 如下定义与美团配送兼容
const (
CoordinateTypeMars = 0 // 火星坐标
CoordinateTypeReal = 1 // 真实坐标
CoordinateTypeMars = 0 // 火星坐标高德坐标GCJ02坐标系
CoordinateTypeBaiDu = 1 // 百度坐标bd-09在GCJ02坐标系上再次偏移加密的坐标
CoordinateTypeMapbar = 2
CoordinateTypeGPS = 84 // 真实坐标WGS84原始坐标系
)
const (

View File

@@ -8,38 +8,41 @@ type ModelTimeInfo struct {
}
type GoodsOrder struct {
ID int64 `orm:"column(id)"`
VendorOrderID string `orm:"column(vendor_order_id);size(48)"`
VendorID int `orm:"column(vendor_id)"`
VendorStoreID string `orm:"column(vendor_store_id);size(48)"`
StoreID int `orm:"column(store_id)"` // 外部系统里记录的 jxstoreid
JxStoreID int `orm:"column(jx_store_id)"` // 根据VendorStoreID在本地系统里查询出来的 jxstoreid
StoreName string `orm:"size(64)"`
SubStoreID int `orm:"column(sub_store_id)"`
SubStoreName string `orm:"size(64)"`
ShopPrice int64 // 单位为分
SalePrice int64 // 单位为分
Weight int // 单位为克
ConsigneeName string `orm:"size(32)"`
ConsigneeMobile string `orm:"size(32)"`
ConsigneeAddress string `orm:"size(255)"`
ConsigneeLng int // 坐标 * 10的六次方
ConsigneeLat int // 坐标 * 10的六次方
CoordinateType int
SkuCount int // 商品类别数量即有多少种商品注意在某些情况下相同SKU的商品由于售价不同也会当成不同商品在这个值里
GoodsCount int // 商品个数
Status int // 参见相关常量定义
VendorStatus string `orm:"size(16)"`
LockStatus int
CancelApplyReason string `orm:"size(255)"` // ""表示没有申请不为null表示用户正在取消申请
WaybillVendorID int `orm:"column(waybill_vendor_id)"`
WaybillStatus int
WaybillVendorStatus string `orm:"size(16)"`
DuplicatedCount int // 重复新定单消息数这个一般不是由于消息重发赞成的消息重发由OrderStatus过滤一般是业务逻辑赞成的
OriginalData string `orm:"type(text)"`
OrderCreatedAt time.Time `orm:"type(datetime);index"`
OrderFinishedAt time.Time `orm:"type(datetime)"`
ID int64 `orm:"column(id)"`
VendorOrderID string `orm:"column(vendor_order_id);size(48)"`
VendorID int `orm:"column(vendor_id)"`
VendorStoreID string `orm:"column(vendor_store_id);size(48)"`
StoreID int `orm:"column(store_id)"` // 外部系统里记录的 jxstoreid
JxStoreID int `orm:"column(jx_store_id)"` // 根据VendorStoreID在本地系统里查询出来的 jxstoreid
StoreName string `orm:"size(64)"`
SubStoreID int `orm:"column(sub_store_id)"`
SubStoreName string `orm:"size(64)"`
ShopPrice int64 // 单位为分
SalePrice int64 // 单位为分
Weight int // 单位为克
ConsigneeName string `orm:"size(32)"`
ConsigneeMobile string `orm:"size(32)"`
ConsigneeAddress string `orm:"size(255)"`
ConsigneeLng int // 坐标 * 10的六次方
ConsigneeLat int // 坐标 * 10的六次方
CoordinateType int
SkuCount int // 商品类别数量即有多少种商品注意在某些情况下相同SKU的商品由于售价不同也会当成不同商品在这个值里
GoodsCount int // 商品个数
Status int // 参见相关常量定义
VendorStatus string `orm:"size(16)"`
LockStatus int
BuyerComment string `orm:"size(255)"`
ExpectedDeliveredTime time.Time `orm:"type(datetime)"` // 预期送达时间
CancelApplyReason string `orm:"size(255)"` // ""表示没有申请不为null表示用户正在取消申请
WaybillVendorID int `orm:"column(waybill_vendor_id)"`
WaybillStatus int
WaybillVendorStatus string `orm:"size(16)"`
DuplicatedCount int // 重复新定单消息数这个一般不是由于消息重发赞成的消息重发由OrderStatus过滤一般是业务逻辑赞成的
OrderCreatedAt time.Time `orm:"type(datetime);index"`
OrderFinishedAt time.Time `orm:"type(datetime)"`
ModelTimeInfo
OriginalData string `orm:"type(text)"`
Skus []*OrderSku `orm:"-"`
}
func (o *GoodsOrder) TableUnique() [][]string {
@@ -59,8 +62,10 @@ type OrderSku struct {
SkuName string `orm:"size(255)"`
ShopPrice int64
SalePrice int64
Weight int // 单位为克
OrderCreatedAt time.Time `orm:"type(datetime);index"`
Weight int // 单位为克
SkuType int
PromotionType int
OrderCreatedAt time.Time `orm:"type(datetime);index"` // 分区考虑
}
// 同样商品在一个定单中可能重复出现(比如搞活动时,相同商品价格不一样,第一个有优惠)
@@ -87,6 +92,7 @@ type Waybill struct {
WaybillCreatedAt time.Time `orm:"type(datetime);index"`
WaybillFinishedAt time.Time `orm:"type(datetime)"`
ModelTimeInfo
OriginalData string `orm:"type(text)"`
}
func (w *Waybill) TableUnique() [][]string {