Esempio n. 1
0
        public void ResetTodayStatistic()
        {
            //遍历所有的钱包发送指令
            var wallets = _walletQueryService.ListPage().Where(x => x.YesterdayEarnings > 0 || x.TodayBenevolenceAdded > 0);

            if (wallets.Any())
            {
                foreach (var wallet in wallets)
                {
                    var command = new ResetTodayStatisticCommand
                    {
                        AggregateRootId = wallet.Id
                    };
                    _commandService.SendAsync(command);
                }
            }
        }
Esempio n. 2
0
        public void ResetTodayStatistic()
        {
            //遍历所有的店铺发送指令
            var offlintStores = _offlineStoreQueryService.StoreList().Where(x => x.TodaySale > 0);

            if (offlintStores.Any())
            {
                foreach (var offlintStore in offlintStores)
                {
                    var command = new ResetTodayStatisticCommand
                    {
                        AggregateRootId = offlintStore.Id
                    };
                    _commandService.SendAsync(command);
                }
            }
        }
Esempio n. 3
0
 public void Handle(ICommandContext context, ResetTodayStatisticCommand command)
 {
     context.Get <Store>(command.AggregateRootId).ResetTodayStatistic();
 }