From 6e9ec1c080f1a2d8ea3f2e923acd807487ada271 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期五, 21 十一月 2025 16:40:02 +0800
Subject: [PATCH] feat:开发

---
 ApiTools.Core/Jobs/RefreshChannelWalletSignStatusJob.cs |   45 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/ApiTools.Core/Jobs/RefreshChannelWalletSignStatusJob.cs b/ApiTools.Core/Jobs/RefreshChannelWalletSignStatusJob.cs
new file mode 100644
index 0000000..285f3cd
--- /dev/null
+++ b/ApiTools.Core/Jobs/RefreshChannelWalletSignStatusJob.cs
@@ -0,0 +1,45 @@
+锘縰sing Furion;
+using Furion.Schedule;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace ApiTools.Core.Jobs
+{
+    /// <summary>
+    /// 鍒锋柊娓犻亾閽卞寘鐘舵��
+    /// </summary>
+    [JobDetail("RefreshChannelWalletSignStatusJob", Description = "鍒锋柊娓犻亾閽卞寘鐘舵��", Concurrent = false)]
+    [PeriodMinutes(5)]
+    public class RefreshChannelWalletSignStatusJob(
+            ChannelWalletRepository channelWalletRepository,
+            ChannelWalletService channelWalletService
+        ) : IJob
+    {
+        private readonly ChannelWalletRepository channelWalletRepository = channelWalletRepository;
+        private readonly ChannelWalletService channelWalletService = channelWalletService;
+
+        public async Task ExecuteAsync(JobExecutingContext context, CancellationToken stoppingToken)
+        {
+            var env = App.GetConfig<string>("Environment");
+            if (env != "Local")
+            {
+                var wallets = await channelWalletRepository.GetQueryable()
+                .Where(it =>
+                    it.Identity != null
+                    && it.Identity != ""
+                    && it.SignStatus < EnumWalletSignStatus.Normal)
+                .ToListAsync();
+                foreach (var wallet in wallets)
+                {
+                    await channelWalletService.GetEnterpriseWalletBalance(wallet);
+                }
+                await channelWalletRepository.UpdateNowAsync(wallets);
+            }
+        }
+    }
+}

--
Gitblit v1.9.1