- 将OpenRemoteStoreByJxStatus加入每日调度

This commit is contained in:
gazebo
2019-07-19 14:46:07 +08:00
parent 7f94f15dca
commit f92ff23a56
2 changed files with 7 additions and 3 deletions

View File

@@ -1593,7 +1593,7 @@ func sendStoreStatusInfo2Mobile(mobile, title, txtAlarm string) {
} }
} }
func SaveAndSendAlarmVendorSnapshot(ctx *jxcontext.Context, vendorIDs, storeIDs []int) (err error) { func SaveAndSendAlarmVendorSnapshot(ctx *jxcontext.Context, vendorIDs, storeIDs []int, isAsync bool) (err error) {
curSnapshotAt := getCurrentSnapshotAt(time.Now()) curSnapshotAt := getCurrentSnapshotAt(time.Now())
db := dao.GetDB() db := dao.GetDB()
var curSnapshotList, prevSnapshotList []*model.VendorStoreSnapshot var curSnapshotList, prevSnapshotList []*model.VendorStoreSnapshot
@@ -1617,6 +1617,8 @@ func SaveAndSendAlarmVendorSnapshot(ctx *jxcontext.Context, vendorIDs, storeIDs
return nil, err return nil, err
}, 4) }, 4)
tasksch.ManageTask(task).Run() tasksch.ManageTask(task).Run()
_, err = task.GetResult(0) if !isAsync {
_, err = task.GetResult(0)
}
return err return err
} }

View File

@@ -37,7 +37,9 @@ func OpenRemoteStoreByJxStatus(ctx *jxcontext.Context, vendorIDs, storeIDs []int
storeDetail, err := dao.GetStoreDetail(db, storeMap.StoreID, storeMap.VendorID) storeDetail, err := dao.GetStoreDetail(db, storeMap.StoreID, storeMap.VendorID)
if err == nil && storeDetail.Status == model.StoreStatusOpened { if err == nil && storeDetail.Status == model.StoreStatusOpened {
if err = handler.UpdateStoreStatus(ctx, storeMap.StoreID, storeMap.VendorStoreID, model.StoreStatusOpened); err == nil { if err = handler.UpdateStoreStatus(ctx, storeMap.StoreID, storeMap.VendorStoreID, model.StoreStatusOpened); err == nil {
retVal = []int{0} storeMap.Status = model.StoreStatusOpened
dao.UpdateEntity(db, storeMap, model.FieldStatus)
retVal = []int{1}
} }
} }
} }