- CopyStoreSkus

This commit is contained in:
gazebo
2018-10-11 17:40:24 +08:00
parent 5ec12fbbf1
commit e1dd674d9b
7 changed files with 126 additions and 7 deletions

View File

@@ -180,8 +180,8 @@ func (p *PurchaseHandler) syncOneStoreSkus(db *dao.DaoDB, storeID int, skuIDs []
return err
}
func (p *PurchaseHandler) SyncStoreCategories(db *dao.DaoDB, storeIDs []int, userName string) (err error) {
globals.SugarLogger.Debugf("SyncStoreCategories storeIDs:%d, userName:%s", storeIDs, userName)
func (p *PurchaseHandler) SyncStoresCategories(db *dao.DaoDB, storeIDs []int, userName string) (err error) {
globals.SugarLogger.Debugf("SyncStoresCategories storeIDs:%d, userName:%s", storeIDs, userName)
for _, storeID := range storeIDs {
if err = p.SyncOneStoreCategories(db, storeID, userName); err != nil {

View File

@@ -8,7 +8,7 @@ import (
"git.rosy.net.cn/jx-callback/business/model/dao"
)
func TestSyncStoreSkus(t *testing.T) {
func TestSyncStoresSkus(t *testing.T) {
db := dao.GetDB()
err := new(PurchaseHandler).SyncStoresSkus(db, []int{100077}, []int{7}, false, "autotest")
if err != nil {

View File

@@ -5,7 +5,7 @@ import (
"git.rosy.net.cn/jx-callback/business/model/dao"
)
func (p *PurchaseHandler) SyncStoreCategories(db *dao.DaoDB, storeIDs []int, userName string) (err error) {
func (p *PurchaseHandler) SyncStoresCategories(db *dao.DaoDB, storeIDs []int, userName string) (err error) {
return nil
}
func (p *PurchaseHandler) ReadStoreCategories(storeID int) (cats []*model.SkuCategory, err error) {

View File

@@ -27,7 +27,7 @@ func (p *PurchaseHandler) SyncStoresSkus(db *dao.DaoDB, storeIDs []int, skuIDs [
if len(skuIDs) < MaxSkuBatchSize {
parallelCount = 10
}
task := tasksch.RunManagedTask("SyncStoreSkus", false, nil, parallelCount, 1, userName, func(batchItemList []interface{}, params ...interface{}) (interface{}, error) {
task := tasksch.RunManagedTask("SyncStoresSkus", false, nil, parallelCount, 1, userName, func(batchItemList []interface{}, params ...interface{}) (interface{}, error) {
storeID := batchItemList[0].(int)
sqlParams := []interface{}{
utils.DefaultTimeValue,