0510
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user