11
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -693,6 +694,9 @@ namespace WebAPI.Controllers
|
||||
/// <param name="isIn"></param>
|
||||
/// <param name="changeTime"></param>
|
||||
/// <returns></returns>
|
||||
///
|
||||
[HttpGet]
|
||||
|
||||
public Model.ResponeData getPersonInOut(string projectId, string idCard, int isIn, DateTime changeTime)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
@@ -705,7 +709,7 @@ namespace WebAPI.Controllers
|
||||
IdentityCard = idCard,
|
||||
IsIn = isIn == 1 ? true : false,
|
||||
ChangeTime = changeTime,
|
||||
InOutWay = Const.InOutWay_1,
|
||||
InOutWay = Const.InOutWay_1
|
||||
};
|
||||
|
||||
PersonInOutService.AddPersonInOut(newInOut);
|
||||
@@ -719,6 +723,41 @@ namespace WebAPI.Controllers
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
[HttpPost]
|
||||
public Model.ResponeData getPersonInOut([FromBody] List<Model.APIItem.PersonInOutItem> personInOutItem)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
if (personInOutItem.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<SitePerson_PersonInOut> newInOutList = new List<SitePerson_PersonInOut>();
|
||||
foreach (var item in personInOutItem)
|
||||
{
|
||||
Model.SitePerson_PersonInOut newInOut = new Model.SitePerson_PersonInOut
|
||||
{
|
||||
ProjectId = item.projectId,
|
||||
IdentityCard = item.idCard,
|
||||
IsIn = item.isIn == 1 ? true : false,
|
||||
ChangeTime = item.changeTime,
|
||||
InOutWay = Const.InOutWay_1,
|
||||
Address = item.deviceIp
|
||||
};
|
||||
newInOutList.Add(newInOut);
|
||||
}
|
||||
PersonInOutService.AddPersonInOut(newInOutList);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 保存人员出入记录
|
||||
@@ -819,11 +858,10 @@ namespace WebAPI.Controllers
|
||||
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
|
||||
join traindetail in Funs.DB.EduTrain_TrainRecordDetail on x.PersonId equals traindetail.PersonId
|
||||
join train in Funs.DB.EduTrain_TrainRecord on traindetail.TrainingId equals train.TrainingId
|
||||
where x.ProjectId == projectId && !x.ExchangeTime.HasValue && train.ProjectId == projectId
|
||||
&& x.States == Const.ProjectPersonStates_1 && x.CardNo.Length > 5 && persons.PhotoUrl != null
|
||||
// where personIds.Contains(x.PersonId)
|
||||
join traindetail in Funs.DB.Training_TestRecord on x.PersonId equals traindetail.TestManId
|
||||
where x.ProjectId == projectId && !x.ExchangeTime.HasValue && traindetail.ProjectId == projectId
|
||||
&& x.States == Const.ProjectPersonStates_1 && x.CardNo.Length > 5 && persons.PhotoUrl != null && traindetail.TestScores >= 60
|
||||
// where personIds.Contains(x.PersonId)
|
||||
select new
|
||||
{
|
||||
x.PersonId,
|
||||
@@ -841,7 +879,7 @@ namespace WebAPI.Controllers
|
||||
Funs.DB.ProjectData_TeamGroup.First(z => z.TeamGroupId == x.TeamGroupId).TeamGroupName,
|
||||
persons.Telephone,
|
||||
persons.Address,
|
||||
TrainRecord = APIPersonService.getStrTrainRecordByPersonId(x.PersonId),
|
||||
TrainRecord = APIPersonService.getStrTrainingTestRecordByPersonId(x.PersonId),
|
||||
x.ExchangeTime,
|
||||
x.ExchangeTime2,
|
||||
x.AuditorDate,
|
||||
@@ -985,6 +1023,10 @@ namespace WebAPI.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 获取人员信息出入场记录-查询
|
||||
/// <summary>
|
||||
/// 获取人员信息出入场记录
|
||||
|
||||
Reference in New Issue
Block a user