开通失败重新再开一次

This commit is contained in:
wanyongkang
2020-11-28 09:49:37 +08:00
parent fa5e4ceecb
commit 4dd87f29e2

View File

@@ -529,6 +529,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
var accountError = ""; var accountError = "";
await accountEntitys.ForEachAsync(async accountEntity => await accountEntitys.ForEachAsync(async accountEntity =>
{ {
var ret = new ApiResult(); var ret = new ApiResult();
if(accountEntity.PackageId.Value == 86 || accountEntity.PackageId.Value == 88){ if(accountEntity.PackageId.Value == 86 || accountEntity.PackageId.Value == 88){
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount,1,2); ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount,1,2);
@@ -538,10 +539,27 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
if (ret.Code != ResultCode.C_SUCCESS) if (ret.Code != ResultCode.C_SUCCESS)
{ {
accountEntity.ChargeStatus = AccountChargeStatus.Exception; var ret_exit = await m_AgentService.Exist(accountEntity.ProductId.ToInt(), accountEntity.Account);
accountEntity.Remark = ret.Message; await Task.Delay(50);
await m_ProductAccountService.Update(accountEntity); if (ret_exit != true){
accountError += $"{accountEntity.Account}{accountEntity.Remark},"; if(accountEntity.PackageId.Value == 86 || accountEntity.PackageId.Value == 88){
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount,1,2);
} else {
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount);
}
if (ret.Code != ResultCode.C_SUCCESS)
{
accountEntity.ChargeStatus = AccountChargeStatus.Exception;
accountEntity.Remark = ret.Message;
await m_ProductAccountService.Update(accountEntity);
accountError += $"{accountEntity.Account}{accountEntity.Remark},";
}
else if (ret.Data != null && ret.Data.ToString().Has())
{
accountEntity.Raw = ret.Data.ToString();
await m_ProductAccountService.Update(accountEntity);
}
}
} }
else if (ret.Data != null && ret.Data.ToString().Has()) else if (ret.Data != null && ret.Data.ToString().Has())
{ {
@@ -613,10 +631,22 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
} }
if (ret.Code != ResultCode.C_SUCCESS) if (ret.Code != ResultCode.C_SUCCESS)
{ {
accountEntity.ChargeStatus = AccountChargeStatus.Exception;
accountEntity.Remark = ret.Message; var accountInfo = await m_AgentService.GetOriginAccountInfo(accountEntity.ProductId.ToInt(), accountEntity.Account);
await m_ProductAccountService.Update(accountEntity); if(accountEntity.EndTime > accountInfo.Data.RealEndTime.AddMinutes(1)){
accountError += $"{accountEntity.Account}{accountEntity.Remark},"; if (order.PackageId == 86){
ret = await m_AgentService.ReNewAccount(order.Id, order.PackageId, account, order.ConnectCount,2);
} else {
ret = await m_AgentService.ReNewAccount(order.Id, order.PackageId, account, order.ConnectCount);
}
if (ret.Code != ResultCode.C_SUCCESS)
{
accountEntity.ChargeStatus = AccountChargeStatus.Exception;
accountEntity.Remark = ret.Message;
await m_ProductAccountService.Update(accountEntity);
accountError += $"{accountEntity.Account}{accountEntity.Remark},";
}
}
} }
}); });
if (accountError.Has()) if (accountError.Has())