From fd9611c32a00f356215c5f5ce696fbca49fff1fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 6 Mar 2020 16:13:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E7=94=9F=E6=88=90=E4=B8=80=E4=B8=AAst?= =?UTF-8?q?ore=5Fsku=5Fbind=E5=8E=86=E5=8F=B2=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 2 +- business/model/store_sku.go | 52 +++++++++++++++++++++++++++++++++++ globals/beegodb/beegodb.go | 1 + 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 2085b05e9..7b15f1dcc 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -2322,7 +2322,7 @@ func SyncStoresCourierInfo(ctx *jxcontext.Context, storeIDs []int, isAsync, isCo func SyncStoresQualify(ctx *jxcontext.Context, storeIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) { if len(storeIDs) > 0 { db := dao.GetDB() - task := tasksch.NewParallelTask(fmt.Sprintf("上传门店资质:%v", storeIDs), tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), ctx, + task := tasksch.NewParallelTask(fmt.Sprintf("上传门店资质:%v", storeIDs), tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError), ctx, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { vendorID := model.VendorIDJD if handler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IStoreSyncQualifyHandler); handler != nil { diff --git a/business/model/store_sku.go b/business/model/store_sku.go index 25895a27a..30feeeb27 100644 --- a/business/model/store_sku.go +++ b/business/model/store_sku.go @@ -134,6 +134,58 @@ func (*StoreSkuBind) TableIndex() [][]string { } } +type StoreSkuBindHistory struct { + ModelIDCULD + StoreSkuBindID int `orm:"column(store_sku_bind_id)"` + StoreID int `orm:"column(store_id)"` + SkuID int `orm:"column(sku_id)"` + SubStoreID int `orm:"column(sub_store_id)"` + Price int // 单位为分,不用int64的原因是这里不需要累加 + UnitPrice int // 这个是一斤的门店商品价,放在这里的原因是避免额外增加一张store sku_name表,逻辑上要保证同一SKU NAME中的所有SKU这个字段的数据一致 + Status int + + // ElmID int64 `orm:"column(elm_id);index"` + MtwmID int64 `orm:"column(mtwm_id);index"` + EbaiID int64 `orm:"column(ebai_id);index"` + // WscID int64 `orm:"column(wsc_id);index"` // 表示微盟skuId + // WscID2 int64 `orm:"column(wsc_id2);index"` // 表示微盟goodsId + + // ElmSyncStatus int8 `orm:"default(2)"` + JdSyncStatus int8 `orm:"default(2)"` + MtwmSyncStatus int8 `orm:"default(2)"` + EbaiSyncStatus int8 `orm:"default(2)"` + // WscSyncStatus int8 `orm:"default(2)"` + + JdPrice int `json:"jdPrice"` + MtwmPrice int `json:"mtwmPrice"` + EbaiPrice int `json:"ebaiPrice"` + JxPrice int `json:"jxPrice"` + + JdLockTime *time.Time `orm:"null" json:"jdLockTime"` + MtwmLockTime *time.Time `orm:"null" json:"mtwmLockTime"` + EbaiLockTime *time.Time `orm:"null" json:"ebaiLockTime"` + JxLockTime *time.Time `orm:"null" json:"jxLockTime"` + + AutoSaleAt time.Time `orm:"type(datetime);null" json:"autoSaleAt"` + + StatusSaleBegin int16 //商品可售时间范围 + StatusSaleEnd int16 + + SnapshotAt time.Time `orm:"type(datetime);null;index" json:"snapshotAt"` +} + +func (*StoreSkuBindHistory) TableUnique() [][]string { + return [][]string{ + []string{"StoreID", "SkuID", "DeletedAt"}, + } +} + +func (*StoreSkuBindHistory) TableIndex() [][]string { + return [][]string{ + []string{"SkuID", "StoreID", "DeletedAt"}, + } +} + type StoreOpRequest struct { ModelIDCULD // DeletedAt用于表示请求操作结束,而并不一定是删除 diff --git a/globals/beegodb/beegodb.go b/globals/beegodb/beegodb.go index df1146097..2ddd46103 100644 --- a/globals/beegodb/beegodb.go +++ b/globals/beegodb/beegodb.go @@ -31,6 +31,7 @@ func Init() { orm.RegisterModel(&model.Place{}) orm.RegisterModel(&model.Store{}, &model.StoreSub{}, &model.StoreMap{}, &model.StoreCourierMap{}) orm.RegisterModel(&model.SkuVendorCategory{}, &model.StoreSkuCategoryMap{}, &model.SkuName{}, &model.Sku{}, &model.SkuNamePlaceBind{}, &model.StoreSkuBind{}) + orm.RegisterModel(&model.StoreSkuBindHistory{}) orm.RegisterModel(&model.SkuCategory{}) orm.RegisterModel(&model.ThingMap{})