- change misc.Init to StartRefreshEbaiRealMobile and make it async to minimize startup time
206 lines
7.1 KiB
Go
206 lines
7.1 KiB
Go
package model
|
||
|
||
const (
|
||
StoreStatusDisabled = -1
|
||
StoreStatusClosed = 0
|
||
StoreStatusOpened = 1
|
||
)
|
||
|
||
const (
|
||
MainSubStoreName = "本店"
|
||
MainSubStoreAddress = "本店"
|
||
)
|
||
|
||
// 配送范围类型,此定义与京东到家相同,除非特殊说明,本系统中的坐标都是火星坐标
|
||
const (
|
||
DeliveryRangeTypePolygon = 2
|
||
DeliveryRangeTypeRadius = 3
|
||
)
|
||
|
||
const (
|
||
StoreDeliveryTypeCrowdSourcing = 0 //缺省,平台众包配送,可转自送
|
||
StoreDeliveryTypeByPlatform = 1 //平台专送
|
||
StoreDeliveryTypeByStore = 2 //完全门店自送
|
||
)
|
||
|
||
const (
|
||
StoreChangePriceTypeDirect = 0
|
||
StoreChangePriceTypeNeedApprove = 1
|
||
)
|
||
|
||
var (
|
||
StoreStatusName = map[int]string{
|
||
StoreStatusDisabled: "禁用",
|
||
StoreStatusClosed: "休息",
|
||
StoreStatusOpened: "营业中",
|
||
}
|
||
DeliveryRangeTypeName = map[int]string{
|
||
DeliveryRangeTypePolygon: "多边形",
|
||
DeliveryRangeTypeRadius: "圆",
|
||
}
|
||
DeliveryTypeName = map[int]string{
|
||
StoreDeliveryTypeCrowdSourcing: "平台众包",
|
||
StoreDeliveryTypeByPlatform: "平台专送",
|
||
StoreDeliveryTypeByStore: "门店自送",
|
||
}
|
||
BankName = map[string]string{
|
||
"ICB": "工商银行",
|
||
"CCB": "建设银行",
|
||
"ABC": "农业银行",
|
||
"BOC": "中国银行",
|
||
"PSBC": "邮储银行",
|
||
"CITIC": "中信银行",
|
||
"CEB": "光大银行",
|
||
"HXB": "华夏银行",
|
||
"CMBC": "民生银行",
|
||
"CMB": "招商银行",
|
||
"SHB": "上海银行",
|
||
"BJB": "北京银行",
|
||
"BEA": "东亚银行",
|
||
"CIB": "兴业银行",
|
||
"NBB": "宁波银行",
|
||
"SPDB": "浦发银行",
|
||
"GDB": "广发银行",
|
||
"SPAB": "平安银行",
|
||
"BSB": "包商银行",
|
||
"CSCB": "长沙银行",
|
||
"CDB": "承德银行",
|
||
"CDRCB": "成都农商银行",
|
||
"CRCB": "重庆农村商业银行",
|
||
"CQB": "重庆银行",
|
||
"DLB": "大连银行",
|
||
"DYCCB": "东营市商业银行",
|
||
"ORBANK": "鄂尔多斯银行",
|
||
"FJNXB": "福建省农村信用社",
|
||
"GYB": "贵阳银行",
|
||
"GCB": "广州银行",
|
||
"GRCB": "广州农村商业银行",
|
||
"HEBB": "哈尔滨银行",
|
||
"HNNXB": "湖南省农村信用社",
|
||
"HSB": "徽商银行",
|
||
"BHB": "河北银行",
|
||
"HZCB": "杭州银行",
|
||
"BOJZ": "锦州银行",
|
||
"CSRCB": "江苏常熟农村商业银行",
|
||
"JSB": "江苏银行",
|
||
"JRCB": "江阴农村商业银行",
|
||
"JJCCB": "九江银行",
|
||
"LZB": "兰州银行",
|
||
"DAQINGB": "龙江银行",
|
||
"QHB": "青海银行",
|
||
"SHRCB": "上海农商银行",
|
||
"SRB": "上饶银行",
|
||
"SDEB": "顺德农村商业银行",
|
||
"TZCB": "台州银行",
|
||
"WHSHB": "威海市商业银行",
|
||
"WFCCB": "潍坊银行",
|
||
"WZCB": "温州银行",
|
||
"URMQCCB": "乌鲁木齐商业银行",
|
||
"WRCB": "无锡农村商业银行",
|
||
"YCCB": "宜昌市商业银行",
|
||
"YZB": "鄞州银行",
|
||
"CZCB": "浙江稠州商业银行",
|
||
"ZJTLCB": "浙江泰隆商业银行",
|
||
"MTBANK": "浙江民泰商业银行",
|
||
"NJCB": "南京银行",
|
||
"NCB": "南昌银行",
|
||
"QLBANK": "齐鲁银行",
|
||
"YDRCB": "尧都农村商业银行",
|
||
}
|
||
)
|
||
|
||
type Store struct {
|
||
ModelIDCULD
|
||
|
||
Name string `orm:"size(255)" json:"name"`
|
||
CityCode int `orm:"default(0);null" json:"cityCode"` // todo ?
|
||
DistrictCode int `orm:"default(0);null" json:"districtCode"` // todo ?
|
||
Address string `orm:"size(255)" json:"address"`
|
||
Tel1 string `orm:"size(32);index" json:"tel1"`
|
||
Tel2 string `orm:"size(32);index" json:"tel2"`
|
||
OpenTime1 int16 `json:"openTime1"` // 930就表示9点半,用两个的原因是为了支持中午休息,1与2的时间段不能交叉,为0表示没有
|
||
CloseTime1 int16 `json:"closeTime1"` // 格式同上
|
||
OpenTime2 int16 `json:"openTime2"` // 格式同上
|
||
CloseTime2 int16 `json:"closeTime2"` // 格式同上
|
||
Lng int `json:"-"` // 乘了10的6次方
|
||
Lat int `json:"-"` // 乘了10的6次方
|
||
DeliveryRangeType int8 `json:"deliveryRangeType"` // 参见相关常量定义
|
||
DeliveryRange string `orm:"type(text)" json:"deliveryRange"` // 如果DeliveryRangeType为DeliveryRangeTypePolygon,则为逗号分隔坐标,分号分隔的坐标点(坐标与Lng和Lat一样,都是整数),比如 121361504,31189308;121420555,31150238。否则为半径,单位为米
|
||
Status int `json:"status"`
|
||
ChangePriceType int8 `json:"changePriceType"`
|
||
|
||
IDCardFront string `orm:"size(255);column(id_card_front)" json:"idCardFront"`
|
||
IDCardBack string `orm:"size(255);column(id_card_back)" json:"idCardBack"`
|
||
IDCardHand string `orm:"size(255);column(id_card_hand)" json:"idCardHand"`
|
||
Licence string `orm:"size(255)" json:"licence"`
|
||
LicenceCode string `orm:"size(32)" json:"licenceCode"`
|
||
|
||
DeliveryType int8 `orm:"-" json:"deliveryType"` // 仅用于传值
|
||
}
|
||
|
||
func (*Store) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"Name", "DeletedAt"},
|
||
}
|
||
}
|
||
|
||
type StoreSub struct {
|
||
ModelIDCULD
|
||
|
||
StoreID int `orm:"column(store_id)"`
|
||
Index int // 子店序号,为0表示主店
|
||
Name string `orm:"size(255);index"`
|
||
Address string `orm:"size(255)"`
|
||
Status int // 取值同Store.Status
|
||
Mobile1 string `orm:"size(32)"`
|
||
Mobile2 string `orm:"size(32)"`
|
||
Mobile3 string `orm:"size(32)"`
|
||
}
|
||
|
||
func (*StoreSub) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"StoreID", "Index", "DeletedAt"},
|
||
}
|
||
}
|
||
|
||
type StoreMap struct {
|
||
ModelIDCULD
|
||
|
||
StoreID int `orm:"column(store_id)" json:"storeID"`
|
||
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
||
VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"`
|
||
Status int `json:"status"` // 取值同Store.Status
|
||
|
||
PricePercentage int16 `orm:"default(100)" json:"pricePercentage"` // todo 厂商价格相对于本地价格的百分比,这个字段的修改会比较特殊,因为可能需要刷新厂商价格
|
||
AutoPickup int8 `orm:"default(1)" json:"autoPickup"` // 是否自动拣货
|
||
DeliveryType int8 `orm:"default(0)" json:"deliveryType"` // 配送类型
|
||
DeliveryFee int `json:"deliveryFee"`
|
||
DeliveryCompetition int8 `orm:"default(1)" json:"deliveryCompetition"` // 是否支持配送竞争
|
||
|
||
SyncStatus int8 `orm:"default(2)" json:"syncStatus"`
|
||
IsSync int8 `orm:"default(1)" json:"isSync"` // 是否同步
|
||
}
|
||
|
||
func (*StoreMap) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"StoreID", "VendorID", "DeletedAt"},
|
||
[]string{"VendorStoreID", "VendorID", "DeletedAt"},
|
||
}
|
||
}
|
||
|
||
type StoreCourierMap struct {
|
||
ModelIDCULD
|
||
|
||
StoreID int `orm:"column(store_id)" json:"storeID"`
|
||
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
||
VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"`
|
||
Status int `json:"status"`
|
||
}
|
||
|
||
func (*StoreCourierMap) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"StoreID", "VendorID", "DeletedAt"},
|
||
[]string{"VendorStoreID", "VendorID", "DeletedAt"},
|
||
}
|
||
}
|