From db59f0641b8e9a9b9a3390c32e72d8b4197c9e13 Mon Sep 17 00:00:00 2001 From: yhw0507 Date: Sat, 19 Nov 2022 16:17:11 +0800 Subject: [PATCH] =?UTF-8?q?20221119=E4=BC=98=E5=8C=96=E5=87=BA=E5=85=A5?= =?UTF-8?q?=E7=BB=8F=E5=8E=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SitePerson_PersonItemService.cs | 17 ++---- SGGL/FineUIPro.Web/ErrLog.txt | 40 ------------- SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs | 58 +++++++++---------- 3 files changed, 35 insertions(+), 80 deletions(-) diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs index eba1336f..4ff56a60 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs @@ -192,17 +192,12 @@ namespace BLL newitem.PersonName = getPerson.PersonName; newitem.IdentityCard = getPerson.IdentityCard; } - var getPersonItem = db.SitePerson_PersonItem.FirstOrDefault(x => x.PersonId == getPerson.PersonId && x.InTime <= newitem.InTime && x.OutTime > newitem.InTime); + var getPersonItem = db.SitePerson_PersonItem.FirstOrDefault(x => x.PersonId == getPerson.PersonId + && x.InTime <= newitem.InTime && (x.OutTime > newitem.InTime || !x.OutTime.HasValue)); if (getPersonItem != null) { - if (newitem.OutTime.HasValue) - { - if ((getPersonItem.OutTime.HasValue && newitem.OutTime > getPersonItem.OutTime) || !getPersonItem.OutTime.HasValue) - { - getPersonItem.OutTime = newitem.OutTime.Value; - db.SubmitChanges(); - } - } + getPersonItem.OutTime = null; + db.SubmitChanges(); } else { @@ -213,8 +208,8 @@ namespace BLL PersonName = newitem.PersonName, IdentityCard = newitem.IdentityCard, InTime = newitem.InTime, - OutTime = newitem.OutTime, - OutResult = newitem.OutResult, + // OutTime = newitem.OutTime, + // OutResult = newitem.OutResult, }; if (!string.IsNullOrEmpty(newitem.ProjectId)) { diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index 767e0d55..e69de29b 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -1,40 +0,0 @@ - -错误信息开始=====> -错误类型:NullReferenceException -错误信息:未将对象引用设置到对象的实例。 -错误堆栈: - 在 FineUIPro.Web.HJGL.WeldingManage.WeldingPlan.Page_Load(Object sender, EventArgs e) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\FineUIPro.Web\HJGL\WeldingManage\WeldingPlan.aspx.cs:行号 18 - 在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) - 在 System.EventHandler.Invoke(Object sender, EventArgs e) - 在 System.Web.UI.Control.OnLoad(EventArgs e) - 在 System.Web.UI.Control.LoadRecursive() - 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -出错时间:11/16/2022 19:30:50 -出错文件:http://localhost:14901/HJGL/WeldingManage/WeldingPlan.aspx -IP地址:::1 - -出错时间:11/16/2022 19:30:50 - - - -错误信息开始=====> -错误类型:FormatException -错误信息:该字符串未被识别为有效的 DateTime。 -错误堆栈: - 在 System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) - 在 System.Convert.ToDateTime(String value) - 在 BLL.PipelineService.GetStateByPipelineId(String pipelineId) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\WeldingManage\PipelineService.cs:行号 75 - 在 FineUIPro.Web.HJGL.WeldingManage.WeldingPlan.btnUpDateState_Click(Object sender, EventArgs e) - 在 FineUIPro.Button.OnClick(EventArgs e) - 在 (Button , EventArgs ) - 在 FineUIPro.Button.RaisePostBackEvent(String eventArgument) - 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) - 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) - 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -出错时间:11/16/2022 19:35:57 -出错文件:http://localhost:14901/HJGL/WeldingManage/WeldingPlan.aspx -IP地址:::1 -操作人员:JT - -出错时间:11/16/2022 19:35:57 - diff --git a/SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs b/SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs index 6eb311e3..cf1980c3 100644 --- a/SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs @@ -273,37 +273,37 @@ namespace FineUIPro.Web.Person } info = "操作完成,共处理人员按身份证设置年龄" + countRecod.ToString() + "条。"; - var getPPersons = (from x in Funs.DB.SitePerson_Person - join y in Funs.DB.Person_Persons on x.PersonId equals y.PersonId - where x.States == Const.ProjectPersonStates_1 && y.CurrentProjectId == null - select x).Take(1000); - foreach (var pitem in getPPersons) - { - SitePerson_PersonItemService.SetPersonItemInOut(pitem); - pCountRecod++; - } + //var getPPersons = (from x in Funs.DB.SitePerson_Person + // join y in Funs.DB.Person_Persons on x.PersonId equals y.PersonId + // where x.States == Const.ProjectPersonStates_1 && y.CurrentProjectId == null + // select x).Take(1000); + //foreach (var pitem in getPPersons) + //{ + // SitePerson_PersonItemService.SetPersonItemInOut(pitem); + // pCountRecod++; + //} - if (pCountRecod == 0) - { - var getPPersons2 = (from x in Funs.DB.SitePerson_Person - join y in Funs.DB.Person_Persons on x.PersonId equals y.PersonId - where x.States == Const.ProjectPersonStates_0 && y.CurrentProjectId == null - select x).Take(1000); - foreach (var pitem2 in getPPersons2) - { - var getPersons = Funs.DB.Person_Persons.FirstOrDefault(x => x.PersonId == pitem2.PersonId); - if (getPersons != null) - { - getPersons.CurrentProjectId = pitem2.ProjectId; - getPersons.CurrentProjectRoleId = pitem2.RoleIds; - getPersons.CurrentProjectWorkPostId = pitem2.WorkPostId; - Funs.DB.SubmitChanges(); - } - pCountRecod++; - } - } + //if (pCountRecod == 0) + //{ + // var getPPersons2 = (from x in Funs.DB.SitePerson_Person + // join y in Funs.DB.Person_Persons on x.PersonId equals y.PersonId + // where x.States == Const.ProjectPersonStates_0 && y.CurrentProjectId == null + // select x).Take(1000); + // foreach (var pitem2 in getPPersons2) + // { + // var getPersons = Funs.DB.Person_Persons.FirstOrDefault(x => x.PersonId == pitem2.PersonId); + // if (getPersons != null) + // { + // getPersons.CurrentProjectId = pitem2.ProjectId; + // getPersons.CurrentProjectRoleId = pitem2.RoleIds; + // getPersons.CurrentProjectWorkPostId = pitem2.WorkPostId; + // Funs.DB.SubmitChanges(); + // } + // pCountRecod++; + // } + //} - info += "共处理人员所在当前项目取值" + pCountRecod.ToString() + "条。"; + //info += "共处理人员所在当前项目取值" + pCountRecod.ToString() + "条。"; Alert.ShowInParent(info, MessageBoxIcon.Information); } }