From cbf70abf686ee253c0fe72ccb2ff1d6b86c83475 Mon Sep 17 00:00:00 2001 From: yhw0507 Date: Thu, 8 Sep 2022 09:01:43 +0800 Subject: [PATCH] 20220908 --- .../版本日志/SGGLDB_V2022-09-07修改明细.txt | 2 + SGGL/BLL/Person/Person_PersonsService.cs | 45 ++++++++++++++++++- .../Person/ProjectPersonEdit.aspx.cs | 9 ++-- 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/DataBase/版本日志/SGGLDB_V2022-09-07修改明细.txt b/DataBase/版本日志/SGGLDB_V2022-09-07修改明细.txt index 15392721..0490a274 100644 --- a/DataBase/版本日志/SGGLDB_V2022-09-07修改明细.txt +++ b/DataBase/版本日志/SGGLDB_V2022-09-07修改明细.txt @@ -1,3 +1,5 @@ --ADD BY YangHongwei 2022-09-07 1、特岗人员资质列表页面新增按是否在岗查询。 +2、人员库单位修改后,所有项目人员单位也跟着修改。 +3、系统管理员修改人员不需要验证照片。 --END \ No newline at end of file diff --git a/SGGL/BLL/Person/Person_PersonsService.cs b/SGGL/BLL/Person/Person_PersonsService.cs index 07ea7d14..4364f426 100644 --- a/SGGL/BLL/Person/Person_PersonsService.cs +++ b/SGGL/BLL/Person/Person_PersonsService.cs @@ -622,14 +622,25 @@ namespace BLL { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { + bool isChange = false; Model.Person_Persons newPerson = db.Person_Persons.FirstOrDefault(e => e.PersonId == person.PersonId); if (newPerson != null) { - newPerson.UnitId = person.UnitId; + if (newPerson.UnitId != person.UnitId) + { + newPerson.UnitId = person.UnitId; + isChange=true; + } + newPerson.DepartId = person.DepartId; newPerson.WorkPostId = person.WorkPostId; newPerson.JobNum = person.JobNum; - newPerson.PersonName = person.PersonName; + if (newPerson.PersonName != person.PersonName) + { + newPerson.PersonName = person.PersonName; + isChange = true; + } + newPerson.Account = person.Account; newPerson.IsOffice = person.IsOffice; newPerson.RoleIds = person.RoleIds; @@ -637,6 +648,7 @@ namespace BLL { newPerson.IdentityCard = person.IdentityCard; newPerson.IsCardNoOK = IDCardValid.CheckIDCard(person.IdentityCard); + isChange = true; } newPerson.IdcardType = person.IdcardType; newPerson.IdcardStartDate = person.IdcardStartDate; @@ -694,6 +706,35 @@ namespace BLL newPerson.QRCodeAttachUrl = person.QRCodeAttachUrl; } db.SubmitChanges(); + if (isChange) + { + SetProjectPersonUnit(person); + } + } + } + } + + /// + /// 更新项目人员单位 + /// + /// + /// + public static void SetProjectPersonUnit(Model.Person_Persons person) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var getSitepersons = from x in db.SitePerson_Person + where x.PersonId == person.PersonId + select x; + if (getSitepersons.Count() > 0) + { + foreach (var item in getSitepersons) + { + item.UnitId = person.UnitId; + item.IdentityCard = person.IdentityCard; + item.PersonName = person.PersonName; + db.SubmitChanges(); + } } } } diff --git a/SGGL/FineUIPro.Web/Person/ProjectPersonEdit.aspx.cs b/SGGL/FineUIPro.Web/Person/ProjectPersonEdit.aspx.cs index 01c2bffc..120fe015 100644 --- a/SGGL/FineUIPro.Web/Person/ProjectPersonEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/ProjectPersonEdit.aspx.cs @@ -620,10 +620,13 @@ namespace FineUIPro.Web.Person string projectPersonInfo = SitePerson_PersonService.ValidPersonInfo(newProjectPerson); if (string.IsNullOrEmpty(personInfo) && string.IsNullOrEmpty(projectPersonInfo)) { - if (string.IsNullOrEmpty(newPerson.PhotoUrl) || newPerson.PhotoUrl == "~/res/images/blank.png") + if (this.CurrUser.PersonId != Const.sysglyId) { - Alert.ShowInParent("照片不能为空!", MessageBoxIcon.Warning); - return; + if (string.IsNullOrEmpty(newPerson.PhotoUrl) || newPerson.PhotoUrl == "~/res/images/blank.png") + { + Alert.ShowInParent("照片不能为空!", MessageBoxIcon.Warning); + return; + } } if (!string.IsNullOrEmpty(newPerson.PersonId))