sync
This commit is contained in:
@@ -1777,6 +1777,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
|
||||
if isStoreMapNeedSync(vendorID, valid) {
|
||||
globals.SugarLogger.Debugf("1.isStoreMapNeedSync(vendorID, valid)=================%v", isStoreMapNeedSync(vendorID, valid))
|
||||
_, err = CurVendorSync.SyncStore(ctx, db, vendorID, storeID, false, userName)
|
||||
globals.SugarLogger.Debug("CurVendorSync.SyncStore:err======%v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,6 +231,7 @@ func (v *VendorSync) SyncReorderCategories(ctx *jxcontext.Context, db *dao.DaoDB
|
||||
// }
|
||||
|
||||
func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs, storeIDs []int, mustDirty, isAsync bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debug("进入SyncStore2了")
|
||||
userName := ctx.GetUserName()
|
||||
isManageIt := len(storeIDs) == 0 || len(storeIDs) > 5
|
||||
_, hint, err = v.LoopStoresMap2(ctx, nil, db, fmt.Sprintf("同步门店信息:%v", storeIDs), isAsync, isManageIt, vendorIDs, storeIDs, mustDirty, func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (resultList interface{}, err error) {
|
||||
@@ -273,10 +274,12 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
}
|
||||
if err == nil {
|
||||
if model.IsSyncStatusNew(storeMap.SyncStatus) {
|
||||
globals.SugarLogger.Debug("进入 model.IsSyncStatusNew(storeMap.SyncStatus)")
|
||||
storeMap.VendorStoreID = vendorStoreID
|
||||
storeMap.SyncStatus = 0
|
||||
_, err = dao.UpdateEntity(db, storeMap, "VendorStoreID", model.FieldSyncStatus)
|
||||
} else {
|
||||
globals.SugarLogger.Debug("进入 model.IsSyncStatusNew(storeMap.SyncStatus) else")
|
||||
storeMap.SyncStatus = 0
|
||||
_, err = dao.UpdateEntity(db, storeMap, model.FieldSyncStatus)
|
||||
}
|
||||
@@ -316,6 +319,7 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
if err == nil {
|
||||
resultList = []interface{}{1}
|
||||
if model.IsSyncStatusNew(storeMap.SyncStatus) {
|
||||
globals.SugarLogger.Debug("sahsh进入model.IsSyncStatusNew(storeMap.SyncStatus)")
|
||||
storeMap.VendorStoreID = vendorStoreID
|
||||
storeMap.SyncStatus = 0
|
||||
_, err = dao.UpdateEntity(db, storeMap, "VendorStoreID", model.FieldSyncStatus)
|
||||
|
||||
Reference in New Issue
Block a user