开通失败重新再开一次

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);
@@ -536,6 +537,16 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount); ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount);
} }
if (ret.Code != ResultCode.C_SUCCESS)
{
var ret_exit = await m_AgentService.Exist(accountEntity.ProductId.ToInt(), accountEntity.Account);
await Task.Delay(50);
if (ret_exit != true){
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) if (ret.Code != ResultCode.C_SUCCESS)
{ {
accountEntity.ChargeStatus = AccountChargeStatus.Exception; accountEntity.ChargeStatus = AccountChargeStatus.Exception;
@@ -548,6 +559,13 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
accountEntity.Raw = ret.Data.ToString(); accountEntity.Raw = ret.Data.ToString();
await m_ProductAccountService.Update(accountEntity); await m_ProductAccountService.Update(accountEntity);
} }
}
}
else if (ret.Data != null && ret.Data.ToString().Has())
{
accountEntity.Raw = ret.Data.ToString();
await m_ProductAccountService.Update(accountEntity);
}
}); });
if (accountError.Has()) if (accountError.Has())
{ {
@@ -606,6 +624,16 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
var account = accountEntity.Account; var account = accountEntity.Account;
if (product.GroupNO == "g7") account = accountEntity.Raw; if (product.GroupNO == "g7") account = accountEntity.Raw;
var ret = new ApiResult(); var ret = new ApiResult();
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)
{
var accountInfo = await m_AgentService.GetOriginAccountInfo(accountEntity.ProductId.ToInt(), accountEntity.Account);
if(accountEntity.EndTime > accountInfo.Data.RealEndTime.AddMinutes(1)){
if (order.PackageId == 86){ if (order.PackageId == 86){
ret = await m_AgentService.ReNewAccount(order.Id, order.PackageId, account, order.ConnectCount,2); ret = await m_AgentService.ReNewAccount(order.Id, order.PackageId, account, order.ConnectCount,2);
} else { } else {
@@ -618,6 +646,8 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
await m_ProductAccountService.Update(accountEntity); await m_ProductAccountService.Update(accountEntity);
accountError += $"{accountEntity.Account}{accountEntity.Remark},"; accountError += $"{accountEntity.Account}{accountEntity.Remark},";
} }
}
}
}); });
if (accountError.Has()) if (accountError.Has())
{ {