20230426新增功能:分公司且本部角色账号能在本部和项目登录、切换。
This commit is contained in:
@@ -56,12 +56,12 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="sitePersonId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.PersonItem getPersonBySitePersonId(string sitePersonId)
|
||||
public static Model.PersonItem getPersonBySitePersonId(string sitePersonId, string projectId, string idcard)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.PersonItem person = new Model.PersonItem();
|
||||
var getProjectPerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == sitePersonId);
|
||||
var getProjectPerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == sitePersonId || (x.ProjectId == projectId && x.IdentityCard == idcard));
|
||||
if (getProjectPerson != null)
|
||||
{
|
||||
person.SitePersonId = getProjectPerson.SitePersonId;
|
||||
@@ -70,6 +70,7 @@ namespace BLL
|
||||
person.CardNo = getProjectPerson.CardNo;
|
||||
person.PersonName = getProjectPerson.PersonName;
|
||||
person.IdentityCard = getProjectPerson.IdentityCard;
|
||||
idcard = getProjectPerson.IdentityCard;
|
||||
person.ProjectId = getProjectPerson.ProjectId;
|
||||
var getProject = db.Base_Project.FirstOrDefault(x => x.ProjectId == getProjectPerson.ProjectId);
|
||||
if (getProject != null)
|
||||
@@ -124,74 +125,90 @@ namespace BLL
|
||||
{
|
||||
person.AuditorId = getA.PersonId;
|
||||
person.AuditorName = getA.PersonName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
person.AuditorDate = string.Format("{0:yyyy-MM-dd}", getProjectPerson.AuditorDate);
|
||||
person.AttachUrl2 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#2", null);
|
||||
person.AttachUrl3 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#3", null);
|
||||
person.AttachUrl4 = getAttachUrl4(getProjectPerson.PersonId);
|
||||
//person.AttachUrl5 = APIUpLoadFileService.getFileUrl(personId + "#5", null);
|
||||
|
||||
var getPerson = db.Person_Persons.FirstOrDefault(x => x.PersonId == getProjectPerson.PersonId);
|
||||
if (getPerson != null)
|
||||
}
|
||||
var getPerson = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == idcard);
|
||||
if (getPerson != null)
|
||||
{
|
||||
person.PersonId = getPerson.PersonId;
|
||||
person.PersonName = getPerson.PersonName;
|
||||
person.IdentityCard = getPerson.IdentityCard;
|
||||
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(getProjectPerson.PersonId + "#1", null) : getPerson.IDCardUrl.Replace('\\', '/');
|
||||
person.AttachUrl5 = getPerson.IDCardBackUrl == null ? APIUpLoadFileService.getFileUrl(getProjectPerson.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;
|
||||
person.UnitId = getPerson.UnitId;
|
||||
var gettUnit = db.Base_Unit.FirstOrDefault(x => x.UnitId == getPerson.UnitId);
|
||||
if (gettUnit != null)
|
||||
{
|
||||
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(getProjectPerson.PersonId + "#1", null) : getPerson.IDCardUrl.Replace('\\', '/');
|
||||
person.AttachUrl5 = getPerson.IDCardBackUrl == null ? APIUpLoadFileService.getFileUrl(getProjectPerson.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.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;
|
||||
}
|
||||
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_BasicData2.DictName;
|
||||
}
|
||||
person.MaritalStatus = getPerson.MaritalStatus;
|
||||
var getRealName_BasicData3 = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.MaritalStatus);
|
||||
if (getRealName_BasicData3 != null)
|
||||
{
|
||||
person.MaritalStatusName = getRealName_BasicData3.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;
|
||||
}
|
||||
}
|
||||
|
||||
return person;
|
||||
}
|
||||
}
|
||||
@@ -227,132 +244,6 @@ 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获取人员信息
|
||||
/// </summary>
|
||||
/// <param name="personId"></param>
|
||||
/// <returns></returns>
|
||||
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)
|
||||
{
|
||||
return getPersonBySitePersonId(getPerson.SitePersonId);
|
||||
}
|
||||
else
|
||||
{
|
||||
var getPersons = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == identityCard || x.PersonId == identityCard);
|
||||
if (getPersons != null)
|
||||
{
|
||||
return getPersonByPersonId(getPersons.PersonId);
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据projectId、unitid获取人员信息
|
||||
/// <summary>
|
||||
/// 根据projectId、unitid获取人员信息
|
||||
|
||||
Reference in New Issue
Block a user