20230726获取培训人员单位必填修改为按传参判断

This commit is contained in:
2023-07-26 10:00:22 +08:00
parent d697537212
commit bf48c3782a
3 changed files with 10 additions and 14 deletions
+8 -2
View File
@@ -447,9 +447,9 @@ namespace BLL
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
List<string> unitIdList = Funs.GetStrListByStr(unitIds, ',');
var getPersons = from x in db.View_SitePerson_Person
where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.States == Const.ProjectPersonStates_1
where x.ProjectId == projectId && x.States == Const.ProjectPersonStates_1
select new Model.PersonItem
{
SitePersonId = x.SitePersonId,
@@ -476,6 +476,12 @@ namespace BLL
PhotoUrl = x.PhotoUrl,
DepartName = x.DepartName,
};
if (!string.IsNullOrEmpty(unitIds))
{
List<string> unitIdList = Funs.GetStrListByStr(unitIds, ',');
getPersons = getPersons.Where(x => unitIdList.Contains(x.UnitId));
}
if (!string.IsNullOrEmpty(workPostIds))
{
List<string> workPostIdList = Funs.GetStrListByStr(workPostIds, ',');