第三方账号配置添加用户信息

dev
cjy 3 weeks ago
parent dbcfe60e63
commit d3350f94c0

@ -75,6 +75,16 @@ public class CodeThirdPartyReq
/// 联系邮箱
/// </summary>
public string RegistContractEmail { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public long UserId { get; set; }
/// <summary>
/// 用户姓名
/// </summary>
public string? UserName { get; set; }
}
/// <summary>

@ -77,4 +77,14 @@ public class CodeThirdPartyRes
/// 联系邮箱
/// </summary>
public string RegistContractEmail { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public long UserId { get; set; }
/// <summary>
/// 用户姓名
/// </summary>
public string? UserName { get; set; }
}

@ -44,7 +44,17 @@ public class CodeThirdParty : BaseModel<long>
[SugarColumn(ColumnDescription = "账户密钥", IsNullable = true, Length = 200)]
public string AppSecret { get; set; }
/// <summary>
/// 用户ID
/// </summary>
[SugarColumn(ColumnDescription = "用户ID", IsNullable = false)]
public long UserId { get; set; }
/// <summary>
/// 用户姓名
/// </summary>
[SugarColumn(ColumnDescription = "用户姓名", Length = 200, IsNullable = true)]
public string? UserName { get; set; }
/// <summary>
/// 状态 0启用 1禁用
/// </summary>

@ -45,14 +45,14 @@ namespace DS.WMS.Core.Code.Method
public DataResult EditCodeThirdParty(CodeThirdPartyReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
if (req.Id == 0)
{
if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == req.AccountType.Trim()&& x.CustomerId == req.CustomerId).Any())
if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == req.AccountType.Trim() && x.CustomerId == req.CustomerId && x.UserId == req.UserId && x.Id!=req.Id).Any())
{
return DataResult.Failed("第三方账号已存在!", MultiLanguageConst.CodeThirdPartyExist);
}
if (req.Id == 0)
{
var data = req.Adapt<CodeThirdParty>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
@ -91,7 +91,7 @@ namespace DS.WMS.Core.Code.Method
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = await tenantDb.Queryable<CodeThirdParty>()
.Where(a => a.AccountType == AccountType && a.IsCompany == false && a.CreateBy == long.Parse(user.UserId))
.Where(a => a.AccountType == AccountType && a.IsCompany == false && a.UserId == long.Parse(user.UserId))
.Select<CodeThirdPartyRes>()
.FirstAsync();

@ -112,9 +112,9 @@ namespace DS.WMS.Core.HangfireJob.Method
var uId = long.Parse(userId);
if (customerId == 0)
{
if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.CreateBy == uId).Any())
if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.UserId == uId).Any())
{
return tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.CreateBy == uId).First();
return tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.UserId == uId).First();
}
else
{
@ -123,13 +123,13 @@ namespace DS.WMS.Core.HangfireJob.Method
}
else
{
if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.CreateBy == uId && x.CustomerId == customerId).Any())
if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.UserId == uId && x.CustomerId == customerId).Any())
{
return tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.CreateBy == uId && x.CustomerId == customerId).First();
return tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.UserId == uId && x.CustomerId == customerId).First();
}
else if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.CreateBy == uId).Any())
else if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.UserId == uId).Any())
{
return tenantDb.Queryable<CodeThirdParty>().First(x => x.AccountType == type && x.CreateBy == uId);
return tenantDb.Queryable<CodeThirdParty>().First(x => x.AccountType == type && x.UserId == uId);
}
else
{

@ -476,9 +476,9 @@ namespace DS.WMS.Core.Op.Method
var uId = long.Parse(userId);
if (customerId == 0)
{
if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.CreateBy == uId).Any())
if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.UserId == uId).Any())
{
return tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.CreateBy == uId).First();
return tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.UserId == uId).First();
}
else
{
@ -487,13 +487,13 @@ namespace DS.WMS.Core.Op.Method
}
else
{
if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.CreateBy == uId && x.CustomerId == customerId).Any())
if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.UserId == uId && x.CustomerId == customerId).Any())
{
return tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.CreateBy == uId && x.CustomerId == customerId).First();
return tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.UserId == uId && x.CustomerId == customerId).First();
}
else if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.CreateBy == uId).Any())
else if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == type && x.UserId == uId).Any())
{
return tenantDb.Queryable<CodeThirdParty>().First(x => x.AccountType == type && x.CreateBy == uId);
return tenantDb.Queryable<CodeThirdParty>().First(x => x.AccountType == type && x.UserId == uId);
}
else
{

Loading…
Cancel
Save