This commit is contained in:
2024-05-10 14:45:54 +08:00
parent ba518ac354
commit 98c1cad987
12 changed files with 581 additions and 44 deletions
+27 -3
View File
@@ -1,5 +1,8 @@
using BLL;
using Aspose.Words.Lists;
using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
@@ -21,8 +24,29 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
var getDataList = Funs.DB.Sp_APP_GetToDoItems(projectId, userId).ToList();
responeData.data = new { getDataList.Count, getDataList };
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
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)
{
getDataList.Add(item);
ids.Add(item.DataId);
}
foreach (var item in getDataList2)
{
if (!ids.Contains(item.DataId))
{
getDataList.Add(item);
}
}
responeData.data = new { getDataList.Count, getDataList };
}
}
catch (Exception ex)
{