cjy 2 months ago
commit 1b105690b6

@ -34,4 +34,10 @@ 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; } public string Content { get; set; }
/// <summary>
/// 租户Id
/// </summary>
[SugarColumn(ColumnDescription = "租户Id", IsNullable = true)]
public long? TenantId { get; set; }
} }

@ -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();
} }

@ -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