天天产品分类
This commit is contained in:
@@ -288,7 +288,7 @@ namespace Hncore.Pass.Vpn.Controllers
|
||||
{
|
||||
return Error("套餐不存在");
|
||||
}
|
||||
if (packageEntity.IsTest == 0)
|
||||
if (packageEntity.IsTest == 0&&packageEntity.Id!=1034&&packageEntity.Id!=1040)
|
||||
{
|
||||
return Error("非测试套餐");
|
||||
}
|
||||
@@ -312,8 +312,16 @@ namespace Hncore.Pass.Vpn.Controllers
|
||||
return Error("请点击前往实名认证");
|
||||
}
|
||||
|
||||
var account_type = 0;
|
||||
if (request.PackageId == 1034) {
|
||||
account_type = 2;
|
||||
} else if (request.PackageId == 1040){
|
||||
account_type = 3;
|
||||
} else if (request.PackageId == 89){
|
||||
account_type = 1;
|
||||
}
|
||||
|
||||
var ret= await m_agentService.NewAccount(0, request.PackageId, request.Account, request.Pwd, accountType: 0);
|
||||
var ret= await m_agentService.NewAccount(0, request.PackageId, request.Account, request.Pwd, accountType:account_type);
|
||||
|
||||
if (ret.Code == ResultCode.C_SUCCESS)
|
||||
{
|
||||
@@ -372,7 +380,7 @@ namespace Hncore.Pass.Vpn.Controllers
|
||||
{
|
||||
return Error("套餐不存在");
|
||||
}
|
||||
if (packageEntity.IsTest == 0)
|
||||
if (packageEntity.IsTest == 0&&packageEntity.Id!=1034&&packageEntity.Id!=1040)
|
||||
{
|
||||
return Error("非测试套餐");
|
||||
}
|
||||
@@ -397,7 +405,16 @@ namespace Hncore.Pass.Vpn.Controllers
|
||||
}
|
||||
|
||||
|
||||
var ret= await m_agentService.NewAccount(0, request.PackageId, request.Account, request.Pwd, accountType: 0);
|
||||
var account_type = 0;
|
||||
if (request.PackageId == 1034) {
|
||||
account_type = 2;
|
||||
} else if (request.PackageId == 1040){
|
||||
account_type = 3;
|
||||
} else if (request.PackageId == 89){
|
||||
account_type = 1;
|
||||
}
|
||||
|
||||
var ret= await m_agentService.NewAccount(0, request.PackageId, request.Account, request.Pwd, accountType:account_type);
|
||||
|
||||
if (ret.Code == ResultCode.C_SUCCESS)
|
||||
{
|
||||
|
||||
@@ -202,6 +202,7 @@ namespace Hncore.Pass.Vpn.Service
|
||||
{"max_conn",connCount.ToString() },
|
||||
{"paytype",package },
|
||||
{"paynum",buyCount },
|
||||
{"product_id",accountType.ToString() },
|
||||
{"mobile","13073735878" },
|
||||
{"mark","api" },
|
||||
};
|
||||
@@ -212,10 +213,6 @@ namespace Hncore.Pass.Vpn.Service
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["status"].ToString();
|
||||
Console.WriteLine("==============================tiantian==========================================================");
|
||||
Console.WriteLine(jo);
|
||||
Console.WriteLine(status);
|
||||
Console.WriteLine("========================================================================================");
|
||||
if (status =="200")
|
||||
{
|
||||
var retAccount=jo["data"].ToArray().FirstOrDefault();
|
||||
@@ -337,9 +334,6 @@ namespace Hncore.Pass.Vpn.Service
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["status"].ToString();
|
||||
|
||||
Console.WriteLine("====================================================");
|
||||
Console.WriteLine(jo);
|
||||
Console.WriteLine("====================================================");
|
||||
if (status == "200")
|
||||
{
|
||||
var data = jo["data"];
|
||||
|
||||
@@ -674,7 +674,13 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
} else if(accountEntity.ProductId.Value == 8 || accountEntity.ProductId.Value == 7){
|
||||
var account_remark = accountEntity.Account + "-" + user_remark;
|
||||
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, account_remark, accountEntity.Pwd, accountEntity.ConnectCount,1,2);
|
||||
} else {
|
||||
} else if (accountEntity.PackageId.Value > 1034 && accountEntity.PackageId.Value < 1040) {
|
||||
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount,2);
|
||||
}
|
||||
else if (accountEntity.PackageId.Value > 1040 && accountEntity.PackageId.Value < 1046) {
|
||||
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount,3);
|
||||
}
|
||||
else {
|
||||
ret = await m_AgentService.NewAccount(order.Id, accountEntity.PackageId.Value, accountEntity.Account, accountEntity.Pwd, accountEntity.ConnectCount);
|
||||
}
|
||||
|
||||
@@ -813,120 +819,9 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
await m_AgentUserService.Update(agentEntity);
|
||||
}
|
||||
|
||||
// userEntity.pay_time = DateTime.Now.ToString();
|
||||
// userEntity.ConsumeAmount += order.PaymentAmount;
|
||||
|
||||
// //折扣设置
|
||||
// var user_discount_id = userEntity.discount_id;
|
||||
// var new_discount_id = 0;
|
||||
// if (userEntity.ConsumeAmount>=200 && userEntity.ConsumeAmount<500){
|
||||
// new_discount_id = 1;
|
||||
// } else if(userEntity.ConsumeAmount>=500 && userEntity.ConsumeAmount<1500) {
|
||||
// new_discount_id = 2;
|
||||
// } else if(userEntity.ConsumeAmount>=1500 && userEntity.ConsumeAmount<3000) {
|
||||
// new_discount_id = 4;
|
||||
// } else if(userEntity.ConsumeAmount>=3000 && userEntity.ConsumeAmount<6000) {
|
||||
// new_discount_id = 5;
|
||||
// } else if(userEntity.ConsumeAmount>=6000) {
|
||||
// new_discount_id = 6;
|
||||
// }
|
||||
// //新折扣大于老折扣,且不为代理用户
|
||||
// if(new_discount_id>user_discount_id && userEntity.agent_id==0){
|
||||
// userEntity.discount_id = new_discount_id;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
//public async Task ProcessOrderAccountbak(ProductOrderEntity order)
|
||||
//{
|
||||
// if (order.OrderState != OrderStatus.PayOk) return;
|
||||
|
||||
// var isOk = true;
|
||||
|
||||
// var orderItems = await m_ProductOrderItemService.Query(m => m.OrderId == order.Id && m.OrderState == OrderStatus.PayOk).ToListAsync();
|
||||
// if (order.OrderType == OrderType.New || order.OrderType == OrderType.News)
|
||||
// {
|
||||
// await orderItems.ForEachAsync(async m =>
|
||||
// {
|
||||
// //todo 调用第三方开号接口
|
||||
// var ret = await m_AgentService.NewAccount(order.Id,m.PackageId, m.Account, m.AccountPwd);
|
||||
// if (ret.Code == ResultCode.C_SUCCESS)
|
||||
// {
|
||||
// var account = new ProductAccountEntity()
|
||||
// {
|
||||
// Account = m.Account,
|
||||
// AccountType = (int)order.OrderType,
|
||||
// ConnectCount = m.ConnectCount,
|
||||
// StartTime = DateTime.Now,
|
||||
// EndTime = DateTime.Now.AddDays(m.DayCount),
|
||||
// PackageId = m.PackageId,
|
||||
// PackageName = m.PackageName,
|
||||
// ProductId = m.ProductId,
|
||||
// ProductName = m.ProductName,
|
||||
// Pwd = m.AccountPwd,
|
||||
// Status = AccountChargeStatus.Normal,
|
||||
// UserId = order.UserId,
|
||||
// UserCode = order.UserName,
|
||||
// };
|
||||
// try
|
||||
// {
|
||||
// await m_ProductAccountService.Add(account);
|
||||
// m.OrderState = OrderStatus.Complete;
|
||||
// await m_ProductOrderItemService.Update(m);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// LogHelper.Error("处理订单明细", ex);
|
||||
// isOk = false;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// isOk = false;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// else if (order.OrderType == OrderType.AgainBuy || order.OrderType == OrderType.AgainBuys)
|
||||
// {
|
||||
// await orderItems.ForEachAsync(async m =>
|
||||
// {
|
||||
// //todo 调用第三方开号接口续费
|
||||
// var ret = await m_AgentService.ReNewAccount(m.PackageId, m.AccountPwd);
|
||||
// if (ret.Code == ResultCode.C_SUCCESS)
|
||||
// {
|
||||
// var account = await m_ProductAccountService.Query(p => p.Account == m.Account).FirstOrDefaultAsync();
|
||||
|
||||
// if (account.EndTime < DateTime.Now)
|
||||
// {
|
||||
// account.StartTime = DateTime.Now;
|
||||
// account.EndTime = DateTime.Now.AddDays(m.DayCount);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// account.EndTime = account.EndTime.Value.AddDays(m.DayCount);
|
||||
// }
|
||||
// account.PackageId = m.PackageId;
|
||||
// account.PackageName = m.PackageName;
|
||||
// account.ProductId = m.ProductId;
|
||||
// account.ProductName = m.ProductName;
|
||||
// account.AccountType = (int)order.OrderType;
|
||||
// await m_ProductAccountService.Update(account);
|
||||
// m.OrderState = OrderStatus.Complete;
|
||||
// await m_ProductOrderItemService.Update(m);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// isOk = false;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// if (isOk)
|
||||
// {
|
||||
// order.OrderState = OrderStatus.Complete;
|
||||
// await this.Update(order);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
public async Task<ApiResult> Refund(int userId, string account)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user