cjy 2 months ago
commit 1b105690b6

@ -32,6 +32,12 @@ public class SysFieldSet
/// <summary>
/// 字段设置
/// </summary>
[SugarColumn(ColumnDescription = "字段设置", IsNullable = true, ColumnDataType=StaticConfig.CodeFirst_BigString)]
[SugarColumn(ColumnDescription = "字段设置", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
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("账号不存在或账号禁用,请检查!"));
}
if (userInfo.MD5Password != model.Password)
{
@ -864,7 +864,7 @@ public class CommonService : ICommonService
#region 客户端通用
/// <summary>
/// 获取权限树列表-客户端
/// </summary>
@ -1450,10 +1450,10 @@ public class CommonService : ICommonService
return db.Queryable<T>(); //超级管理员特权
}
var moduleName = typeof(T).Name.ToLower();
var moduleName = typeof(T).Name.ToLower();
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>(); //没有设置数据规则,那么视为该资源允许被任何主体查看
@ -1613,9 +1613,10 @@ public class CommonService : ICommonService
}
}
}
var tenantId = long.Parse(user.TenantId);
var tagNoList = tagNoDic.Select(x => x.Key);
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 == userId || x.UserId == 0))
.Select(x => new SysFieldSetTaskPlatResultDto(), true)
@ -1695,21 +1696,23 @@ public class CommonService : ICommonService
{
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>()
.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 == long.Parse(user.UserId))
.WhereIF(!req.IsSetDefault, x => x.UserId == userId)
.FirstAsync();
if (info.IsNull())
{
var entity = new SysFieldSet
{
UserId = req.IsSetDefault ? 0 : long.Parse(user.UserId),
TagNo = tagNo,
UserId = req.IsSetDefault ? 0 : userId,
PermissionId = req.PermissionId,
Content = req.Content
Content = req.Content,
TenantId = tenantId,
TagNo = tagNo,
};
await db.Insertable(entity).ExecuteCommandAsync();
}
@ -2127,7 +2130,7 @@ public class CommonService : ICommonService
/// 获取最新业务单据编码
/// </summary>
/// <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 = "";

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
</PropertyGroup>

Loading…
Cancel
Save