Himall.Web/Areas/Web/Controllers/PayStateController.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using Himall.Core;
using Himall.IServices;
using Himall.Model;
using Himall.ServiceProvider;
using Himall.Web.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Mvc;
using System.Web.Mvc.Async;
namespace Himall.Web.Areas.Web.Controllers
{
public class PayStateController : BaseAsyncController
{
public PayStateController()
{
}
public void CheckAsync(string orderIds)
{
Func<string, long> func = null;
Func<OrderInfo, bool> orderStatus = null;
base.AsyncManager.OutstandingOperations.Increment();
int num1 = 200;
int num2 = 10000;
Task.Factory.StartNew(() => {
string str = CacheKeyCollection.PaymentState(string.Join(",", new string[] { orderIds }));
int num = 0;
while (true)
{
if (Cache.Get(str) == null)
{
string[] strArrays = orderIds.Split(new char[] { ',' });
if (func == null)
{
func = (string item) => long.Parse(item);
}
IEnumerable<long> nums = strArrays.Select<string, long>(func);
using (IOrderService create = Instance<IOrderService>.Create)
{
IEnumerable<OrderInfo> orders = create.GetOrders(nums);
if (orderStatus == null)
{
orderStatus = (OrderInfo item) => item.OrderStatus == OrderInfo.OrderOperateStatus.WaitPay;
}
Cache.Insert(str, !orders.Any(orderStatus), 15);
}
}
if ((bool)Cache.Get(str))
{
AsyncManager.Parameters["done"] = true;
break;
}
else if (num <= num2)
{
num = num + num1;
后面还有 61 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
