岗位课程矩阵新增集团数据归属过滤

master
xiaochanghai 4 weeks ago
parent 75109e904c
commit 95fc054231
  1. 11
      Tiobon.Core.Services/Ghra/Ghra_TitleServices.cs

@ -1,7 +1,4 @@
using Tiobon.Core.Common;
using static StackExchange.Redis.Role;
namespace Tiobon.Core.Services;
namespace Tiobon.Core.Services;
/// <summary>
/// 岗位 (服务)
@ -31,10 +28,10 @@ public class Ghra_TitleServices : BaseServices<Ghra_Title, Ghra_TitleDto, Insert
dynamic obj = new ExpandoObject();
dynamic result = new ExpandoObject();
var ruleSrc = Db.Queryable<Ghre_StudyRule>();
var ruleSrc = Db.Queryable<Ghre_StudyRule>().Where($"dbo.FUserDataBelongPriv ({App.User.ID}, DataBelongID, NULL) = 1");
if (string.IsNullOrWhiteSpace(filter.orderBy))
filter.orderBy = "Type ASC";
string sql = $"SELECT * FROM Ghre_CourseScene_V WHERE IsEnable=1";
string sql = $"SELECT *\r\nFROM Ghre_CourseScene_V\r\nWHERE IsEnable = 1 AND dbo.FUserDataBelongPriv ({App.User.ID}, DataBelongID, NULL) = 1 ";
var rules1 = await ruleSrc.Where(x => x.RuleType == "Required" && x.TrainType == "Title").ToListAsync();
var rules = Mapper.Map(rules1).ToANew<List<Ghre_StudyRuleDto>>();
@ -54,7 +51,7 @@ public class Ghra_TitleServices : BaseServices<Ghra_Title, Ghra_TitleDto, Insert
if (x.GradeId.IsNotEmptyOrNull())
x.GradeIds = JsonHelper.JsonToObj<List<int?>>(x.GradeId);
});
var titles = await Db.Queryable<Ghra_Title>().OrderBy(x => x.SortNo).ToListAsync();
var titles = await Db.Queryable<Ghra_Title>().Where($"dbo.FUserDataBelongPriv ({App.User.ID}, DataBelongID, NULL) = 1").OrderBy(x => x.SortNo).ToListAsync();
#region 处理查询条件
//Expression<Func<Ghrh_Resume, bool>> whereExpression = new Expression<Func<Ghrh_Resume, bool>>();

Loading…
Cancel
Save