Exemple #1
0
        public void SetActiveRouteCache(DateTime carryoutDate)
        {
            int depotId = WorkManager.GetWorkerDepotId(GetCurrentUserWorkerIdAsync().Result);
            // 为激活任务设置缓存
            var query = _routeRepository.GetAllIncluding(x => x.Vehicle, x => x.AltVehicle, x => x.Workers)
                        .Where(x => x.CarryoutDate == carryoutDate && x.DepotId == depotId && _activeStatus.Contains(x.Status));
            var lst = ObjectMapper.Map <List <RouteCacheItem> >(query.ToList());

            if (lst.Count > 0)
            {
                _routeCache.Set(carryoutDate, depotId, lst);
            }
        }