dengyu 2 months ago
commit d3de764d83

@ -32,6 +32,12 @@ public class SysFieldSet
/// <summary> /// <summary>
/// 字段设置 /// 字段设置
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "字段设置", IsNullable = true, ColumnDataType=StaticConfig.CodeFirst_BigString)] [SugarColumn(ColumnDescription = "字段设置", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string Content { get; set; } public string Content { get; set; }
/// <summary>
/// 租户Id
/// </summary>
[SugarColumn(ColumnDescription = "租户Id", IsNullable = true)]
public long? TenantId { get; set; }
} }

@ -386,7 +386,7 @@ public class CommonService : ICommonService
{ {
return await Task.FromResult(DataResult<string>.Failed("账号不存在或账号禁用,请检查!")); return await Task.FromResult(DataResult<string>.Failed("账号不存在或账号禁用,请检查!"));
} }
if (userInfo.MD5Password != model.Password) if (userInfo.MD5Password != model.Password)
{ {
@ -864,7 +864,7 @@ public class CommonService : ICommonService
#region 客户端通用 #region 客户端通用
/// <summary> /// <summary>
/// 获取权限树列表-客户端 /// 获取权限树列表-客户端
/// </summary> /// </summary>
@ -1450,10 +1450,10 @@ public class CommonService : ICommonService
return db.Queryable<T>(); //超级管理员特权 return db.Queryable<T>(); //超级管理员特权
} }
var moduleName = typeof(T).Name.ToLower(); var moduleName = typeof(T).Name.ToLower();
var rule = tenantDb.Queryable<CodeDataRule>() var rule = tenantDb.Queryable<CodeDataRule>()
.First(u => u.UserId == long.Parse(user.UserId) && u.PermissionEntity.ToLower() == moduleName && u.Status == StatusEnum.Enable); .First(u => u.UserId == long.Parse(user.UserId) && u.PermissionEntity.ToLower() == moduleName && u.Status == StatusEnum.Enable);
if (rule == null) return db.Queryable<T>(); //没有设置数据规则,那么视为该资源允许被任何主体查看 if (rule == null) return db.Queryable<T>(); //没有设置数据规则,那么视为该资源允许被任何主体查看
@ -1613,9 +1613,10 @@ public class CommonService : ICommonService
} }
} }
} }
var tenantId = long.Parse(user.TenantId);
var tagNoList = tagNoDic.Select(x => x.Key); var tagNoList = tagNoDic.Select(x => x.Key);
var infoList = await db.Queryable<SysFieldSet>() var infoList = await db.Queryable<SysFieldSet>()
.Where(x => x.PermissionId == long.Parse(query.PermissionId) && tagNoList.Contains(x.TagNo)) .Where(x => x.PermissionId == long.Parse(query.PermissionId) && x.TenantId == tenantId && tagNoList.Contains(x.TagNo))
.WhereIF(query.IsGetDefault, x => x.UserId == 0) .WhereIF(query.IsGetDefault, x => x.UserId == 0)
.WhereIF(!query.IsGetDefault, x => (x.UserId == userId || x.UserId == 0)) .WhereIF(!query.IsGetDefault, x => (x.UserId == userId || x.UserId == 0))
.Select(x => new SysFieldSetTaskPlatResultDto(), true) .Select(x => new SysFieldSetTaskPlatResultDto(), true)
@ -1695,21 +1696,23 @@ public class CommonService : ICommonService
{ {
throw new Exception(nameof(req.TaskTypeCode) + "取值有误:" + req.TaskTypeCode); throw new Exception(nameof(req.TaskTypeCode) + "取值有误:" + req.TaskTypeCode);
} }
var tenantId = long.Parse(user.TenantId);
var userId = long.Parse(user.UserId);
var info = await db.Queryable<SysFieldSet>() var info = await db.Queryable<SysFieldSet>()
.Where(x => x.PermissionId == req.PermissionId && x.TagNo == tagNo) .Where(x => x.PermissionId == req.PermissionId && x.TenantId == tenantId && x.TagNo == tagNo)
.WhereIF(req.IsSetDefault, x => x.UserId == 0) .WhereIF(req.IsSetDefault, x => x.UserId == 0)
.WhereIF(!req.IsSetDefault, x => x.UserId == long.Parse(user.UserId)) .WhereIF(!req.IsSetDefault, x => x.UserId == userId)
.FirstAsync(); .FirstAsync();
if (info.IsNull()) if (info.IsNull())
{ {
var entity = new SysFieldSet var entity = new SysFieldSet
{ {
UserId = req.IsSetDefault ? 0 : long.Parse(user.UserId), UserId = req.IsSetDefault ? 0 : userId,
TagNo = tagNo,
PermissionId = req.PermissionId, PermissionId = req.PermissionId,
Content = req.Content Content = req.Content,
TenantId = tenantId,
TagNo = tagNo,
}; };
await db.Insertable(entity).ExecuteCommandAsync(); await db.Insertable(entity).ExecuteCommandAsync();
} }
@ -2127,7 +2130,7 @@ public class CommonService : ICommonService
/// 获取最新业务单据编码 /// 获取最新业务单据编码
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public async Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user,long saleId = 0) public async Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0)
{ {
//生成编号 //生成编号
string sequenceNewNo = ""; string sequenceNewNo = "";

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<NameOfLastUsedPublishProfile>D:\Source\Repos\DS8\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>D:\Code\DS\ds8-solution-pro\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

@ -44,6 +44,7 @@ builder.Services.AddSaasDbInstall();//分库服务
builder.Services.AddMultiLanguageInstall();//多语言服务 builder.Services.AddMultiLanguageInstall();//多语言服务
builder.Services.AddExcelModuleInstall();//Excel服务 builder.Services.AddExcelModuleInstall();//Excel服务
builder.Services.AddPrintModuleInstall();//Print服务 builder.Services.AddPrintModuleInstall();//Print服务
builder.Services.AddDjyModuleInstall();//Djy服务
builder.Services.AddRuleEngineModuleInstall();//Djy规则引擎校验服务 builder.Services.AddRuleEngineModuleInstall();//Djy规则引擎校验服务
// builder.Services.AddEndpointsApiExplorer(); // builder.Services.AddEndpointsApiExplorer();
// builder.Services.AddSwaggerGen(); // builder.Services.AddSwaggerGen();

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<NameOfLastUsedPublishProfile>D:\Source\Repos\DS8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>D:\Code\ds8-solution-pro\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID> <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath> <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
</PropertyGroup> </PropertyGroup>

Loading…
Cancel
Save