修改代办控制器
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user