20230425 修改扫描人员二维码接口
This commit is contained in:
@@ -50,7 +50,7 @@ namespace BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据personId获取人员信息
|
||||
#region 根据personId获取人员信息 -项目人员 及人员信息
|
||||
/// <summary>
|
||||
/// 根据personId获取人员信息
|
||||
/// </summary>
|
||||
@@ -190,10 +190,8 @@ namespace BLL
|
||||
{
|
||||
person.ProvinceName = getRealName_City.Cname;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return person;
|
||||
}
|
||||
}
|
||||
@@ -228,6 +226,102 @@ namespace BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据personId获取人员信息
|
||||
/// <summary>
|
||||
/// 根据personId获取人员信息
|
||||
/// </summary>
|
||||
/// <param name="personId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.PersonItem getPersonByPersonId(string personId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.PersonItem person = new Model.PersonItem();
|
||||
var getPerson = db.Person_Persons.FirstOrDefault(x => x.PersonId == personId);
|
||||
if (getPerson != null)
|
||||
{
|
||||
person.PersonId = getPerson.PersonId;
|
||||
person.IdentityCard = getPerson.IdentityCard;
|
||||
person.PersonName = getPerson.PersonName;
|
||||
person.UnitId = getPerson.UnitId;
|
||||
var gettUnit = db.Base_Unit.FirstOrDefault(x => x.UnitId == getPerson.UnitId);
|
||||
if (gettUnit != null)
|
||||
{
|
||||
person.UnitCode = gettUnit.UnitCode;
|
||||
person.UnitName = gettUnit.UnitName;
|
||||
}
|
||||
person.WorkPostId = getPerson.WorkPostId;
|
||||
var getWorkPost = db.Base_WorkPost.FirstOrDefault(x => x.WorkPostId == getPerson.WorkPostId);
|
||||
if (getWorkPost != null)
|
||||
{
|
||||
person.WorkPostName = getWorkPost.WorkPostName;
|
||||
}
|
||||
person.Sex = getPerson.Sex;
|
||||
person.SexName = getPerson.Sex == "1" ? "男" : "女";
|
||||
person.Address = getPerson.Address;
|
||||
person.Telephone = getPerson.Telephone;
|
||||
person.PhotoUrl = getPerson.PhotoUrl;
|
||||
person.IsForeign = getPerson.IsForeign.HasValue ? getPerson.IsForeign : false;
|
||||
person.PersonType = getPerson.PersonType;
|
||||
person.PersonTypeName = DropListService.getPersonTypeNameByValue(getPerson.PersonType);
|
||||
person.AttachUrl1 = getPerson.IDCardUrl == null ? APIUpLoadFileService.getFileUrl(getPerson.PersonId + "#1", null) : getPerson.IDCardUrl.Replace('\\', '/');
|
||||
person.AttachUrl5 = getPerson.IDCardBackUrl == null ? APIUpLoadFileService.getFileUrl(getPerson.PersonId + "#5", null) : getPerson.IDCardBackUrl.Replace('\\', '/');
|
||||
person.IdcardType = getPerson.IdcardType;
|
||||
person.IdcardTypeName = "身份证";
|
||||
person.IdcardStartDate = string.Format("{0:yyyy-MM-dd}", getPerson.IdcardStartDate);
|
||||
person.IdcardEndDate = string.Format("{0:yyyy-MM-dd}", getPerson.IdcardEndDate);
|
||||
person.IdcardForever = getPerson.IdcardForever;
|
||||
person.IdcardForeverStr = getPerson.IdcardForever == "Y" ? "是" : "否";
|
||||
person.PoliticsStatus = getPerson.PoliticsStatus;
|
||||
var getRealName_BasicData = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.PoliticsStatus);
|
||||
if (getRealName_BasicData != null)
|
||||
{
|
||||
person.PoliticsStatusName = getRealName_BasicData.DictName;
|
||||
}
|
||||
person.IdcardAddress = getPerson.IdcardAddress;
|
||||
person.Nation = getPerson.Nation;
|
||||
var getRealName_BasicData1 = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.Nation);
|
||||
if (getRealName_BasicData1 != null)
|
||||
{
|
||||
person.NationName = getRealName_BasicData1.DictName;
|
||||
}
|
||||
person.EduLevel = getPerson.EduLevel;
|
||||
var getRealName_BasicData2 = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.EduLevel);
|
||||
if (getRealName_BasicData2 != null)
|
||||
{
|
||||
person.EduLevelName = getRealName_BasicData1.DictName;
|
||||
}
|
||||
person.MaritalStatus = getPerson.MaritalStatus;
|
||||
var getRealName_BasicData3 = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.MaritalStatus);
|
||||
if (getRealName_BasicData3 != null)
|
||||
{
|
||||
person.MaritalStatusName = getRealName_BasicData1.DictName;
|
||||
}
|
||||
person.CountryCode = getPerson.CountryCode;
|
||||
var getRealName_Country = db.RealName_Country.FirstOrDefault(x => x.CountryId == getPerson.CountryCode);
|
||||
if (getRealName_Country != null)
|
||||
{
|
||||
person.CountryName = getRealName_Country.Cname;
|
||||
}
|
||||
person.ProvinceCode = getPerson.ProvinceCode;
|
||||
var getRealName_City = db.RealName_City.FirstOrDefault(x => x.CountryId == getPerson.CountryCode && x.ProvinceCode == getPerson.ProvinceCode);
|
||||
if (getRealName_City != null)
|
||||
{
|
||||
person.ProvinceName = getRealName_City.Cname;
|
||||
}
|
||||
|
||||
person.AttachUrl2 = APIUpLoadFileService.getFileUrl(getPerson.PersonId + "#2", null);
|
||||
person.AttachUrl3 = APIUpLoadFileService.getFileUrl(getPerson.PersonId + "#3", null);
|
||||
person.AttachUrl4 = getAttachUrl4(getPerson.PersonId);
|
||||
}
|
||||
|
||||
return person;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 根据personId获取人员信息
|
||||
/// <summary>
|
||||
/// 根据personId获取人员信息
|
||||
@@ -237,7 +331,7 @@ namespace BLL
|
||||
public static Model.PersonItem getPersonByProjectIdIdentityCard(string projectId, string identityCard)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
{
|
||||
var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.ProjectId == projectId && (x.PersonId == identityCard || x.IdentityCard == identityCard));
|
||||
if (getPerson != null)
|
||||
{
|
||||
@@ -245,7 +339,15 @@ namespace BLL
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
var getPersons = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == identityCard || x.PersonId == identityCard);
|
||||
if (getPersons != null)
|
||||
{
|
||||
return getPersonByPersonId(getPersons.PersonId);
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user