This commit is contained in:
杨红卫 2021-08-12 10:45:31 +08:00
parent 16bd4f1767
commit bacbffb714
31 changed files with 23671 additions and 53 deletions

View File

@ -898,6 +898,7 @@ namespace BLL
} }
getPerson.ExchangeTime2 = null; getPerson.ExchangeTime2 = null;
getPerson.RealNameUpdateTime = null;
getPerson.IsForeign = person.IsForeign; getPerson.IsForeign = person.IsForeign;
getPerson.IsOutside = person.IsOutside; getPerson.IsOutside = person.IsOutside;
db.SubmitChanges(); db.SubmitChanges();
@ -1153,6 +1154,14 @@ namespace BLL
#region #region
/// <summary> /// <summary>
///
/// </summary>
public static int getPersonInOutListCount
{
get;
set;
}
/// <summary>
/// 获取人员信息出入场记录 /// 获取人员信息出入场记录
/// </summary> /// </summary>
/// <param name="projectId"></param> /// <param name="projectId"></param>
@ -1161,13 +1170,51 @@ namespace BLL
/// <param name="startTime"></param> /// <param name="startTime"></param>
/// <param name="endTime"></param> /// <param name="endTime"></param>
/// <returns></returns> /// <returns></returns>
public static List<Model.PersonInOutItem> getPersonInOutList(string projectId, string userUnitId, string unitId, string workPostId, string strParam, string startTime, string endTime) public static List<Model.PersonInOutItem> getPersonInOutList(string projectId, string userUnitId, string unitId, string workPostId, string strParam, string startTime, string endTime, int pageIndex)
{ {
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{ {
DateTime? startTimeD = Funs.GetNewDateTime(startTime); DateTime? startTimeD = Funs.GetNewDateTime(startTime);
DateTime? endTimeD = Funs.GetNewDateTime(endTime); DateTime? endTimeD = Funs.GetNewDateTime(endTime);
var personInOuts = from x in db.SitePerson_PersonInOut var getPersonInOutList = from x in db.SitePerson_PersonInOut
where x.ProjectId == projectId
select x;
if (!string.IsNullOrEmpty(userUnitId) && userUnitId != Const.UnitId_CWCEC)
{
getPersonInOutList = getPersonInOutList.Where(x => x.UnitId == userUnitId);
}
if (!string.IsNullOrEmpty(unitId))
{
getPersonInOutList = getPersonInOutList.Where(x => x.UnitId == unitId);
}
if (!string.IsNullOrEmpty(workPostId))
{
getPersonInOutList = getPersonInOutList.Where(x => x.WorkPostId == workPostId);
}
if (startTimeD.HasValue)
{
getPersonInOutList = getPersonInOutList.Where(x => x.ChangeTime >= startTimeD);
}
if (endTimeD.HasValue)
{
getPersonInOutList = getPersonInOutList.Where(x => x.ChangeTime <= endTimeD);
}
if (!string.IsNullOrEmpty(strParam))
{
getPersonInOutList = from x in getPersonInOutList
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
where y.ProjectId == projectId && y.PersonName.Contains(strParam)
select x;
}
getPersonListCount = getPersonInOutList.Count();
if (getPersonListCount == 0)
{
return null;
}
else
{
var personInOuts = from x in getPersonInOutList
join y in db.SitePerson_Person on x.PersonId equals y.PersonId join y in db.SitePerson_Person on x.PersonId equals y.PersonId
where x.ProjectId == projectId where x.ProjectId == projectId
select new Model.PersonInOutItem select new Model.PersonInOutItem
@ -1184,61 +1231,53 @@ namespace BLL
ChangeTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ChangeTime), ChangeTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ChangeTime),
ChangeTimeD = x.ChangeTime, ChangeTimeD = x.ChangeTime,
}; };
if (!string.IsNullOrEmpty(userUnitId) && userUnitId != Const.UnitId_CWCEC) if (pageIndex > 0)
{ {
personInOuts = personInOuts.Where(x => x.UnitId == userUnitId); return personInOuts.OrderByDescending(x => x.ChangeTimeD).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
} }
if (!string.IsNullOrEmpty(unitId)) else
{ {
personInOuts = personInOuts.Where(x => x.UnitId == unitId); return personInOuts.ToList();
} }
if (!string.IsNullOrEmpty(workPostId))
{
personInOuts = personInOuts.Where(x => x.WorkPostId == workPostId);
} }
if (startTimeD.HasValue)
{
personInOuts = personInOuts.Where(x => x.ChangeTimeD >= startTimeD);
}
if (endTimeD.HasValue)
{
personInOuts = personInOuts.Where(x => x.ChangeTimeD <= endTimeD);
}
if (!string.IsNullOrEmpty(strParam))
{
personInOuts = personInOuts.Where(x => x.PersonName.Contains(strParam));
}
return personInOuts.OrderByDescending(x => x.ChangeTimeD).ToList();
} }
} }
#endregion #endregion
#region ID获取个人出入场记录 #region ID获取个人出入场记录
/// <summary> /// <summary>
///
/// </summary>
public static int getPersonInOutListByPersonIdCount
{
get;
set;
}
/// <summary>
/// 根据人员ID获取个人出入场记录 /// 根据人员ID获取个人出入场记录
/// </summary> /// </summary>
/// <param name="personId"></param> /// <param name="personId"></param>
/// <param name="startTime"></param> /// <param name="startTime"></param>
/// <param name="endTime"></param> /// <param name="endTime"></param>
/// <returns></returns> /// <returns></returns>
public static List<Model.PersonInOutItem> getPersonInOutListByPersonId(string personId, string startTime, string endTime) public static List<Model.PersonInOutItem> getPersonInOutListByPersonId(string personId, string startTime, string endTime, int pageIndex)
{ {
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{ {
DateTime? startTimeD = Funs.GetNewDateTime(startTime); DateTime? startTimeD = Funs.GetNewDateTime(startTime);
DateTime? endTimeD = Funs.GetNewDateTime(endTime); DateTime? endTimeD = Funs.GetNewDateTime(endTime);
var personInOuts = from x in db.SitePerson_PersonInOut var personInOuts = from x in db.SitePerson_PersonInOut
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
where x.PersonId == personId where x.PersonId == personId
select new Model.PersonInOutItem select new Model.PersonInOutItem
{ {
PersonInOutId =x.PersonInOutId,
PersonId = x.PersonId, PersonId = x.PersonId,
PersonName = y.PersonName, PersonName = db.SitePerson_Person.First(z=>z.PersonId==x.PersonId).PersonName,
ProjectId = x.ProjectId, ProjectId = x.ProjectId,
UnitId = y.UnitId, UnitId = x.UnitId,
UnitName = db.Base_Unit.First(z => z.UnitId == y.UnitId).UnitName, UnitName = db.Base_Unit.First(z => z.UnitId == x.UnitId).UnitName,
WorkPostId = y.WorkPostId, WorkPostId = x.WorkPostId,
WorkPostName = db.Base_WorkPost.First(z => z.WorkPostId == y.WorkPostId).WorkPostName, WorkPostName = db.Base_WorkPost.First(z => z.WorkPostId == x.WorkPostId).WorkPostName,
IsIn = x.IsIn, IsIn = x.IsIn,
IsInName = x.IsIn == true ? "进场" : "出场", IsInName = x.IsIn == true ? "进场" : "出场",
ChangeTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ChangeTime), ChangeTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ChangeTime),
@ -1252,7 +1291,22 @@ namespace BLL
{ {
personInOuts = personInOuts.Where(x => x.ChangeTimeD <= endTimeD); personInOuts = personInOuts.Where(x => x.ChangeTimeD <= endTimeD);
} }
return personInOuts.OrderByDescending(x => x.ChangeTimeD).ToList(); getPersonListCount = personInOuts.Count();
if (getPersonListCount == 0)
{
return null;
}
else
{
if (pageIndex > 0)
{
return personInOuts.OrderByDescending(x => x.ChangeTimeD).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
}
else
{
return personInOuts.ToList();
}
}
} }
} }
#endregion #endregion

View File

@ -717,6 +717,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />
<None Include="bin\Release\BLL.dll.config" />
<None Include="obj\Debug\BLL.csproj.CopyComplete" /> <None Include="obj\Debug\BLL.csproj.CopyComplete" />
<None Include="obj\Debug\BLL.csproj.CoreCompileInputs.cache" /> <None Include="obj\Debug\BLL.csproj.CoreCompileInputs.cache" />
<None Include="obj\Debug\BLL.csprojAssemblyReference.cache" /> <None Include="obj\Debug\BLL.csprojAssemblyReference.cache" />
@ -735,6 +736,31 @@
<None Include="Scripts\jquery-3.5.1.slim.min.map" /> <None Include="Scripts\jquery-3.5.1.slim.min.map" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="bin\Debug\BLL.dll" />
<Content Include="bin\Debug\BLL.pdb" />
<Content Include="bin\Release\AipSdk.dll" />
<Content Include="bin\Release\AOP.Common.dll" />
<Content Include="bin\Release\Apache.NMS.ActiveMQ.dll" />
<Content Include="bin\Release\Apache.NMS.ActiveMQ.pdb" />
<Content Include="bin\Release\Apache.NMS.ActiveMQ.xml" />
<Content Include="bin\Release\BLL.dll" />
<Content Include="bin\Release\BLL.pdb" />
<Content Include="bin\Release\EmitMapper.dll" />
<Content Include="bin\Release\FineUIPro.dll" />
<Content Include="bin\Release\FineUIPro.xml" />
<Content Include="bin\Release\Microsoft.QualityTools.Testing.Fakes.dll" />
<Content Include="bin\Release\Microsoft.SqlServer.DTSPipelineWrap.dll" />
<Content Include="bin\Release\Microsoft.SqlServer.DTSRuntimeWrap.dll" />
<Content Include="bin\Release\Microsoft.SQLServer.ManagedDTS.dll" />
<Content Include="bin\Release\Microsoft.SqlServer.PipelineHost.dll" />
<Content Include="bin\Release\Model.dll" />
<Content Include="bin\Release\Model.pdb" />
<Content Include="bin\Release\Newtonsoft.Json.dll" />
<Content Include="bin\Release\Newtonsoft.Json.xml" />
<Content Include="bin\Release\SgManager.AI.dll" />
<Content Include="bin\Release\SgManager.AI.pdb" />
<Content Include="bin\Release\ThoughtWorks.QRCode.dll" />
<Content Include="bin\Release\zh-Hans\Microsoft.QualityTools.Testing.Fakes.resources.dll" />
<Content Include="obj\Debug\BLL.csproj.FileListAbsolute.txt" /> <Content Include="obj\Debug\BLL.csproj.FileListAbsolute.txt" />
<Content Include="obj\Debug\BLL.dll" /> <Content Include="obj\Debug\BLL.dll" />
<Content Include="obj\Debug\BLL.pdb" /> <Content Include="obj\Debug\BLL.pdb" />

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -189,6 +189,20 @@
<Compile Include="APIItem\ResponeData.cs" /> <Compile Include="APIItem\ResponeData.cs" />
<Compile Include="SpTDesktopItem.cs" /> <Compile Include="SpTDesktopItem.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="bin\Debug\EmitMapper.dll" />
<Content Include="bin\Debug\Model.dll" />
<Content Include="bin\Debug\Model.pdb" />
<Content Include="bin\Debug\Newtonsoft.Json.dll" />
<Content Include="bin\Debug\Newtonsoft.Json.pdb" />
<Content Include="bin\Debug\Newtonsoft.Json.xml" />
<Content Include="bin\Release\EmitMapper.dll" />
<Content Include="bin\Release\Model.dll" />
<Content Include="bin\Release\Model.pdb" />
<Content Include="bin\Release\Newtonsoft.Json.dll" />
<Content Include="bin\Release\Newtonsoft.Json.pdb" />
<Content Include="bin\Release\Newtonsoft.Json.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -27,7 +27,6 @@ namespace WebAPI.Controllers
{ {
return new return new
{ {
code = 0,
data = new { token = Const.sysglyId }, data = new { token = Const.sysglyId },
tokenExpires = Funs.ConvertDateTimeToInt32(DateTime.Now.AddMonths(1)), tokenExpires = Funs.ConvertDateTimeToInt32(DateTime.Now.AddMonths(1)),
}; };

View File

@ -88,7 +88,7 @@ namespace WebAPI.Controllers
APIPersonService.getPersonInOut(facerecord.ProjectId, facerecord.EmployNO, isIn, facerecord.DateTimeRecord.Value); APIPersonService.getPersonInOut(facerecord.ProjectId, facerecord.EmployNO, isIn, facerecord.DateTimeRecord.Value);
} }
} }
responeData.code = 0;
} }
} }
else else
@ -98,7 +98,7 @@ namespace WebAPI.Controllers
} }
catch (Exception ex) catch (Exception ex)
{ {
responeData.code = -1; responeData.code = 0;
responeData.message = ex.Message; responeData.message = ex.Message;
} }
@ -118,7 +118,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData(); var responeData = new Model.ResponeData();
try try
{ {
responeData.code = 0;
if (person != null ) if (person != null )
{ {
responeData.message="success"; responeData.message="success";
@ -130,7 +130,7 @@ namespace WebAPI.Controllers
} }
catch (Exception ex) catch (Exception ex)
{ {
responeData.code = -1; responeData.code = 0;
responeData.message = ex.Message; responeData.message = ex.Message;
} }

View File

@ -966,12 +966,8 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData(); var responeData = new Model.ResponeData();
try try
{ {
var getDataList = APIPersonService.getPersonInOutList(projectId, userUnitId, unitId, workPostId, strParam, startTime, endTime); var getDataList = APIPersonService.getPersonInOutList(projectId, userUnitId, unitId, workPostId, strParam, startTime, endTime, pageIndex);
int pageCount = getDataList.Count(); int pageCount = APIPersonService.getPersonInOutListCount;
if (pageCount > 0 && pageIndex > 0)
{
getDataList = getDataList.Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
}
responeData.data = new { pageCount, getDataList }; responeData.data = new { pageCount, getDataList };
} }
catch (Exception ex) catch (Exception ex)
@ -997,12 +993,8 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData(); var responeData = new Model.ResponeData();
try try
{ {
var getDataList = APIPersonService.getPersonInOutListByPersonId(personId, startTime, endTime); var getDataList = APIPersonService.getPersonInOutListByPersonId(personId, startTime, endTime, pageIndex);
int pageCount = getDataList.Count(); int pageCount = APIPersonService.getPersonInOutListByPersonIdCount;
if (pageCount > 0 && pageIndex > 0)
{
getDataList = getDataList.Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
}
responeData.data = new { pageCount, getDataList }; responeData.data = new { pageCount, getDataList };
} }
catch (Exception ex) catch (Exception ex)

View File

@ -243,6 +243,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Areas\HelpPage\HelpPage.css" /> <Content Include="Areas\HelpPage\HelpPage.css" />
<Content Include="bin\WebAPI.dll" />
<Content Include="bin\WebAPI.pdb" />
<Content Include="Content\bootstrap-theme.css" /> <Content Include="Content\bootstrap-theme.css" />
<Content Include="Content\bootstrap-theme.min.css" /> <Content Include="Content\bootstrap-theme.min.css" />
<Content Include="Content\bootstrap.css" /> <Content Include="Content\bootstrap.css" />