From a1a0d7d68580ba8d2fe7400068e2d723a82b1a37 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 3 Jul 2019 18:26:44 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BA=AC=E8=A5=BF=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=94=B9=E4=B8=BA=E5=BC=80=E5=BA=97=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=BC=BA=E5=88=B6=E5=B0=86=E6=89=80=E6=9C=89=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E9=97=A8=E5=BA=97=E6=89=93=E5=BC=80=20-=20=E4=BB=8E?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=88=B7=E6=96=B0=E5=B9=B3=E5=8F=B0=E9=97=A8?= =?UTF-8?q?=E5=BA=97=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 34bb5d2d3..e9c964594 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -591,7 +591,13 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa if num, err = dao.UpdateEntityLogically(db, store, valid, userName, nil); err == nil && num == 1 { if isUpdateStoreNeedSync(valid) { dummy := &model.StoreMap{} - _, err2 := dao.UpdateEntityLogicallyAndUpdateSyncStatus(db, dummy, nil, userName, map[string]interface{}{ + kv := make(map[string]interface{}) + if valid["status"] != nil { + if status := int(utils.Interface2Int64WithDefault(valid["status"], 0)); status == model.StoreStatusOpened { + kv[model.FieldStatus] = status + } + } + _, err2 := dao.UpdateEntityLogicallyAndUpdateSyncStatus(db, dummy, kv, userName, map[string]interface{}{ model.FieldStoreID: store.ID, }, model.FieldSyncStatus, syncStatus) if err = err2; err == nil { @@ -1500,7 +1506,7 @@ func SaveAndSendAlarmVendorSnapshot(ctx *jxcontext.Context, vendorIDs, storeIDs if len(curSnapshotList) == 0 { task.Cancel() } else { - // updateVendorStoreStatusBySnapshot(db, curSnapshotList) + updateVendorStoreStatusBySnapshot(db, curSnapshotList) } case 1: err = SaveStoresVendorSnapshot(db, curSnapshotAt, curSnapshotList)