This commit is contained in:
gazebo
2019-12-11 10:28:38 +08:00
parent a3e1521bb4
commit 73811a7bc6
2 changed files with 34 additions and 35 deletions

View File

@@ -268,10 +268,10 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, isFocus bool
} }
sql += ")" sql += ")"
} }
if params["jdID"] != nil { // if params["jdID"] != nil {
sql += " AND t1.jd_id = ?" // sql += " AND t1.jd_id = ?"
sqlParams = append(sqlParams, params["jdID"].(int)) // sqlParams = append(sqlParams, params["jdID"].(int))
} // }
if params["name"] != nil { if params["name"] != nil {
sql += " AND t1.name LIKE ?" sql += " AND t1.name LIKE ?"
sqlParams = append(sqlParams, "%"+params["name"].(string)+"%") sqlParams = append(sqlParams, "%"+params["name"].(string)+"%")
@@ -315,7 +315,6 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, isFocus bool
return "", nil, err return "", nil, err
} }
sql += " AND ( 1 = 0" sql += " AND ( 1 = 0"
// TODO
if params["jdSyncStatus"] != nil && realVendorMap[model.VendorIDJD] == 1 { if params["jdSyncStatus"] != nil && realVendorMap[model.VendorIDJD] == 1 {
sql += " OR (t4.jd_sync_status & ? <> 0 AND t2.jd_id <> 0 AND t1.status = ? AND t2.status = ?)" sql += " OR (t4.jd_sync_status & ? <> 0 AND t2.jd_id <> 0 AND t1.status = ? AND t2.status = ?)"
sqlParams = append(sqlParams, params["jdSyncStatus"], model.SkuStatusNormal, model.SkuStatusNormal) sqlParams = append(sqlParams, params["jdSyncStatus"], model.SkuStatusNormal, model.SkuStatusNormal)

View File

@@ -188,9 +188,6 @@ func (v *VendorSync) oldSyncReorderCategories(ctx *jxcontext.Context, db *dao.Da
func (v *VendorSync) SyncStore(ctx *jxcontext.Context, db *dao.DaoDB, vendorID, storeID int, isAsync bool, userName string) (hint string, err error) { func (v *VendorSync) SyncStore(ctx *jxcontext.Context, db *dao.DaoDB, vendorID, storeID int, isAsync bool, userName string) (hint string, err error) {
globals.SugarLogger.Debugf("SyncStore, storeID:%d", storeID) globals.SugarLogger.Debugf("SyncStore, storeID:%d", storeID)
if vendorID == model.VendorIDJX {
return "1", nil
}
var vendorIDs []int var vendorIDs []int
if vendorID != -1 { if vendorID != -1 {
vendorIDs = []int{ vendorIDs = []int{
@@ -200,6 +197,7 @@ func (v *VendorSync) SyncStore(ctx *jxcontext.Context, db *dao.DaoDB, vendorID,
hint, err = v.LoopStoresMap(ctx, db, fmt.Sprintf("同步门店信息:%d", storeID), isAsync, false, vendorIDs, []int{storeID}, func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (resultList interface{}, err error) { hint, err = v.LoopStoresMap(ctx, db, fmt.Sprintf("同步门店信息:%d", storeID), isAsync, false, vendorIDs, []int{storeID}, func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (resultList interface{}, err error) {
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo) loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
handler := v.GetStoreHandler(loopMapInfo.VendorID) handler := v.GetStoreHandler(loopMapInfo.VendorID)
if handler != nil {
if len(loopMapInfo.StoreMapList) > 1 { if len(loopMapInfo.StoreMapList) > 1 {
loopStoreTask := tasksch.NewParallelTask(fmt.Sprintf("处理平台%s", model.VendorChineseNames[loopMapInfo.VendorID]), nil, ctx, loopStoreTask := tasksch.NewParallelTask(fmt.Sprintf("处理平台%s", model.VendorChineseNames[loopMapInfo.VendorID]), nil, ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
@@ -228,7 +226,9 @@ func (v *VendorSync) SyncStore(ctx *jxcontext.Context, db *dao.DaoDB, vendorID,
resultList = []interface{}{1} resultList = []interface{}{1}
} }
} }
return resultList, partner.AddVendorInfo2Err(err, loopMapInfo.VendorID) err = partner.AddVendorInfo2Err(err, loopMapInfo.VendorID)
}
return resultList, err
}, true) }, true)
return hint, makeSyncError(err) return hint, makeSyncError(err)
} }