11
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Model.APIItem
|
||||
{
|
||||
public class PersonInOutItem
|
||||
{
|
||||
public string projectId { get; set; }
|
||||
public string idCard { get; set; }
|
||||
public int isIn { get; set; }
|
||||
public DateTime changeTime { get; set; }
|
||||
public string deviceIp { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -146,6 +146,7 @@
|
||||
<Compile Include="APIItem\HSSE\TowerCraneRecordItem.cs" />
|
||||
<Compile Include="APIItem\InspectionBrigadeUserItem.cs" />
|
||||
<Compile Include="APIItem\OperationReportDto.cs" />
|
||||
<Compile Include="APIItem\PersonInOutItem.cs" />
|
||||
<Compile Include="APIItem\ProjectGpsPointItem.cs" />
|
||||
<Compile Include="APIItem\ProjectItem.cs" />
|
||||
<Compile Include="APIItem\HSSE\PunishNoticeItem.cs" />
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SgManager.AI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
using SgManager.AI;
|
||||
using System.Configuration;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
@@ -778,8 +780,39 @@ 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
|
||||
{
|
||||
foreach (var item in personInOutItem)
|
||||
{
|
||||
Task task = Task.Run(() =>
|
||||
{
|
||||
APIDoorServerService.SaveDoorInOutRecord(item.projectId, item.idCard, item.isIn, item.changeTime, "白名单");
|
||||
Task.Delay(1000).Wait(); // 模拟异步操作
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 获取发卡人员
|
||||
/// <summary>
|
||||
/// 获取发卡人员
|
||||
|
||||
Reference in New Issue
Block a user