From 19f67541b7359e26f8b5da88b21cec8c2387cd65 Mon Sep 17 00:00:00 2001 From: yhw0507 Date: Wed, 8 Mar 2023 16:20:45 +0800 Subject: [PATCH] =?UTF-8?q?20230308=E4=BA=BA=E5=91=98=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E7=BB=8F=E5=8E=86=E6=9B=B4=E6=96=B0=E6=9D=A1=E4=BB=B6=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SitePerson_PersonItemService.cs | 1 - .../SitePerson/SitePerson_PersonService.cs | 14 +++++ SGGL/BLL/Person/Person_PersonsService.cs | 54 +++++++++++++------ SGGL/FineUIPro.Web/Person/DepartPerson.aspx | 4 +- SGGL/Model/Model.cs | 18 +++---- 5 files changed, 64 insertions(+), 27 deletions(-) diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs index fd9af7d8..d7433eef 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs @@ -151,7 +151,6 @@ namespace BLL if (getOtherPersons.Count() > 0) { foreach (var item in getOtherPersons) - { item.OutTime = DateTime.Now; item.States = Const.ProjectPersonStates_2; diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs index 244728b8..9f8481e8 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs @@ -774,6 +774,20 @@ namespace BLL { setPersonItemInOut = true; } + else + { + var getPersons = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == newPerson.IdentityCard); + if (getPersons != null && (!getPersons.MultiProject.HasValue || getPersons.MultiProject == false)) + { + var getdate = newPerson.InTime.HasValue ? newPerson.InTime.Value.AddDays(-1) : DateTime.Now; + var getPersonItems = db.SitePerson_PersonItem.Where(x => x.PersonId == newPerson.PersonId && x.ProjectId != newPerson.ProjectId && !x.OutTime.HasValue); + foreach(var item in getPersonItems) + { + item.OutTime = getdate; + db.SubmitChanges(); + } + } + } } if (setPersonItemInOut) { diff --git a/SGGL/BLL/Person/Person_PersonsService.cs b/SGGL/BLL/Person/Person_PersonsService.cs index 828304e3..3f866072 100644 --- a/SGGL/BLL/Person/Person_PersonsService.cs +++ b/SGGL/BLL/Person/Person_PersonsService.cs @@ -160,15 +160,27 @@ namespace BLL /// public static string getCurrentProjectName(string PersonId) { - var getItem = Funs.DB.SitePerson_PersonItem.FirstOrDefault(u => u.PersonId == PersonId && !u.OutTime.HasValue); - if (getItem != null) + string name = string.Empty; + var getItem = Funs.DB.SitePerson_PersonItem.Where(u => u.PersonId == PersonId && !u.OutTime.HasValue); + if (getItem.Count() > 0) { - return ProjectService.GetShortNameByProjectId(getItem.ProjectId); - } - else - { - return null; + foreach (var item in getItem) + { + string pname= ProjectService.GetShortNameByProjectId(item.ProjectId); + if (string.IsNullOrEmpty(name)) + { + name = pname; + } + else + { + if (!name.Contains(pname)) + { + name += "," + pname; + } + } + } } + return name; } /// @@ -177,17 +189,29 @@ namespace BLL /// /// /// - public static string getCurrentProjectWorkPostName( string PersonId) + public static string getCurrentProjectWorkPostName(string PersonId) { - var getItem = Funs.DB.SitePerson_PersonItem.FirstOrDefault(u => u.PersonId == PersonId && !u.OutTime.HasValue); - if (getItem != null) + string name = string.Empty; + var getItem = Funs.DB.SitePerson_PersonItem.Where(u => u.PersonId == PersonId && !u.OutTime.HasValue); + if (getItem.Count() > 0) { - return WorkPostService.getWorkPostNamesWorkPostIds(getItem.WorkPostId); - } - else - { - return null; + foreach (var item in getItem) + { + string pname = WorkPostService.getWorkPostNamesWorkPostIds(item.WorkPostId); + if (string.IsNullOrEmpty(name)) + { + name = pname; + } + else + { + if (!name.Contains(pname)) + { + name += "," + pname; + } + } + } } + return name; } #endregion diff --git a/SGGL/FineUIPro.Web/Person/DepartPerson.aspx b/SGGL/FineUIPro.Web/Person/DepartPerson.aspx index 518ac4a8..fe0153fd 100644 --- a/SGGL/FineUIPro.Web/Person/DepartPerson.aspx +++ b/SGGL/FineUIPro.Web/Person/DepartPerson.aspx @@ -106,7 +106,7 @@ - - +
diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index fc50ecb2..2f3d7725 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -73854,7 +73854,7 @@ namespace Model OnCreated(); } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(15) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] public string MaterialCode { get @@ -73958,7 +73958,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialDef", DbType="NVarChar(3000)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialDef", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] public string MaterialDef { get @@ -78548,7 +78548,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(15)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50)")] public string MaterialCode { get @@ -82896,7 +82896,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(1000)")] public string CanWelderCode { get @@ -122265,7 +122265,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialName", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialName", DbType="NVarChar(100)")] public string MaterialName { get @@ -122285,7 +122285,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SpecificationAndModel", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SpecificationAndModel", DbType="NVarChar(200)")] public string SpecificationAndModel { get @@ -122305,7 +122305,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(100)")] public string MaterialCode { get @@ -122325,7 +122325,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Material", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Material", DbType="NVarChar(100)")] public string Material { get @@ -235827,7 +235827,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(1000)")] public string CanWelderCode { get