From 05ca1aa22415833eb05459c983ecef35a01e7111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Thu, 14 Nov 2024 20:30:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=95=86=E5=93=81?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=B5=81=E6=8B=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Jobs/AutoPassInGoodsJob.cs | 5 +++++ .../Managers/MarketManager.cs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Application/Jobs/AutoPassInGoodsJob.cs b/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Application/Jobs/AutoPassInGoodsJob.cs index dd5ff925..aa54d1f0 100644 --- a/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Application/Jobs/AutoPassInGoodsJob.cs +++ b/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Application/Jobs/AutoPassInGoodsJob.cs @@ -20,6 +20,11 @@ public class AutoPassInGoodsJob: QuartzBackgroundWorkerBase //每小时,第10分钟执行一次 Trigger = TriggerBuilder.Create().WithIdentity(nameof(AutoPassInGoodsJob)) + // .WithSimpleSchedule((builer) => + // { + // builer.WithIntervalInHours(10); + // }) + // .StartNow() .WithCronSchedule("0 10 * * * ?") .Build(); } diff --git a/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Domain/Managers/MarketManager.cs b/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Domain/Managers/MarketManager.cs index 131861de..4db32ed3 100644 --- a/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Domain/Managers/MarketManager.cs +++ b/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Domain/Managers/MarketManager.cs @@ -41,13 +41,14 @@ public class MarketManager : DomainService //下架3天前的商品 var endTine = DateTime.Now.AddDays(-autoPassInGoodsDay); //获取所有需要下架商品 - var marketGoods = await _marketGoodsRepository._DbQueryable.Where(x => x.CreationTime >= endTine).ToListAsync(); + var marketGoods = await _marketGoodsRepository._DbQueryable.Where(x => x.CreationTime <= endTine).ToListAsync(); //单独处理每一个下架的商品 foreach (var goods in marketGoods) { //用户库存 var userStore = await _collectiblesUserStoreRepository._DbQueryable + .Where(x=>x.UserId==goods.SellUserId) .Where(x => x.CollectiblesId == goods.CollectiblesId) .Where(x => x.IsAtMarketing == true).FirstAsync(); if (userStore is not null)