更新离场人员

This commit is contained in:
2025-03-04 14:47:01 +08:00
parent 90d91d30da
commit 977ca816fb
2 changed files with 103 additions and 0 deletions
@@ -757,6 +757,51 @@ namespace WebAPI.Controllers
}
return responeData;
}
public Model.ResponeData getAllPersonDataExchange(string projectId)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
join persons in Funs.DB.Person_Persons on x.IdentityCard equals persons.IdentityCard
where x.ProjectId == projectId && !x.ExchangeTime.HasValue
&& x.States == Const.ProjectPersonStates_1 && x.CardNo.Length > 5 && persons.PhotoUrl != null
select new
{
x.PersonId,
x.SitePersonId,
x.PersonName,
x.CardNo,
x.IdentityCard,
x.UnitId,
y.UnitCode,
y.UnitName,
x.InTime,
y.ShortUnitName,
Sex = persons.Sex ?? "1",
Funs.DB.Base_WorkPost.First(z => z.WorkPostId == x.WorkPostId).WorkPostName,
Funs.DB.ProjectData_TeamGroup.First(z => z.TeamGroupId == x.TeamGroupId).TeamGroupName,
persons.Telephone,
persons.Address,
TrainRecord = APIPersonService.getStrTrainRecordByPersonId(x.PersonId),
x.ExchangeTime,
x.ExchangeTime2,
x.AuditorDate,
PhotoUrl = persons.PhotoUrl.Replace('\\', '/'),
IsUsed = x.States == Const.ProjectPersonStates_1 ? 1 : 0,
BlackList = 0
}).Take(200).ToList();
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
ErrLogInfo.WriteLog(ex, "WX接口-获取人员下发门禁", "PersonController.getPersonDataExchange");
}
return responeData;
}
#endregion