😎调整根据ID获取单条数据查询模式
This commit is contained in:
parent
e034028bc7
commit
9da7412017
@ -80,7 +80,7 @@ public class AppAuthService : IDynamicApiController, ITransient
|
|||||||
throw Oops.Oh(ErrorCodeEnum.D1017);
|
throw Oops.Oh(ErrorCodeEnum.D1017);
|
||||||
|
|
||||||
// 租户是否被禁用
|
// 租户是否被禁用
|
||||||
var tenant = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysTenant>>().GetFirstAsync(u => u.Id == user.TenantId);
|
var tenant = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysTenant>>().GetByIdAsync(user.TenantId);
|
||||||
if (tenant != null && tenant.Status == StatusEnum.Disable)
|
if (tenant != null && tenant.Status == StatusEnum.Disable)
|
||||||
throw Oops.Oh(ErrorCodeEnum.Z1003);
|
throw Oops.Oh(ErrorCodeEnum.Z1003);
|
||||||
|
|
||||||
@ -206,11 +206,11 @@ public class AppAuthService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取登录账号")]
|
[DisplayName("获取登录账号")]
|
||||||
public virtual async Task<LoginUserOutput> GetUserInfo()
|
public virtual async Task<LoginUserOutput> GetUserInfo()
|
||||||
{
|
{
|
||||||
var user = await _sysUserRep.GetFirstAsync(u => u.Id == _appUserManager.UserId) ?? throw Oops.Oh(ErrorCodeEnum.D1011).StatusCode(401);
|
var user = await _sysUserRep.GetByIdAsync(_appUserManager.UserId) ?? throw Oops.Oh(ErrorCodeEnum.D1011).StatusCode(401);
|
||||||
// 机构
|
// 机构
|
||||||
var org = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysOrg>>().GetFirstAsync(u => u.Id == user.OrgId);
|
var org = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysOrg>>().GetByIdAsync(user.OrgId);
|
||||||
// 职位
|
// 职位
|
||||||
var pos = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysPos>>().GetFirstAsync(u => u.Id == user.PosId);
|
var pos = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysPos>>().GetByIdAsync(user.PosId);
|
||||||
// 角色集合
|
// 角色集合
|
||||||
var roleIds = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysUserRole>>().AsQueryable().Where(u => u.UserId == user.Id).Select(u => u.RoleId).ToListAsync();
|
var roleIds = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysUserRole>>().AsQueryable().Where(u => u.UserId == user.Id).Select(u => u.RoleId).ToListAsync();
|
||||||
// 接口集合
|
// 接口集合
|
||||||
@ -287,7 +287,7 @@ public class AppAuthService : IDynamicApiController, ITransient
|
|||||||
input.PasswordOld = CryptogramUtil.SM2Decrypt(input.PasswordOld);
|
input.PasswordOld = CryptogramUtil.SM2Decrypt(input.PasswordOld);
|
||||||
input.PasswordNew = CryptogramUtil.SM2Decrypt(input.PasswordNew);
|
input.PasswordNew = CryptogramUtil.SM2Decrypt(input.PasswordNew);
|
||||||
|
|
||||||
var user = await _sysUserRep.GetFirstAsync(u => u.Id == _appUserManager.UserId) ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
var user = await _sysUserRep.GetByIdAsync(_appUserManager.UserId) ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
||||||
if (CryptogramUtil.CryptoType == CryptogramEnum.MD5.ToString())
|
if (CryptogramUtil.CryptoType == CryptogramEnum.MD5.ToString())
|
||||||
{
|
{
|
||||||
if (user.Password != MD5Encryption.Encrypt(input.PasswordOld))
|
if (user.Password != MD5Encryption.Encrypt(input.PasswordOld))
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
<PackageReference Include="AngleSharp" Version="1.1.2" />
|
<PackageReference Include="AngleSharp" Version="1.1.2" />
|
||||||
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
|
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
|
||||||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||||
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.15.4" />
|
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.15.5" />
|
||||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.5" />
|
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.5" />
|
||||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.5" />
|
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.5" />
|
||||||
<PackageReference Include="Furion.Pure" Version="4.9.5.5" />
|
<PackageReference Include="Furion.Pure" Version="4.9.5.5" />
|
||||||
|
|||||||
@ -65,9 +65,4 @@ public class ClaimConst
|
|||||||
/// 登录模式PC、APP
|
/// 登录模式PC、APP
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string LoginMode = "LoginMode";
|
public const string LoginMode = "LoginMode";
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 最新密码修改时间
|
|
||||||
/// </summary>
|
|
||||||
public const string LastChangePasswordTime = "LastChangePasswordTime";
|
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ public class OnlineUserHub : Hub<IOnlineUserHub>
|
|||||||
var user = await _sysOnlineUerRep.AsQueryable().Filter("", true).FirstAsync(u => u.ConnectionId == Context.ConnectionId);
|
var user = await _sysOnlineUerRep.AsQueryable().Filter("", true).FirstAsync(u => u.ConnectionId == Context.ConnectionId);
|
||||||
if (user == null) return;
|
if (user == null) return;
|
||||||
|
|
||||||
await _sysOnlineUerRep.DeleteAsync(u => u.Id == user.Id);
|
await _sysOnlineUerRep.DeleteByIdAsync(user.Id);
|
||||||
|
|
||||||
// 是否开启单用户登录
|
// 是否开启单用户登录
|
||||||
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysSingleLogin))
|
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysSingleLogin))
|
||||||
|
|||||||
@ -100,4 +100,9 @@ public class LoginUserOutput
|
|||||||
/// 水印文字
|
/// 水印文字
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string WatermarkText { get; set; }
|
public string WatermarkText { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最新密码修改时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? LastChangePasswordTime;
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
throw Oops.Oh(ErrorCodeEnum.D1017);
|
throw Oops.Oh(ErrorCodeEnum.D1017);
|
||||||
|
|
||||||
// 租户是否被禁用
|
// 租户是否被禁用
|
||||||
var tenant = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysTenant>>().GetFirstAsync(u => u.Id == user.TenantId);
|
var tenant = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysTenant>>().GetByIdAsync(user.TenantId);
|
||||||
if (tenant != null && tenant.Status == StatusEnum.Disable)
|
if (tenant != null && tenant.Status == StatusEnum.Disable)
|
||||||
throw Oops.Oh(ErrorCodeEnum.Z1003);
|
throw Oops.Oh(ErrorCodeEnum.Z1003);
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
public virtual async Task<bool> UnLockScreen([Required, FromQuery] string password)
|
public virtual async Task<bool> UnLockScreen([Required, FromQuery] string password)
|
||||||
{
|
{
|
||||||
// 账号是否存在
|
// 账号是否存在
|
||||||
var user = await _sysUserRep.GetFirstAsync(u => u.Id == _userManager.UserId);
|
var user = await _sysUserRep.GetByIdAsync(_userManager.UserId);
|
||||||
_ = user ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
_ = user ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
||||||
|
|
||||||
// 国密SM2解密(前端密码传输SM2加密后的)
|
// 国密SM2解密(前端密码传输SM2加密后的)
|
||||||
@ -230,7 +230,6 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
{ ClaimConst.OrgName, user.SysOrg?.Name },
|
{ ClaimConst.OrgName, user.SysOrg?.Name },
|
||||||
{ ClaimConst.OrgType, user.SysOrg?.Type },
|
{ ClaimConst.OrgType, user.SysOrg?.Type },
|
||||||
{ ClaimConst.LoginMode, loginMode },
|
{ ClaimConst.LoginMode, loginMode },
|
||||||
{ ClaimConst.LastChangePasswordTime, user.LastChangePasswordTime },
|
|
||||||
}, tokenExpire);
|
}, tokenExpire);
|
||||||
|
|
||||||
// 生成刷新Token令牌
|
// 生成刷新Token令牌
|
||||||
@ -270,11 +269,11 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取登录账号")]
|
[DisplayName("获取登录账号")]
|
||||||
public virtual async Task<LoginUserOutput> GetUserInfo()
|
public virtual async Task<LoginUserOutput> GetUserInfo()
|
||||||
{
|
{
|
||||||
var user = await _sysUserRep.GetFirstAsync(u => u.Id == _userManager.UserId) ?? throw Oops.Oh(ErrorCodeEnum.D1011).StatusCode(401);
|
var user = await _sysUserRep.GetByIdAsync(_userManager.UserId) ?? throw Oops.Oh(ErrorCodeEnum.D1011).StatusCode(401);
|
||||||
// 机构
|
// 机构
|
||||||
var org = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysOrg>>().GetFirstAsync(u => u.Id == user.OrgId);
|
var org = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysOrg>>().GetByIdAsync(user.OrgId);
|
||||||
// 职位
|
// 职位
|
||||||
var pos = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysPos>>().GetFirstAsync(u => u.Id == user.PosId);
|
var pos = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysPos>>().GetByIdAsync(user.PosId);
|
||||||
// 角色集合
|
// 角色集合
|
||||||
var roleIds = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysUserRole>>().AsQueryable().Where(u => u.UserId == user.Id).Select(u => u.RoleId).ToListAsync();
|
var roleIds = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysUserRole>>().AsQueryable().Where(u => u.UserId == user.Id).Select(u => u.RoleId).ToListAsync();
|
||||||
// 接口集合
|
// 接口集合
|
||||||
@ -302,7 +301,8 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
PosName = pos?.Name,
|
PosName = pos?.Name,
|
||||||
Apis = apis,
|
Apis = apis,
|
||||||
RoleIds = roleIds,
|
RoleIds = roleIds,
|
||||||
WatermarkText = watermarkText
|
WatermarkText = watermarkText,
|
||||||
|
LastChangePasswordTime = user.LastChangePasswordTime
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,7 @@ public class SysLdapService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("删除系统域登录配置")]
|
[DisplayName("删除系统域登录配置")]
|
||||||
public async Task Delete(DeleteSysLdapInput input)
|
public async Task Delete(DeleteSysLdapInput input)
|
||||||
{
|
{
|
||||||
var entity = await _sysLdapRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
var entity = await _sysLdapRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||||
await _sysLdapRep.FakeDeleteAsync(entity); // 假删除
|
await _sysLdapRep.FakeDeleteAsync(entity); // 假删除
|
||||||
//await _rep.DeleteAsync(entity); // 真删除
|
//await _rep.DeleteAsync(entity); // 真删除
|
||||||
}
|
}
|
||||||
@ -91,7 +91,7 @@ public class SysLdapService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取系统域登录配置详情")]
|
[DisplayName("获取系统域登录配置详情")]
|
||||||
public async Task<SysLdap> GetDetail([FromQuery] DetailSysLdapInput input)
|
public async Task<SysLdap> GetDetail([FromQuery] DetailSysLdapInput input)
|
||||||
{
|
{
|
||||||
return await _sysLdapRep.GetFirstAsync(u => u.Id == input.Id);
|
return await _sysLdapRep.GetByIdAsync(input.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -162,7 +162,7 @@ public class SysLdapService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("同步域用户")]
|
[DisplayName("同步域用户")]
|
||||||
public async Task SyncUser(SyncSysLdapInput input)
|
public async Task SyncUser(SyncSysLdapInput input)
|
||||||
{
|
{
|
||||||
var sysLdap = await _sysLdapRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
var sysLdap = await _sysLdapRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||||
var ldapConn = new LdapConnection();
|
var ldapConn = new LdapConnection();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -294,7 +294,7 @@ public class SysLdapService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("同步域组织")]
|
[DisplayName("同步域组织")]
|
||||||
public async Task SyncDept(SyncSysLdapInput input)
|
public async Task SyncDept(SyncSysLdapInput input)
|
||||||
{
|
{
|
||||||
var sysLdap = await _sysLdapRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
var sysLdap = await _sysLdapRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||||
var ldapConn = new LdapConnection();
|
var ldapConn = new LdapConnection();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@ -72,7 +72,7 @@ public class SysCodeGenConfigService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取代码生成配置详情")]
|
[DisplayName("获取代码生成配置详情")]
|
||||||
public async Task<SysCodeGenConfig> GetDetail([FromQuery] CodeGenConfig input)
|
public async Task<SysCodeGenConfig> GetDetail([FromQuery] CodeGenConfig input)
|
||||||
{
|
{
|
||||||
return await _db.Queryable<SysCodeGenConfig>().FirstAsync(u => u.Id == input.Id);
|
return await _db.Queryable<SysCodeGenConfig>().SingleAsync(u => u.Id == input.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -635,7 +635,7 @@ public class SysCodeGenService : IDynamicApiController, ITransient
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var pMenu = await _db.Queryable<SysMenu>().FirstAsync(u => u.Id == pid) ?? throw Oops.Oh(ErrorCodeEnum.D1505);
|
var pMenu = await _db.Queryable<SysMenu>().SingleAsync(u => u.Id == pid) ?? throw Oops.Oh(ErrorCodeEnum.D1505);
|
||||||
pPath = pMenu.Path;
|
pPath = pMenu.Path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -95,7 +95,7 @@ public class SysConfigService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("删除参数配置")]
|
[DisplayName("删除参数配置")]
|
||||||
public async Task DeleteConfig(DeleteConfigInput input)
|
public async Task DeleteConfig(DeleteConfigInput input)
|
||||||
{
|
{
|
||||||
var config = await _sysConfigRep.GetFirstAsync(u => u.Id == input.Id);
|
var config = await _sysConfigRep.GetByIdAsync(input.Id);
|
||||||
if (config.SysFlag == YesNoEnum.Y) // 禁止删除系统参数
|
if (config.SysFlag == YesNoEnum.Y) // 禁止删除系统参数
|
||||||
throw Oops.Oh(ErrorCodeEnum.D9001);
|
throw Oops.Oh(ErrorCodeEnum.D9001);
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ public class SysConfigService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
foreach (var id in ids)
|
foreach (var id in ids)
|
||||||
{
|
{
|
||||||
var config = await _sysConfigRep.GetFirstAsync(u => u.Id == id);
|
var config = await _sysConfigRep.GetByIdAsync(id);
|
||||||
if (config.SysFlag == YesNoEnum.Y) // 禁止删除系统参数
|
if (config.SysFlag == YesNoEnum.Y) // 禁止删除系统参数
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ public class SysConfigService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取参数配置详情")]
|
[DisplayName("获取参数配置详情")]
|
||||||
public async Task<SysConfig> GetDetail([FromQuery] ConfigInput input)
|
public async Task<SysConfig> GetDetail([FromQuery] ConfigInput input)
|
||||||
{
|
{
|
||||||
return await _sysConfigRep.GetFirstAsync(u => u.Id == input.Id);
|
return await _sysConfigRep.GetByIdAsync(input.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -98,7 +98,7 @@ public class SysDictDataService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("删除字典值")]
|
[DisplayName("删除字典值")]
|
||||||
public async Task DeleteDictData(DeleteDictDataInput input)
|
public async Task DeleteDictData(DeleteDictDataInput input)
|
||||||
{
|
{
|
||||||
var dictData = await _sysDictDataRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3004);
|
var dictData = await _sysDictDataRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3004);
|
||||||
|
|
||||||
var dictTypeCode = await _sysDictDataRep.AsQueryable().Where(u => u.DictTypeId == dictData.Id).Select(u => u.DictType.Code).FirstAsync();
|
var dictTypeCode = await _sysDictDataRep.AsQueryable().Where(u => u.DictTypeId == dictData.Id).Select(u => u.DictType.Code).FirstAsync();
|
||||||
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictTypeCode}");
|
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictTypeCode}");
|
||||||
@ -114,7 +114,7 @@ public class SysDictDataService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取字典值详情")]
|
[DisplayName("获取字典值详情")]
|
||||||
public async Task<SysDictData> GetDetail([FromQuery] DictDataInput input)
|
public async Task<SysDictData> GetDetail([FromQuery] DictDataInput input)
|
||||||
{
|
{
|
||||||
return await _sysDictDataRep.GetFirstAsync(u => u.Id == input.Id);
|
return await _sysDictDataRep.GetByIdAsync(input.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -126,7 +126,7 @@ public class SysDictDataService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("修改字典值状态")]
|
[DisplayName("修改字典值状态")]
|
||||||
public async Task SetStatus(DictDataInput input)
|
public async Task SetStatus(DictDataInput input)
|
||||||
{
|
{
|
||||||
var dictData = await _sysDictDataRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3004);
|
var dictData = await _sysDictDataRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3004);
|
||||||
|
|
||||||
var dictTypeCode = await _sysDictDataRep.AsQueryable().Where(u => u.DictTypeId == dictData.Id).Select(u => u.DictType.Code).FirstAsync();
|
var dictTypeCode = await _sysDictDataRep.AsQueryable().Where(u => u.DictTypeId == dictData.Id).Select(u => u.DictType.Code).FirstAsync();
|
||||||
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictTypeCode}");
|
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictTypeCode}");
|
||||||
|
|||||||
@ -107,7 +107,7 @@ public class SysDictTypeService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("删除字典类型")]
|
[DisplayName("删除字典类型")]
|
||||||
public async Task DeleteDictType(DeleteDictTypeInput input)
|
public async Task DeleteDictType(DeleteDictTypeInput input)
|
||||||
{
|
{
|
||||||
var dictType = await _sysDictTypeRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3000);
|
var dictType = await _sysDictTypeRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
// 删除字典值
|
// 删除字典值
|
||||||
await _sysDictTypeRep.DeleteAsync(dictType);
|
await _sysDictTypeRep.DeleteAsync(dictType);
|
||||||
@ -122,7 +122,7 @@ public class SysDictTypeService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取字典类型详情")]
|
[DisplayName("获取字典类型详情")]
|
||||||
public async Task<SysDictType> GetDetail([FromQuery] DictTypeInput input)
|
public async Task<SysDictType> GetDetail([FromQuery] DictTypeInput input)
|
||||||
{
|
{
|
||||||
return await _sysDictTypeRep.GetFirstAsync(u => u.Id == input.Id);
|
return await _sysDictTypeRep.GetByIdAsync(input.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -134,7 +134,7 @@ public class SysDictTypeService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("修改字典类型状态")]
|
[DisplayName("修改字典类型状态")]
|
||||||
public async Task SetStatus(DictTypeInput input)
|
public async Task SetStatus(DictTypeInput input)
|
||||||
{
|
{
|
||||||
var dictType = await _sysDictTypeRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3000);
|
var dictType = await _sysDictTypeRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictType.Code}");
|
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictType.Code}");
|
||||||
|
|
||||||
|
|||||||
@ -231,7 +231,7 @@ public class SysFileService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("删除文件")]
|
[DisplayName("删除文件")]
|
||||||
public async Task DeleteFile(DeleteFileInput input)
|
public async Task DeleteFile(DeleteFileInput input)
|
||||||
{
|
{
|
||||||
var file = await _sysFileRep.GetFirstAsync(u => u.Id == input.Id);
|
var file = await _sysFileRep.GetByIdAsync(input.Id);
|
||||||
if (file != null)
|
if (file != null)
|
||||||
{
|
{
|
||||||
await _sysFileRep.DeleteAsync(file);
|
await _sysFileRep.DeleteAsync(file);
|
||||||
@ -281,7 +281,7 @@ public class SysFileService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取文件")]
|
[DisplayName("获取文件")]
|
||||||
public async Task<SysFile> GetFile([FromQuery] FileInput input)
|
public async Task<SysFile> GetFile([FromQuery] FileInput input)
|
||||||
{
|
{
|
||||||
var file = await _sysFileRep.CopyNew().GetFirstAsync(u => u.Id == input.Id);
|
var file = await _sysFileRep.CopyNew().GetByIdAsync(input.Id);
|
||||||
return file ?? throw Oops.Oh(ErrorCodeEnum.D8000);
|
return file ?? throw Oops.Oh(ErrorCodeEnum.D8000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,7 +431,7 @@ public class SysFileService : IDynamicApiController, ITransient
|
|||||||
var sysFile = await HandleUploadFile(file, "upload/avatar", _imageType);
|
var sysFile = await HandleUploadFile(file, "upload/avatar", _imageType);
|
||||||
|
|
||||||
var sysUserRep = _sysFileRep.ChangeRepository<SqlSugarRepository<SysUser>>();
|
var sysUserRep = _sysFileRep.ChangeRepository<SqlSugarRepository<SysUser>>();
|
||||||
var user = sysUserRep.GetFirst(u => u.Id == _userManager.UserId);
|
var user = await sysUserRep.GetByIdAsync(_userManager.UserId);
|
||||||
// 删除已有头像文件
|
// 删除已有头像文件
|
||||||
if (!string.IsNullOrWhiteSpace(user.Avatar))
|
if (!string.IsNullOrWhiteSpace(user.Avatar))
|
||||||
{
|
{
|
||||||
@ -453,7 +453,7 @@ public class SysFileService : IDynamicApiController, ITransient
|
|||||||
var sysFile = await HandleUploadFile(file, "upload/signature", _imageType);
|
var sysFile = await HandleUploadFile(file, "upload/signature", _imageType);
|
||||||
|
|
||||||
var sysUserRep = _sysFileRep.ChangeRepository<SqlSugarRepository<SysUser>>();
|
var sysUserRep = _sysFileRep.ChangeRepository<SqlSugarRepository<SysUser>>();
|
||||||
var user = sysUserRep.GetFirst(u => u.Id == _userManager.UserId);
|
var user = await sysUserRep.GetByIdAsync(_userManager.UserId);
|
||||||
// 删除已有电子签名文件
|
// 删除已有电子签名文件
|
||||||
if (!string.IsNullOrWhiteSpace(user.Signature) && user.Signature.EndsWith(".png"))
|
if (!string.IsNullOrWhiteSpace(user.Signature) && user.Signature.EndsWith(".png"))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -123,7 +123,7 @@ public class SysJobService : IDynamicApiController, ITransient
|
|||||||
if (isExist)
|
if (isExist)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D1006);
|
throw Oops.Oh(ErrorCodeEnum.D1006);
|
||||||
|
|
||||||
var sysJobDetail = await _sysJobDetailRep.GetFirstAsync(u => u.Id == input.Id);
|
var sysJobDetail = await _sysJobDetailRep.GetByIdAsync(input.Id);
|
||||||
if (sysJobDetail.JobId != input.JobId)
|
if (sysJobDetail.JobId != input.JobId)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D1704);
|
throw Oops.Oh(ErrorCodeEnum.D1704);
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,6 @@ public class SysLogDiffService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取差异日志详情")]
|
[DisplayName("获取差异日志详情")]
|
||||||
public async Task<SysLogDiff> GetDetail(long id)
|
public async Task<SysLogDiff> GetDetail(long id)
|
||||||
{
|
{
|
||||||
return await _sysLogDiffRep.GetFirstAsync(u => u.Id == id);
|
return await _sysLogDiffRep.GetByIdAsync(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ public class SysLogExService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取异常日志详情")]
|
[DisplayName("获取异常日志详情")]
|
||||||
public async Task<SysLogEx> GetDetail(long id)
|
public async Task<SysLogEx> GetDetail(long id)
|
||||||
{
|
{
|
||||||
return await _sysLogExRep.GetFirstAsync(u => u.Id == id);
|
return await _sysLogExRep.GetByIdAsync(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class SysLogOpService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取操作日志详情")]
|
[DisplayName("获取操作日志详情")]
|
||||||
public async Task<SysLogOp> GetDetail(long id)
|
public async Task<SysLogOp> GetDetail(long id)
|
||||||
{
|
{
|
||||||
return await _sysLogOpRep.GetFirstAsync(u => u.Id == id);
|
return await _sysLogOpRep.GetByIdAsync(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -103,7 +103,7 @@ public class SysNoticeService : IDynamicApiController, ITransient
|
|||||||
// 更新发布状态和时间
|
// 更新发布状态和时间
|
||||||
await _sysNoticeRep.UpdateAsync(u => new SysNotice() { Status = NoticeStatusEnum.PUBLIC, PublicTime = DateTime.Now }, u => u.Id == input.Id);
|
await _sysNoticeRep.UpdateAsync(u => new SysNotice() { Status = NoticeStatusEnum.PUBLIC, PublicTime = DateTime.Now }, u => u.Id == input.Id);
|
||||||
|
|
||||||
var notice = await _sysNoticeRep.GetFirstAsync(u => u.Id == input.Id);
|
var notice = await _sysNoticeRep.GetByIdAsync(input.Id);
|
||||||
|
|
||||||
// 通知到的人(所有账号)
|
// 通知到的人(所有账号)
|
||||||
var userIdList = await _sysUserRep.AsQueryable().Select(u => u.Id).ToListAsync();
|
var userIdList = await _sysUserRep.AsQueryable().Select(u => u.Id).ToListAsync();
|
||||||
|
|||||||
@ -70,6 +70,6 @@ public class SysOAuthUserService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("删除OAuth账号")]
|
[DisplayName("删除OAuth账号")]
|
||||||
public async Task DeleteWechatUser(DeleteOAuthUserInput input)
|
public async Task DeleteWechatUser(DeleteOAuthUserInput input)
|
||||||
{
|
{
|
||||||
await _sysOAuthUserRep.DeleteAsync(u => u.Id == input.Id);
|
await _sysOAuthUserRep.DeleteByIdAsync(input.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -112,11 +112,11 @@ public class SysOpenAccessService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("删除开放接口身份")]
|
[DisplayName("删除开放接口身份")]
|
||||||
public async Task DeleteOpenAccess(DeleteOpenAccessInput input)
|
public async Task DeleteOpenAccess(DeleteOpenAccessInput input)
|
||||||
{
|
{
|
||||||
var openAccess = await _sysOpenAccessRep.GetFirstAsync(u => u.Id == input.Id);
|
var openAccess = await _sysOpenAccessRep.GetByIdAsync(input.Id);
|
||||||
if (openAccess != null)
|
if (openAccess != null)
|
||||||
_sysCacheService.Remove(CacheConst.KeyOpenAccess + openAccess.AccessKey);
|
_sysCacheService.Remove(CacheConst.KeyOpenAccess + openAccess.AccessKey);
|
||||||
|
|
||||||
await _sysOpenAccessRep.DeleteAsync(u => u.Id == input.Id);
|
await _sysOpenAccessRep.DeleteByIdAsync(input.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -68,7 +68,7 @@ public class SysOrgService : IDynamicApiController, ITransient
|
|||||||
HandlerOrgTree(orgTree, userOrgIdList);
|
HandlerOrgTree(orgTree, userOrgIdList);
|
||||||
}
|
}
|
||||||
|
|
||||||
var sysOrg = await _sysOrgRep.GetSingleAsync(u => u.Id == input.Id);
|
var sysOrg = await _sysOrgRep.GetByIdAsync(input.Id);
|
||||||
if (sysOrg != null)
|
if (sysOrg != null)
|
||||||
{
|
{
|
||||||
sysOrg.Children = orgTree;
|
sysOrg.Children = orgTree;
|
||||||
@ -123,7 +123,7 @@ public class SysOrgService : IDynamicApiController, ITransient
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var pOrg = await _sysOrgRep.GetFirstAsync(u => u.Id == input.Pid);
|
var pOrg = await _sysOrgRep.GetByIdAsync(input.Pid);
|
||||||
if (pOrg != null)
|
if (pOrg != null)
|
||||||
DeleteAllUserOrgCache(pOrg.Id, pOrg.Pid);
|
DeleteAllUserOrgCache(pOrg.Id, pOrg.Pid);
|
||||||
}
|
}
|
||||||
@ -160,11 +160,11 @@ public class SysOrgService : IDynamicApiController, ITransient
|
|||||||
|
|
||||||
if (input.Pid != 0)
|
if (input.Pid != 0)
|
||||||
{
|
{
|
||||||
//var pOrg = await _sysOrgRep.GetFirstAsync(u => u.Id == input.Pid);
|
//var pOrg = await _sysOrgRep.GetByIdAsync(input.Pid);
|
||||||
//_ = pOrg ?? throw Oops.Oh(ErrorCodeEnum.D2000);
|
//_ = pOrg ?? throw Oops.Oh(ErrorCodeEnum.D2000);
|
||||||
|
|
||||||
// 若父机构发生变化则清空用户机构缓存
|
// 若父机构发生变化则清空用户机构缓存
|
||||||
var sysOrg = await _sysOrgRep.GetFirstAsync(u => u.Id == input.Id);
|
var sysOrg = await _sysOrgRep.GetByIdAsync(input.Id);
|
||||||
if (sysOrg != null && sysOrg.Pid != input.Pid)
|
if (sysOrg != null && sysOrg.Pid != input.Pid)
|
||||||
{
|
{
|
||||||
// 删除与此机构、新父机构有关的用户机构缓存
|
// 删除与此机构、新父机构有关的用户机构缓存
|
||||||
@ -203,7 +203,7 @@ public class SysOrgService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("删除机构")]
|
[DisplayName("删除机构")]
|
||||||
public async Task DeleteOrg(DeleteOrgInput input)
|
public async Task DeleteOrg(DeleteOrgInput input)
|
||||||
{
|
{
|
||||||
var sysOrg = await _sysOrgRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
var sysOrg = await _sysOrgRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||||
|
|
||||||
// 是否有权限操作此机构
|
// 是否有权限操作此机构
|
||||||
if (!_userManager.SuperAdmin)
|
if (!_userManager.SuperAdmin)
|
||||||
|
|||||||
@ -90,7 +90,7 @@ public class SysPluginService : IDynamicApiController, ITransient
|
|||||||
// 移除动态程序集/接口
|
// 移除动态程序集/接口
|
||||||
RemoveAssembly(plugin.AssemblyName);
|
RemoveAssembly(plugin.AssemblyName);
|
||||||
|
|
||||||
await _sysPluginRep.DeleteAsync(u => u.Id == input.Id);
|
await _sysPluginRep.DeleteByIdAsync(input.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -109,7 +109,7 @@ public class SysPosService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("删除职位")]
|
[DisplayName("删除职位")]
|
||||||
public async Task DeletePos(DeletePosInput input)
|
public async Task DeletePos(DeletePosInput input)
|
||||||
{
|
{
|
||||||
var sysPos = await _sysPosRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D6003);
|
var sysPos = await _sysPosRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D6003);
|
||||||
if (!_userManager.SuperAdmin && sysPos.CreateUserId != _userManager.UserId)
|
if (!_userManager.SuperAdmin && sysPos.CreateUserId != _userManager.UserId)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D6002);
|
throw Oops.Oh(ErrorCodeEnum.D6002);
|
||||||
|
|
||||||
@ -124,6 +124,6 @@ public class SysPosService : IDynamicApiController, ITransient
|
|||||||
if (hasExtPosEmp)
|
if (hasExtPosEmp)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D6001);
|
throw Oops.Oh(ErrorCodeEnum.D6001);
|
||||||
|
|
||||||
await _sysPosRep.DeleteAsync(u => u.Id == input.Id);
|
await _sysPosRep.DeleteByIdAsync(input.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,6 +85,6 @@ public class SysPrintService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("删除打印模板")]
|
[DisplayName("删除打印模板")]
|
||||||
public async Task DeletePrint(DeletePrintInput input)
|
public async Task DeletePrint(DeletePrintInput input)
|
||||||
{
|
{
|
||||||
await _sysPrintRep.DeleteAsync(u => u.Id == input.Id);
|
await _sysPrintRep.DeleteByIdAsync(input.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ public class SysRegionService : IDynamicApiController, ITransient
|
|||||||
|
|
||||||
if (input.Pid != 0)
|
if (input.Pid != 0)
|
||||||
{
|
{
|
||||||
var pRegion = await _sysRegionRep.GetFirstAsync(u => u.Id == input.Pid);
|
var pRegion = await _sysRegionRep.GetByIdAsync(input.Pid);
|
||||||
pRegion ??= await _sysRegionRep.GetFirstAsync(u => u.Code == input.Pid.ToString());
|
pRegion ??= await _sysRegionRep.GetFirstAsync(u => u.Code == input.Pid.ToString());
|
||||||
if (pRegion == null)
|
if (pRegion == null)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D2000);
|
throw Oops.Oh(ErrorCodeEnum.D2000);
|
||||||
@ -98,13 +98,13 @@ public class SysRegionService : IDynamicApiController, ITransient
|
|||||||
if (input.Code.Length != 12 && input.Code.Length != 9 && input.Code.Length != 6)
|
if (input.Code.Length != 12 && input.Code.Length != 9 && input.Code.Length != 6)
|
||||||
throw Oops.Oh(ErrorCodeEnum.R2003);
|
throw Oops.Oh(ErrorCodeEnum.R2003);
|
||||||
|
|
||||||
var sysRegion = await _sysRegionRep.GetFirstAsync(u => u.Id == input.Id);
|
var sysRegion = await _sysRegionRep.GetByIdAsync(input.Id);
|
||||||
if (sysRegion == null)
|
if (sysRegion == null)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D1002);
|
throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||||
|
|
||||||
if (sysRegion.Pid != input.Pid && input.Pid != 0)
|
if (sysRegion.Pid != input.Pid && input.Pid != 0)
|
||||||
{
|
{
|
||||||
var pRegion = await _sysRegionRep.GetFirstAsync(u => u.Id == input.Pid);
|
var pRegion = await _sysRegionRep.GetByIdAsync(input.Pid);
|
||||||
pRegion ??= await _sysRegionRep.GetFirstAsync(u => u.Code == input.Pid.ToString());
|
pRegion ??= await _sysRegionRep.GetFirstAsync(u => u.Code == input.Pid.ToString());
|
||||||
if (pRegion == null)
|
if (pRegion == null)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D2000);
|
throw Oops.Oh(ErrorCodeEnum.D2000);
|
||||||
|
|||||||
@ -124,7 +124,7 @@ public class SysRoleService : IDynamicApiController, ITransient
|
|||||||
public async Task DeleteRole(DeleteRoleInput input)
|
public async Task DeleteRole(DeleteRoleInput input)
|
||||||
{
|
{
|
||||||
// 禁止删除系统管理员角色
|
// 禁止删除系统管理员角色
|
||||||
var sysRole = await _sysRoleRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
var sysRole = await _sysRoleRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||||
if (sysRole.Code == CommonConst.SysAdminRole)
|
if (sysRole.Code == CommonConst.SysAdminRole)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D1019);
|
throw Oops.Oh(ErrorCodeEnum.D1019);
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ public class SysRoleService : IDynamicApiController, ITransient
|
|||||||
SqlSugarFilter.DeleteUserOrgCache(userId, _sysRoleRep.Context.CurrentConnectionConfig.ConfigId.ToString());
|
SqlSugarFilter.DeleteUserOrgCache(userId, _sysRoleRep.Context.CurrentConnectionConfig.ConfigId.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
var role = await _sysRoleRep.GetFirstAsync(u => u.Id == input.Id);
|
var role = await _sysRoleRep.GetByIdAsync(input.Id);
|
||||||
var dataScope = input.DataScope;
|
var dataScope = input.DataScope;
|
||||||
if (!_userManager.SuperAdmin)
|
if (!_userManager.SuperAdmin)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -46,7 +46,7 @@ public class SysScheduleService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取日程详情")]
|
[DisplayName("获取日程详情")]
|
||||||
public async Task<SysSchedule> GetDetail(long id)
|
public async Task<SysSchedule> GetDetail(long id)
|
||||||
{
|
{
|
||||||
return await _sysSchedule.GetFirstAsync(u => u.Id == id);
|
return await _sysSchedule.GetByIdAsync(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -83,7 +83,7 @@ public class SysScheduleService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("删除日程")]
|
[DisplayName("删除日程")]
|
||||||
public async Task DeleteUserSchedule(DeleteScheduleInput input)
|
public async Task DeleteUserSchedule(DeleteScheduleInput input)
|
||||||
{
|
{
|
||||||
await _sysSchedule.DeleteAsync(u => u.Id == input.Id);
|
await _sysSchedule.DeleteByIdAsync(input.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -154,7 +154,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("设置租户状态")]
|
[DisplayName("设置租户状态")]
|
||||||
public async Task<int> SetStatus(TenantInput input)
|
public async Task<int> SetStatus(TenantInput input)
|
||||||
{
|
{
|
||||||
var tenant = await _sysTenantRep.GetFirstAsync(u => u.Id == input.Id);
|
var tenant = await _sysTenantRep.GetByIdAsync(input.Id);
|
||||||
if (tenant == null || tenant.ConfigId == SqlSugarConst.MainConfigId)
|
if (tenant == null || tenant.ConfigId == SqlSugarConst.MainConfigId)
|
||||||
throw Oops.Oh(ErrorCodeEnum.Z1001);
|
throw Oops.Oh(ErrorCodeEnum.Z1001);
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
if (isOpenAccessTenant)
|
if (isOpenAccessTenant)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D1031);
|
throw Oops.Oh(ErrorCodeEnum.D1031);
|
||||||
|
|
||||||
await _sysTenantRep.DeleteAsync(u => u.Id == input.Id);
|
await _sysTenantRep.DeleteByIdAsync(input.Id);
|
||||||
|
|
||||||
await CacheTenant(input.Id);
|
await CacheTenant(input.Id);
|
||||||
|
|
||||||
@ -431,7 +431,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("创建租户数据库")]
|
[DisplayName("创建租户数据库")]
|
||||||
public async Task InitTenantDb(TenantInput input)
|
public async Task InitTenantDb(TenantInput input)
|
||||||
{
|
{
|
||||||
var tenant = await _sysTenantRep.GetSingleAsync(u => u.Id == input.Id);
|
var tenant = await _sysTenantRep.GetByIdAsync(input.Id);
|
||||||
if (tenant == null) return;
|
if (tenant == null) return;
|
||||||
|
|
||||||
if (tenant.DbType == SqlSugar.DbType.Oracle)
|
if (tenant.DbType == SqlSugar.DbType.Oracle)
|
||||||
@ -465,7 +465,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("创建租户数据")]
|
[DisplayName("创建租户数据")]
|
||||||
public async Task InitTenantData(TenantInput input)
|
public async Task InitTenantData(TenantInput input)
|
||||||
{
|
{
|
||||||
var tenant = await _sysTenantRep.GetSingleAsync(u => u.Id == input.Id);
|
var tenant = await _sysTenantRep.GetByIdAsync(input.Id);
|
||||||
if (tenant == null) return;
|
if (tenant == null) return;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(tenant.Connection) || tenant.Connection.Length < 10)
|
if (string.IsNullOrWhiteSpace(tenant.Connection) || tenant.Connection.Length < 10)
|
||||||
|
|||||||
@ -261,7 +261,7 @@ public class SysUserService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("授权用户角色")]
|
[DisplayName("授权用户角色")]
|
||||||
public async Task GrantRole(UserRoleInput input)
|
public async Task GrantRole(UserRoleInput input)
|
||||||
{
|
{
|
||||||
//var user = await _sysUserRep.GetFirstAsync(u => u.Id == input.UserId) ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
//var user = await _sysUserRep.GetByIdAsync(input.UserId) ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
||||||
//if (user.AccountType == AccountTypeEnum.SuperAdmin)
|
//if (user.AccountType == AccountTypeEnum.SuperAdmin)
|
||||||
// throw Oops.Oh(ErrorCodeEnum.D1022);
|
// throw Oops.Oh(ErrorCodeEnum.D1022);
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@ public class ApprovalFlowService : IDynamicApiController, ITransient
|
|||||||
[ApiDescriptionSettings(Name = "Delete"), HttpPost]
|
[ApiDescriptionSettings(Name = "Delete"), HttpPost]
|
||||||
public async Task Delete(DeleteApprovalFlowInput input)
|
public async Task Delete(DeleteApprovalFlowInput input)
|
||||||
{
|
{
|
||||||
var entity = await _approvalFlowRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
var entity = await _approvalFlowRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||||
await _approvalFlowRep.FakeDeleteAsync(entity); // 假删除
|
await _approvalFlowRep.FakeDeleteAsync(entity); // 假删除
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ public class ApprovalFlowService : IDynamicApiController, ITransient
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<ApprovalFlow> GetDetail([FromQuery] QueryByIdApprovalFlowInput input)
|
public async Task<ApprovalFlow> GetDetail([FromQuery] QueryByIdApprovalFlowInput input)
|
||||||
{
|
{
|
||||||
return await _approvalFlowRep.GetFirstAsync(u => u.Id == input.Id);
|
return await _approvalFlowRep.GetByIdAsync(input.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -104,10 +104,10 @@ public class GoViewProService : IDynamicApiController
|
|||||||
[DisplayName("获取项目数据")]
|
[DisplayName("获取项目数据")]
|
||||||
public async Task<GoViewProDetailOutput> GetData([FromQuery] long projectId)
|
public async Task<GoViewProDetailOutput> GetData([FromQuery] long projectId)
|
||||||
{
|
{
|
||||||
var projectData = await _goViewProDataRep.GetFirstAsync(u => u.Id == projectId);
|
var projectData = await _goViewProDataRep.GetByIdAsync(projectId);
|
||||||
if (projectData == null) return null;
|
if (projectData == null) return null;
|
||||||
|
|
||||||
var project = await _goViewProRep.GetFirstAsync(u => u.Id == projectId);
|
var project = await _goViewProRep.GetByIdAsync(projectId);
|
||||||
var projectDetail = project.Adapt<GoViewProDetailOutput>();
|
var projectDetail = project.Adapt<GoViewProDetailOutput>();
|
||||||
projectDetail.Content = projectData.Content;
|
projectDetail.Content = projectData.Content;
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ public class GoViewProService : IDynamicApiController
|
|||||||
|
|
||||||
////保存预览图
|
////保存预览图
|
||||||
//var result = await _fileService.UploadFile(@object, "");
|
//var result = await _fileService.UploadFile(@object, "");
|
||||||
//var file = await _fileRep.GetFirstAsync(u => u.Id == result.Id);
|
//var file = await _fileRep.GetByIdAsync(result.Id);
|
||||||
//int.TryParse(file.SizeKb, out var size);
|
//int.TryParse(file.SizeKb, out var size);
|
||||||
|
|
||||||
////本地存储,使用拼接的地址
|
////本地存储,使用拼接的地址
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user