diff --git a/src/CloudGaming/Code/CloudGaming.Code/AppExtend/AppRequestConfig.cs b/src/CloudGaming/Code/CloudGaming.Code/AppExtend/AppRequestConfig.cs index c86de6e..269b33e 100644 --- a/src/CloudGaming/Code/CloudGaming.Code/AppExtend/AppRequestConfig.cs +++ b/src/CloudGaming/Code/CloudGaming.Code/AppExtend/AppRequestConfig.cs @@ -28,6 +28,10 @@ namespace CloudGaming.Code.AppExtend _channel = "27001"; } channel = _channel; + if (string.IsNullOrEmpty(channel)) + { + channel = "27001"; + } } return channel; } diff --git a/src/CloudGaming/Code/CloudGaming.Code/Mall/OrderBLL.cs b/src/CloudGaming/Code/CloudGaming.Code/Mall/OrderBLL.cs index 911de5e..9e43527 100644 --- a/src/CloudGaming/Code/CloudGaming.Code/Mall/OrderBLL.cs +++ b/src/CloudGaming/Code/CloudGaming.Code/Mall/OrderBLL.cs @@ -65,7 +65,6 @@ public class OrderBLL : CloudGamingBase var ip = HttpContextAccessor.HttpContext.GetClientIpAddress(); var price = product.Price; var payment = PaymentExtend.GetPayment(paymentMethod, this); - //UserInfoBLL userInfo = new UserInfoBLL(Dao, _UserId); if (UserInfo.IsTest) { price = (decimal)0.01; @@ -73,6 +72,7 @@ public class OrderBLL : CloudGamingBase (var orderId, var order, var payNotifyUrl) = await payment.CreateOrder(product.Id, product.ProductName, price, product, ip); var t = product.ToIntentOrder(paymentMethod, orderId, AppRequestInfo.Channel); t.UserId = _UserId; + t.Channel = AppRequestInfo.Channel; if (payNotifyUrl != null && payNotifyUrl.Length > 200) { payNotifyUrl = payNotifyUrl.Substring(0, 200); @@ -86,7 +86,6 @@ public class OrderBLL : CloudGamingBase Payment = order }; RedisCache.KeyDelete(redisLock); - //HttpContextAccessor.HttpContext.Response.Headers.Add("PayNotifyUrl", payNotifyUrl); } catch (Exception ex) { diff --git a/src/CloudGaming/Code/CloudGaming.Code/Monitor/OrderMonitorProcessor.cs b/src/CloudGaming/Code/CloudGaming.Code/Monitor/OrderMonitorProcessor.cs index b5de582..0e48e94 100644 --- a/src/CloudGaming/Code/CloudGaming.Code/Monitor/OrderMonitorProcessor.cs +++ b/src/CloudGaming/Code/CloudGaming.Code/Monitor/OrderMonitorProcessor.cs @@ -72,7 +72,7 @@ public class OrderMonitorProcessor : AppJobBase } } -[QuartzTrigger("OrderHourMonitorProcessor", "0/5 * * * * ?")] +[QuartzTrigger("OrderHourMonitorProcessor", "0 5 * * * ?")] public class OrderHourMonitorProcessor : AppJobBase { public OrderHourMonitorProcessor(IServiceScopeFactory scopeFactory) : base(scopeFactory) @@ -82,7 +82,7 @@ public class OrderHourMonitorProcessor : AppJobBase public override async Task AppConfigProcessLoop(AppConfig appConfig, AppMonitorInfo appMonitorInfo, IServiceProvider serviceProvider, CloudGamingBase cloudGamingBase) { var dao = cloudGamingBase.Dao; - var now = DateTime.Now.AddHours(-0); + var now = DateTime.Now.AddHours(-1); int day = int.Parse(now.ToString("yyyyMMdd")); var newDayHour = now.Date.AddHours(now.Hour); var oldDayHour = now.Date.AddHours(now.AddHours(1).Hour); @@ -127,9 +127,15 @@ public class OrderHourMonitorProcessor : AppJobBase statisticsUser.PaidOrders = paidOrders; statisticsUser.UpdatedAt = DateTime.Now; } + var list = dao.DaoExt.Context.T_App_Channel.ToList(); + foreach (var item in list) + { + var key = item.ChannelId; + UpdateStatistics(key, intendedOrder.GetValueOrDefault(key, 0), paidOrders.GetValueOrDefault(key, 0), paidOrdersPrice.GetValueOrDefault(key, 0)); + } foreach (var item in intendedOrder) { - UpdateStatistics(item.Key, item.Value, paidOrders.GetValueOrDefault(item.Key, 0), paidOrdersPrice.GetValueOrDefault(item.Key, 0)); + } await dao.DaoExt.Context.SaveChangesAsync(); diff --git a/src/CloudGaming/Code/CloudGaming.Code/Payment/PaymentExtend.cs b/src/CloudGaming/Code/CloudGaming.Code/Payment/PaymentExtend.cs index aea2024..af19ada 100644 --- a/src/CloudGaming/Code/CloudGaming.Code/Payment/PaymentExtend.cs +++ b/src/CloudGaming/Code/CloudGaming.Code/Payment/PaymentExtend.cs @@ -163,10 +163,11 @@ public static class PaymentExtend /// /// /// + /// /// public static T_User_IntentOrder ToIntentOrder(this ProductCache productCache, string payment, string orderId, string channel) { - + T_User_IntentOrder t_User_IntentOrder = new T_User_IntentOrder() { Price = productCache.Price,