1
This commit is contained in:
@@ -1145,7 +1145,7 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
|||||||
}, model.FieldSyncStatus, syncStatus)
|
}, model.FieldSyncStatus, syncStatus)
|
||||||
if err = err2; err == nil {
|
if err = err2; err == nil {
|
||||||
dao.Commit(db, txDB)
|
dao.Commit(db, txDB)
|
||||||
_, err = CurVendorSync.SyncStore(ctx, db, -1, store.ID, false, userName)
|
//_, err = CurVendorSync.SyncStore(ctx, db, -1, store.ID, false, userName)
|
||||||
if valid["tel1"] != nil || valid["tel2"] != nil {
|
if valid["tel1"] != nil || valid["tel2"] != nil {
|
||||||
TryAddStoreBossRole4StoreByMobile(ctx, store.ID, []string{utils.Interface2String(valid["tel1"]), utils.Interface2String(valid["tel2"])})
|
TryAddStoreBossRole4StoreByMobile(ctx, store.ID, []string{utils.Interface2String(valid["tel1"]), utils.Interface2String(valid["tel2"])})
|
||||||
}
|
}
|
||||||
@@ -1170,9 +1170,7 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
|||||||
} else {
|
} else {
|
||||||
globals.SugarLogger.Debugf("UpdateStore track:%s, store:%s", ctx.GetTrackInfo(), utils.Format4Output(store, true))
|
globals.SugarLogger.Debugf("UpdateStore track:%s, store:%s", ctx.GetTrackInfo(), utils.Format4Output(store, true))
|
||||||
}
|
}
|
||||||
if status == -2 {
|
|
||||||
|
|
||||||
}
|
|
||||||
return num, err
|
return num, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ func UpdateEntityByKV(db *DaoDB, item interface{}, kvs map[string]interface{}, c
|
|||||||
if db == nil {
|
if db == nil {
|
||||||
db = GetDB()
|
db = GetDB()
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("item==============%s", utils.Format4Output(item, false))
|
|
||||||
qs := db.Db.QueryTable(item)
|
qs := db.Db.QueryTable(item)
|
||||||
if conditions == nil {
|
if conditions == nil {
|
||||||
qs = qs.Filter(model.FieldID, refutil.GetObjFieldByName(item, model.FieldID))
|
qs = qs.Filter(model.FieldID, refutil.GetObjFieldByName(item, model.FieldID))
|
||||||
@@ -55,8 +54,6 @@ func UpdateEntityByKV(db *DaoDB, item interface{}, kvs map[string]interface{}, c
|
|||||||
qs = qs.Filter(k, v)
|
qs = qs.Filter(k, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("==========kvs := %s", utils.Format4Output(kvs, false))
|
|
||||||
globals.SugarLogger.Debugf("==========kvsv := %v", utils.Format4Output(refutil.GetObjFieldByName(item, model.FieldID), false))
|
|
||||||
num, err = qs.Update(kvs)
|
num, err = qs.Update(kvs)
|
||||||
if err != nil && !IsDuplicateError(err) {
|
if err != nil && !IsDuplicateError(err) {
|
||||||
globals.SugarLogger.Errorf("UpdateEntityByKV %s failed with error:%v", reflect.TypeOf(item).Name(), err)
|
globals.SugarLogger.Errorf("UpdateEntityByKV %s failed with error:%v", reflect.TypeOf(item).Name(), err)
|
||||||
@@ -135,7 +132,6 @@ func UpdateEntityLogicallyAndUpdateSyncStatus(db *DaoDB, item interface{}, kvs m
|
|||||||
rows := valueRows.Interface()
|
rows := valueRows.Interface()
|
||||||
if err = GetEntitiesByKV(db, rows, conditions, false); err == nil {
|
if err = GetEntitiesByKV(db, rows, conditions, false); err == nil {
|
||||||
valueRows = reflect.Indirect(valueRows)
|
valueRows = reflect.Indirect(valueRows)
|
||||||
globals.SugarLogger.Debugf("valueRows =========== := %s", utils.Format4Output(valueRows, false))
|
|
||||||
for i := 0; i < valueRows.Len(); i++ {
|
for i := 0; i < valueRows.Len(); i++ {
|
||||||
value := reflect.Indirect(valueRows.Index(i))
|
value := reflect.Indirect(valueRows.Index(i))
|
||||||
status := value.FieldByName(syncStatusFieldName).Int() | int64(valueMask)
|
status := value.FieldByName(syncStatusFieldName).Int() | int64(valueMask)
|
||||||
|
|||||||
Reference in New Issue
Block a user