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

View File

@ -717,6 +717,7 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="bin\Release\BLL.dll.config" />
<None Include="obj\Debug\BLL.csproj.CopyComplete" />
<None Include="obj\Debug\BLL.csproj.CoreCompileInputs.cache" />
<None Include="obj\Debug\BLL.csprojAssemblyReference.cache" />
@ -735,6 +736,31 @@
<None Include="Scripts\jquery-3.5.1.slim.min.map" />
</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.dll" />
<Content Include="obj\Debug\BLL.pdb" />

View File

@ -333,7 +333,7 @@ namespace BLL
if (!newPerson.OutTime.HasValue)
{
newPerson.OutTime = null;
newPerson.ExchangeTime = null;
newPerson.ExchangeTime = null;
}
newPerson.ExchangeTime2 = null;
newPerson.RealNameUpdateTime = null;

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="SpTDesktopItem.cs" />
</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" />
<!-- 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.

View File

@ -22,12 +22,11 @@ namespace WebAPI.Controllers
/// <param name="appId"></param>
/// <param name="appSecret"></param>
/// <returns></returns>
[HttpGet]
[HttpGet]
public object token(string projectId, string appId, string appSecret)
{
return new
{
code = 0,
data = new { token = Const.sysglyId },
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);
}
}
responeData.code = 0;
}
}
else
@ -98,7 +98,7 @@ namespace WebAPI.Controllers
}
catch (Exception ex)
{
responeData.code = -1;
responeData.code = 0;
responeData.message = ex.Message;
}
@ -118,7 +118,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
responeData.code = 0;
if (person != null )
{
responeData.message="success";
@ -130,7 +130,7 @@ namespace WebAPI.Controllers
}
catch (Exception ex)
{
responeData.code = -1;
responeData.code = 0;
responeData.message = ex.Message;
}

View File

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

View File

@ -243,6 +243,8 @@
</ItemGroup>
<ItemGroup>
<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.min.css" />
<Content Include="Content\bootstrap.css" />