From 71028ea93280923a9f79a2d9ddcfbb9bc855eca9 Mon Sep 17 00:00:00 2001 From: yhw0507 Date: Wed, 26 Apr 2023 15:50:30 +0800 Subject: [PATCH] =?UTF-8?q?20230426=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=9A=E5=88=86=E5=85=AC=E5=8F=B8=E4=B8=94=E6=9C=AC=E9=83=A8?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E8=B4=A6=E5=8F=B7=E8=83=BD=E5=9C=A8=E6=9C=AC?= =?UTF-8?q?=E9=83=A8=E5=92=8C=E9=A1=B9=E7=9B=AE=E7=99=BB=E5=BD=95=E3=80=81?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SGGLDB_V2023-04-26-001版本日志.txt | 3 + .../SGGLDB_2023-03-08_子公司实业脚本.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-07.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-09.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-13.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-14.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-15.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-16 lpf.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-16.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-17.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-21.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-22.sql | Bin .../{ => 已更新脚本}/SGGLDB_V2023-03-24-002.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-24.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-27-001.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-03-29_lpf.sql | 0 .../SGGLDB_V2023-03-30_gaofei.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-04-04_lpf.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-04-19_lpf.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-04-24_lpf.sql | 0 .../{ => 已更新脚本}/SGGLDB_V2023-04-25_lpf.sql | 0 SGGL/BLL/API/APIPersonService.cs | 263 +++++------------- SGGL/BLL/Common/CommonService.cs | 23 ++ SGGL/FineUIPro.Web/indexProject.aspx.cs | 4 +- SGGL/WebAPI/Controllers/PersonController.cs | 4 +- .../PublishProfiles/FolderProfile2.pubxml | 7 +- SGGL/WebAPI/WebAPI.csproj | 2 +- 27 files changed, 112 insertions(+), 194 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2023-04-26-001版本日志.txt rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_2023-03-08_子公司实业脚本.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-07.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-09.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-13.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-14.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-15.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-16 lpf.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-16.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-17.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-21.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-22.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-24-002.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-24.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-27-001.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-29_lpf.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-03-30_gaofei.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-04-04_lpf.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-04-19_lpf.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-04-24_lpf.sql (100%) rename DataBase/版本日志/{ => 已更新脚本}/SGGLDB_V2023-04-25_lpf.sql (100%) diff --git a/DataBase/版本日志/SGGLDB_V2023-04-26-001版本日志.txt b/DataBase/版本日志/SGGLDB_V2023-04-26-001版本日志.txt new file mode 100644 index 00000000..99748acc --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-04-26-001版本日志.txt @@ -0,0 +1,3 @@ +--ADD BY YangHongwei 2023-04-26 +1、新增功能:分公司且本部角色账号能在本部和项目登录、切换。 +--END \ No newline at end of file diff --git a/DataBase/版本日志/SGGLDB_2023-03-08_子公司实业脚本.sql b/DataBase/版本日志/已更新脚本/SGGLDB_2023-03-08_子公司实业脚本.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_2023-03-08_子公司实业脚本.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_2023-03-08_子公司实业脚本.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-07.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-07.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-07.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-07.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-09.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-09.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-09.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-09.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-13.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-13.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-13.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-13.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-14.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-14.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-14.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-14.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-15.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-15.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-15.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-15.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-16 lpf.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-16 lpf.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-16 lpf.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-16 lpf.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-16.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-16.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-16.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-16.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-17.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-17.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-17.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-17.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-21.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-21.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-21.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-21.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-22.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-22.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-22.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-22.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-24-002.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-24-002.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-24-002.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-24-002.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-24.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-24.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-24.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-24.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-27-001.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-27-001.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-27-001.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-27-001.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-29_lpf.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-29_lpf.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-29_lpf.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-29_lpf.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-03-30_gaofei.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-30_gaofei.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-03-30_gaofei.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-03-30_gaofei.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-04-04_lpf.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-04-04_lpf.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-04-04_lpf.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-04-04_lpf.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-04-19_lpf.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-04-19_lpf.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-04-19_lpf.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-04-19_lpf.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-04-24_lpf.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-04-24_lpf.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-04-24_lpf.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-04-24_lpf.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-04-25_lpf.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-04-25_lpf.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-04-25_lpf.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-04-25_lpf.sql diff --git a/SGGL/BLL/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs index 5ea7ad8e..67f27231 100644 --- a/SGGL/BLL/API/APIPersonService.cs +++ b/SGGL/BLL/API/APIPersonService.cs @@ -56,12 +56,12 @@ namespace BLL /// /// /// - 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获取人员信息 - /// - /// 根据personId获取人员信息 - /// - /// - /// - 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获取人员信息 - /// - /// 根据personId获取人员信息 - /// - /// - /// - 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获取人员信息 /// /// 根据projectId、unitid获取人员信息 diff --git a/SGGL/BLL/Common/CommonService.cs b/SGGL/BLL/Common/CommonService.cs index 5e055931..beaa8f91 100644 --- a/SGGL/BLL/Common/CommonService.cs +++ b/SGGL/BLL/Common/CommonService.cs @@ -327,6 +327,29 @@ namespace BLL } #endregion + /// + /// 是否赛鼎或分公司 + /// + /// + /// + public static bool IsSedinOrSub(string unitId) + { + bool result = false; + if (unitId == Const.UnitId_SEDIN) + { + result = true; + } + else + { + var uinit =UnitService.GetUnitByUnitId(unitId); + if (uinit != null && uinit.IsBranch ==true) + { + result = true; + } + } + return result; + } + #region 根据用户Id判断是否为本单位用户或管理员 /// /// 根据用户UnitId判断是否为本单位用户或管理员 diff --git a/SGGL/FineUIPro.Web/indexProject.aspx.cs b/SGGL/FineUIPro.Web/indexProject.aspx.cs index 71d4b2d7..12e77266 100644 --- a/SGGL/FineUIPro.Web/indexProject.aspx.cs +++ b/SGGL/FineUIPro.Web/indexProject.aspx.cs @@ -596,14 +596,14 @@ namespace FineUIPro.Web protected void btnHome_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.CurrUser.LastProjectId) - && ((this.CurrUser.UnitId == Const.UnitId_SEDIN && (this.CurrUser.IsOffice == true || this.CurrUser.RoleIds != null)) || this.CurrUser.PersonId == Const.sysglyId || this.CurrUser.PersonId == Const.hfnbdId)) + && ((CommonService.IsSedinOrSub(this.CurrUser.UnitId) && (this.CurrUser.IsOffice == true || this.CurrUser.RoleIds != null)) || this.CurrUser.PersonId == Const.sysglyId || this.CurrUser.PersonId == Const.hfnbdId)) { Person_PersonsService.UpdateLastUserInfo(this.CurrUser.PersonId, null, true, this.CurrUser.LoginProjectId); this.CurrUser.LastProjectId = this.CurrUser.LoginProjectId; PageContext.Redirect("~/index.aspx", "_top"); } else - { + { this.MenuSwitchMethod(string.Empty); } } diff --git a/SGGL/WebAPI/Controllers/PersonController.cs b/SGGL/WebAPI/Controllers/PersonController.cs index ec8ae51d..fbb5d277 100644 --- a/SGGL/WebAPI/Controllers/PersonController.cs +++ b/SGGL/WebAPI/Controllers/PersonController.cs @@ -23,7 +23,7 @@ namespace WebAPI.Controllers var responeData = new Model.ResponeData(); try { - responeData.data = APIPersonService.getPersonBySitePersonId(sitePersonId); + responeData.data = APIPersonService.getPersonBySitePersonId(sitePersonId, null, null); } catch (Exception ex) { @@ -47,7 +47,7 @@ namespace WebAPI.Controllers var responeData = new Model.ResponeData(); try { - responeData.data = APIPersonService.getPersonByProjectIdIdentityCard(projectId, identityCard); + responeData.data = APIPersonService.getPersonBySitePersonId(null, projectId, identityCard); } catch (Exception ex) { diff --git a/SGGL/WebAPI/Properties/PublishProfiles/FolderProfile2.pubxml b/SGGL/WebAPI/Properties/PublishProfiles/FolderProfile2.pubxml index 12a84ad0..99fa69e2 100644 --- a/SGGL/WebAPI/Properties/PublishProfiles/FolderProfile2.pubxml +++ b/SGGL/WebAPI/Properties/PublishProfiles/FolderProfile2.pubxml @@ -4,13 +4,14 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - False - False - True + true + false + true Release Any CPU FileSystem E:\Package\赛鼎工程有限公司\SGGLAPI FileSystem + \ No newline at end of file diff --git a/SGGL/WebAPI/WebAPI.csproj b/SGGL/WebAPI/WebAPI.csproj index 685dfec1..febfec5d 100644 --- a/SGGL/WebAPI/WebAPI.csproj +++ b/SGGL/WebAPI/WebAPI.csproj @@ -360,7 +360,7 @@ True 0 / - http://localhost:3070/ + http://localhost:7655/ False False