2023-03-09 安全首页修改

This commit is contained in:
2023-03-09 15:23:32 +08:00
parent 3f158f1a70
commit 4d4d4dfdd0
15 changed files with 775 additions and 175 deletions
@@ -498,5 +498,85 @@ namespace WebAPI.Controllers
return responeData;
}
#endregion
#region
/// <summary>
/// 获取在岗人员
/// </summary>
/// <param name="projectCode"></param>
/// <returns></returns>
public Model.ResponeData getRealNamePersons(string projectCode)
{
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)
{
responeData.data = (from x in db.SitePerson_Person
join y in db.Base_Unit on x.UnitId equals y.UnitId
join T in db.ProjectData_TeamGroup on x.TeamGroupId equals T.TeamGroupId
join w in db.Base_WorkPost on x.WorkPostId equals w.WorkPostId
where x.ProjectId == getProject.ProjectId && (!x.ExchangeTime.HasValue || !x.ExchangeTime2.HasValue)
//&& (!x.OutTime.HasValue || x.OutTime > DateTime.Now)
//&& x.InTime.HasValue && x.InTime < DateTime.Now
&& x.IsUsed == 1
&& x.PhotoUrl != null
select new Model.RealNamePersonItem
{
projectCode = getProject.ProjectCode,
projectName = getProject.ProjectName,
unitName = y.UnitName,
collCropCode = y.CollCropCode,
teamGroupName = T.TeamGroupName,
name = x.PersonName,
idcardType = "SHENFEN_ZHENGJIAN",
idcardNumber = x.IdentityCard,
idcardStartDate = x.IdcardStartDate.HasValue ? string.Format("{0:yyyy-MM-dd}", x.IdcardStartDate) : null,
idcardEndDate = x.IdcardEndDate.HasValue ? string.Format("{0:yyyy-MM-dd}", x.IdcardEndDate) : (x.IdcardStartDate.HasValue ? string.Format("{0:yyyy-MM-dd}", x.IdcardStartDate.Value.AddYears(30)) : null),
idcardForever = x.IdcardStartDate.HasValue ? "N" : "Y",
politicsStatus = x.PoliticsStatus,
eduLevel = x.EduLevel,
maritalStatus = x.MaritalStatus,
sex = (x.Sex == "2" ? "F" : "M"),
idcardAddress = x.IdcardAddress,
homeAddress = x.Address,
birthday = x.Birthday.HasValue ? string.Format("{0:yyyy-MM-dd}", x.Birthday) : null,
nation = x.Nation,
countryCode = x.CountryCode,
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,
mobile = x.Telephone,
teamLeaderFlag = (T.GroupLeaderId == x.PersonId ? "Y" : "N"),
userType = ((w.PostType == "1" || w.PostType == "4") ? "LAB_USER_MANAGE" : "LAB_USER_BULIDER"),
workType = w.WorkPostCode,
workPostName = w.WorkPostName,
isLeave = x.OutTime.HasValue ? "Y" : "N",
entryTime = x.InTime.HasValue ? string.Format("{0:yyyy-MM-dd}", x.InTime) : null,
exitTime = x.OutTime.HasValue ? string.Format("{0:yyyy-MM-dd}", x.OutTime) : null,
}).ToList();
}
else
{
responeData.code = 0;
responeData.message = "数据为空!";
}
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
ErrLogInfo.WriteLog(ex, "WX接口-获取人员下发门禁", "DoorServiceController.getPersons");
}
return responeData;
}
#endregion
}
}
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<DeleteExistingFiles>false</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\app.publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
</PropertyGroup>
</Project>