20230313修改更新人员状态接口方法

This commit is contained in:
2023-03-13 16:50:22 +08:00
parent 30e0673db6
commit 065af2b532
7 changed files with 70 additions and 67 deletions
@@ -372,54 +372,7 @@ namespace WebAPI.Controllers
}
#endregion
#region
/// <summary>
/// 更新人员数据交换时间
/// </summary>
/// <param name="projectCode"></param>
/// <param name="idCard"></param>
/// <param name="type"></param>
/// <returns></returns>
public Model.ResponeData getUpdatePersonExchangeTime(string projectCode, string idCard, string type)
{
var responeData = new Model.ResponeData();
try
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getProject = db.Base_Project.FirstOrDefault(e => e.ProjectCode == projectCode);
if (getProject != null)
{
var getPerson = db.SitePerson_Person.FirstOrDefault(e => e.ProjectId == getProject.ProjectId && e.IdentityCard == idCard);
if (getPerson != null && !string.IsNullOrEmpty(type))
{
if (type == "1")
{
getPerson.ExchangeTime2 = DateTime.Now;
if (!getPerson.ExchangeTime.HasValue)
{
getPerson.ExchangeTime = DateTime.Now;
}
}
else
{
getPerson.ExchangeTime = DateTime.Now;
}
db.SubmitChanges();
}
}
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
ErrLogInfo.WriteLog(ex, "WX接口-更新人员数据交换时间", "PersonController.getUpdatePersonExchangeTime");
}
return responeData;
}
#endregion
#region
/// <summary>
/// 获取离场人员
@@ -549,7 +502,7 @@ namespace WebAPI.Controllers
provinceCode = x.ProvinceCode,
positiveIdcardImage = db.AttachFile.First(t => (x.PersonId + "#1") == t.ToKeyId).ImageByte,
negativeIdcardImage = db.AttachFile.First(t => (x.PersonId + "#5") == t.ToKeyId).ImageByte,
headImage = x.HeadImage,
// headImage = x.HeadImage,
mobile = x.Telephone,
teamLeaderFlag = (T.GroupLeaderId == x.PersonId ? "Y" : "N"),
userType = ((w.PostType == "1" || w.PostType == "4") ? "LAB_USER_MANAGE" : "LAB_USER_BULIDER"),
@@ -577,6 +530,52 @@ namespace WebAPI.Controllers
}
#endregion
#region
/// <summary>
/// 更新人员数据交换时间
/// </summary>
/// <param name="projectCode"></param>
/// <param name="idCard"></param>
/// <param name="type"></param>
/// <returns></returns>
public Model.ResponeData getUpdatePersonExchangeTime(string projectCode, string idCard, string type)
{
var responeData = new Model.ResponeData();
try
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getProject = db.Base_Project.FirstOrDefault(e => e.ProjectCode == projectCode);
if (getProject != null)
{
var getPerson = db.SitePerson_Person.FirstOrDefault(e => e.ProjectId == getProject.ProjectId && e.IdentityCard == idCard);
if (getPerson != null && !string.IsNullOrEmpty(type))
{
getPerson.ExchangeTime2 = DateTime.Now;
if (type == "1")
{
if (!getPerson.ExchangeTime.HasValue)
{
getPerson.ExchangeTime = DateTime.Now;
}
}
else
{
getPerson.ExchangeTime = DateTime.Now;
}
db.SubmitChanges();
}
}
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
ErrLogInfo.WriteLog(ex, "WX接口-更新人员数据交换时间", "PersonController.getUpdatePersonExchangeTime");
}
return responeData;
}
#endregion
}
}
+7 -8
View File
@@ -51,18 +51,21 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Apache.NMS.Fakes">
<HintPath>bin\Apache.NMS.Fakes.dll</HintPath>
<HintPath>..\FineUIPro\Reference BLL\Apache.NMS.Fakes.dll</HintPath>
</Reference>
<Reference Include="Aspose.Words">
<HintPath>bin\Aspose.Words.dll</HintPath>
<HintPath>..\FineUIPro\Reference BLL\Aspose.Words.dll</HintPath>
</Reference>
<Reference Include="FineUIPro, Version=6.3.0.0, Culture=neutral, PublicKeyToken=9cbe753c029f291a">
<HintPath>..\FineUIPro\FineUIPro.dll</HintPath>
</Reference>
<Reference Include="FineUIPro, Version=6.3.0.0, Culture=neutral, PublicKeyToken=9cbe753c029f291a" />
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>bin\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Pipelines.Sockets.Unofficial, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42ea0a778e13fbe2, processorArchitecture=MSIL">
<HintPath>..\packages\Pipelines.Sockets.Unofficial.2.2.2\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath>
@@ -172,10 +175,6 @@
<Private>True</Private>
<HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
</Reference>
<Reference Include="Antlr3.Runtime">
<Private>True</Private>
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">