修改代办控制器

This commit is contained in:
2024-05-21 11:28:06 +08:00
parent 0aac9cb8fc
commit 311027831d
3 changed files with 521 additions and 6 deletions
+10 -5
View File
@@ -29,7 +29,6 @@ namespace WebAPI.Controllers
var user = db.Sys_User.FirstOrDefault(x => x.UserId == userId);
var person = db.SitePerson_Person.FirstOrDefault(x => x.ProjectId == projectId && x.IdentityCard == user.IdentityCard);
var getDataList1 = db.Sp_APP_GetToDoItems(projectId, userId).ToList();
var getDataList2 = db.Sp_APP_GetToDoItems(projectId, person.PersonId).ToList();
List<ToDoItem> getDataList = new List<ToDoItem>();
HashSet<string> ids = new HashSet<string>();
foreach (var item in getDataList1)
@@ -37,14 +36,20 @@ namespace WebAPI.Controllers
getDataList.Add(item);
ids.Add(item.DataId);
}
foreach (var item in getDataList2)
if (person != null)
{
if (!ids.Contains(item.DataId))
var getDataList2 = db.Sp_APP_GetToDoItems(projectId, person.PersonId).ToList();
foreach (var item in getDataList2)
{
getDataList.Add(item);
if (!ids.Contains(item.DataId))
{
getDataList.Add(item);
}
}
}
responeData.data = new { getDataList.Count, getDataList };
}
}