diff --git a/DataBase/初始化及数据迁移/SGGLDB_V2021-08-19-001(数据修正脚本).sql b/DataBase/初始化及数据迁移/SGGLDB_V2021-08-19-001(数据修正脚本).sql new file mode 100644 index 00000000..156cc3b5 --- /dev/null +++ b/DataBase/初始化及数据迁移/SGGLDB_V2021-08-19-001(数据修正脚本).sql @@ -0,0 +1,56 @@ +select * from SitePerson_Person where ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' +and UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9' + +select * from base_project where projectname like '%ɽ%' +select * from Base_Unit where UnitName like '%ʮ%' + +delete from QualityAudit_PersonQuality where PersonId in +(select PersonId from SitePerson_Person +where ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' and UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9' +and IdentityCard not in (select IdentityCard from Project_ProjectUser as p + left join Sys_User as u on p.UserId=u.UserId + where p.ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' + and p.UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9')) +go +delete from EduTrain_TrainRecordDetail where PersonId in +(select PersonId from SitePerson_Person +where ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' and UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9' +and IdentityCard not in (select IdentityCard from Project_ProjectUser as p + left join Sys_User as u on p.UserId=u.UserId + where p.ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' + and p.UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9')) +go +delete from EduTrain_TrainRecord +where (select COUNT(*) from EduTrain_TrainRecordDetail where TrainingId =EduTrain_TrainRecord.TrainingId) =0 +and ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' and UnitIds like '%1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9%' +go + +delete from SitePerson_Checking where PersonId in +(select PersonId from SitePerson_Person +where ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' and UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9' +and IdentityCard not in (select IdentityCard from Project_ProjectUser as p + left join Sys_User as u on p.UserId=u.UserId + where p.ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' + and p.UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9')) +go +delete from SitePerson_PersonInOut where PersonId in +(select PersonId from SitePerson_Person +where ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' and UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9' +and IdentityCard not in (select IdentityCard from Project_ProjectUser as p + left join Sys_User as u on p.UserId=u.UserId + where p.ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' + and p.UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9')) +go +delete from SitePerson_Person +where ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' and UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9' +and IdentityCard not in (select IdentityCard from Project_ProjectUser as p + left join Sys_User as u on p.UserId=u.UserId + where p.ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' + and p.UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9') + +delete from SitePerson_Person_Bak +where ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' and UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9' +and IdentityCard not in (select IdentityCard from Project_ProjectUser as p + left join Sys_User as u on p.UserId=u.UserId + where p.ProjectId='7d4cce15-bc9b-4ed4-8b59-2edc8488528b' + and p.UnitId='1c1cc3ba-8654-4bac-b7e7-b45f4eec0dc9') \ No newline at end of file diff --git a/DataBase/版本日志/SGGLDB_V2021-08-18-001.sql b/DataBase/版本日志/SGGLDB_V2021-08-18-001.sql new file mode 100644 index 00000000..ed7ca117 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2021-08-18-001.sql @@ -0,0 +1,6 @@ +ALTER TABLE SitePerson_Checking ALTER COLUMN IdentityCard NVARCHAR(50) +GO +ALTER TABLE SitePerson_Checking ALTER COLUMN Address NVARCHAR(200) +GO +ALTER TABLE SitePerson_Checking ALTER COLUMN WorkAreaName NVARCHAR(200) +GO \ No newline at end of file diff --git a/DataBase/版本日志/SGGLDB_V2021-08-19-001.sql b/DataBase/版本日志/SGGLDB_V2021-08-19-001.sql new file mode 100644 index 00000000..fafcf0fb --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2021-08-19-001.sql @@ -0,0 +1,39 @@ + +ALTER PROC [dbo].[spInOutManHoursReport] + @projectId NVARCHAR(50), + @unitId NVARCHAR(max)= NULL, + @postId NVARCHAR(max)= NULL, + @startTime DATETIME = NULL, + @endTime DATETIME = NULL +AS +/*****************λ****************/ +SELECT CAST(NEWID() AS NVARCHAR(100)) AS ID + ,T.ProjectId + ,p.UnitId + ,ISNULL((case when P.UnitId=''then null + else (case when u.ShortUnitName IS NOT NULL THEN u.ShortUnitName ELSE u.UnitName END) end),'δ֪') AS UnitName + ,ISNULL((case when P.UnitId=''then null + else u.UnitName end),'δ֪') AS AllUnitName + ,p.WorkPostId as PostId + ,ISNULL((case when W.WorkPostName=''then null else W.WorkPostName end),'δ֪') AS PostName + ,SUM(ISNULL(ManHours,0)) AS ManHoursSum + ,COUNT(T.NewID) AS ManCountSum + ,(SELECT COUNT(PersonId) FROM SitePerson_Person + WHERE ProjectId = T.ProjectId AND P.UnitId=UnitId AND P.WorkPostId=WorkPostId AND IsUsed=1 AND OutTime IS NOT NULL + group by ProjectId,UnitId,WorkPostId) AS PersonCountSum +FROM dbo.t_d_EmployInOutRecord AS T +LEFT JOIN dbo.SitePerson_Person AS P ON T.ProjectId=P.ProjectId AND T.IDCardNo=P.IdentityCard +LEFT JOIN dbo.Base_Unit AS U ON P.UnitId=U.UnitId +--LEFT JOIN dbo.ProjectData_TeamGroup AS Team ON P.TeamGroupId=Team.TeamGroupId +LEFT JOIN dbo.Base_WorkPost AS W ON P.WorkPostId=W.WorkPostId +WHERE T.ProjectId = @ProjectId +AND (RecordDate >= @startTime OR @startTime IS NULL) +AND (RecordDate <= @endTime OR @endTime IS NULL) +AND (@unitId like '%'+P.UnitId+'%' OR @unitId IS NULL) +AND (@postId like '%'+P.WorkPostId+'%' OR @postId IS NULL) +GROUP BY T.ProjectId,P.UnitId,U.UnitName,u.ShortUnitName,P.WorkPostId,W.WorkPostName + + +GO + + diff --git a/SGGL/FineUIPro.Web/Door/InOutManHoursItem.aspx.cs b/SGGL/FineUIPro.Web/Door/InOutManHoursItem.aspx.cs index d7904a98..f82a9b28 100644 --- a/SGGL/FineUIPro.Web/Door/InOutManHoursItem.aspx.cs +++ b/SGGL/FineUIPro.Web/Door/InOutManHoursItem.aspx.cs @@ -115,11 +115,12 @@ namespace FineUIPro.Web.Door /// private void GetPersonStatistic() { - string strSql = @"SELECT NewID,ProjectId,InstallationName,UnitId,UnitName,EmployNO,EmployName,RecordDate - ,IDCardNo,Nation,PostName,WorkIn1,OffDuty1,WorkIn2,OffDuty2,WorkIn3,OffDuty3,ManHours - ,DepartmentID,DepartName,NationName,PostId,ManOverHours - FROM dbo.t_d_EmployInOutRecord - WHERE ProjectId = @ProjectId "; + string strSql = @"SELECT NewID,T.ProjectId,T.InstallationName,T.UnitId,T.UnitName,T.EmployNO,T.EmployName,T.RecordDate + ,T.IDCardNo,T.Nation,T.PostName,T.WorkIn1,T.OffDuty1,T.WorkIn2,T.OffDuty2,T.WorkIn3,T.OffDuty3,T.ManHours + ,T.DepartmentID,T.DepartName,T.NationName,T.PostId,T.ManOverHours + FROM dbo.t_d_EmployInOutRecord T + LEFT JOIN dbo.SitePerson_Person AS P ON T.ProjectId=P.ProjectId AND T.IDCardNo=P.IdentityCard + WHERE T.ProjectId = @ProjectId "; List listStr = new List { new SqlParameter("@ProjectId", this.ProjectId), @@ -127,8 +128,7 @@ namespace FineUIPro.Web.Door if (this.UnitName == "未知") { - strSql += " AND (UnitName IS NULL OR UnitName='')"; - listStr.Add(new SqlParameter("@UnitName", this.UnitName)); + strSql += " AND P.UnitId IS NULL"; } else { @@ -137,8 +137,7 @@ namespace FineUIPro.Web.Door } if (this.PostName == "未知") { - strSql += " AND (PostName IS NULL OR PostName='')"; - listStr.Add(new SqlParameter("@PostName", this.UnitName)); + strSql += " AND P.WorkPostId IS NULL "; } else { diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index ffe7dfcb..5f282702 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -1,64 +1 @@ - -错误信息开始=====> -错误类型:HttpException -错误信息:文件“/ZHGL/RealName/LeavePost.aspx”不存在。 -错误堆栈: - 在 System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) - 在 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) - 在 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) - 在 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) - 在 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) - 在 System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) - 在 System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) - 在 System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() - 在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) - 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -出错时间:08/16/2021 14:45:33 -出错文件:http://localhost:8118/ZHGL/RealName/LeavePost.aspx -IP地址:::1 - -出错时间:08/16/2021 14:45:33 - - -错误信息开始=====> -错误类型:NullReferenceException -错误信息:未将对象引用设置到对象的实例。 -错误堆栈: - 在 System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) - 在 FineUIPro.ResourceHelper.GetResourceContentAsBinary(String resName, String resVersion) - 在 FineUIPro.ResourceHandler.ProcessRequest(HttpContext context) - 在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() - 在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) - 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -出错时间:08/16/2021 16:29:05 -出错文件:http://localhost:8118/res.axd?font=lib.iconfont.iconfont.woff&t=636947851460000000 -IP地址:::1 - -出错时间:08/16/2021 16:29:05 - - -错误信息开始=====> -错误类型:HttpParseException -错误信息:类型“FineUIPro.CheckBox”不具有名为“OnSelectedIndexChanged”的公共属性。 -错误堆栈: - 在 System.Web.UI.TemplateParser.ProcessException(Exception ex) - 在 System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) - 在 System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) -----错误类型:HttpException -----错误信息: -----类型“FineUIPro.CheckBox”不具有名为“OnSelectedIndexChanged”的公共属性。 -----错误堆栈: - 在 System.Web.UI.ControlBuilder.AddProperty(String filter, String name, String value, Boolean mainDirectiveMode) - 在 System.Web.UI.ControlBuilder.PreprocessAttribute(String filter, String attribname, String attribvalue, Boolean mainDirectiveMode, Int32 line, Int32 column) - 在 System.Web.UI.ControlBuilder.PreprocessAttributes(ParsedAttributeCollection attribs) - 在 System.Web.UI.ControlBuilder.Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, String tagName, String id, IDictionary attribs) - 在 System.Web.UI.ControlBuilder.CreateBuilderFromType(TemplateParser parser, ControlBuilder parentBuilder, Type type, String tagName, String id, IDictionary attribs, Int32 line, String sourceFileName) - 在 System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty) - 在 System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText) - 在 System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) -出错时间:08/17/2021 10:54:26 -出错文件:http://localhost:8118/HSSE/SitePerson/PersonList.aspx -IP地址:::1 - -出错时间:08/17/2021 10:54:26 - + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/File/Excel/Temp/202108181024434903.xls b/SGGL/FineUIPro.Web/File/Excel/Temp/202108181024434903.xls new file mode 100644 index 00000000..bcbe5c0b Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/Temp/202108181024434903.xls differ diff --git a/SGGL/FineUIPro.Web/File/Excel/Temp/202108181123056668.xls b/SGGL/FineUIPro.Web/File/Excel/Temp/202108181123056668.xls new file mode 100644 index 00000000..75469643 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/Temp/202108181123056668.xls differ diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.cs index edc2985a..46b82702 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.cs @@ -63,8 +63,8 @@ namespace FineUIPro.Web.HSSE.SitePerson this.drpUnit.SelectedValue = this.CurrUser.UnitId; this.drpUnit.Enabled = false; } - this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddMonths(-1)); - this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1)); + this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(-1)); + this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddMinutes(1)); // 绑定表格 BindGrid(); } diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfoEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfoEdit.aspx.cs index 46ac817f..0613b768 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfoEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfoEdit.aspx.cs @@ -246,9 +246,11 @@ namespace FineUIPro.Web.HSSE.SitePerson string[] personIds = this.drpPersonId.Value.Split(','); foreach (var item in personIds) { - Model.SitePerson_Checking personInfo = new Model.SitePerson_Checking(); - personInfo.ProjectId = this.ProjectId; - personInfo.PersonId = item.Trim(); + Model.SitePerson_Checking personInfo = new Model.SitePerson_Checking + { + ProjectId = this.ProjectId, + PersonId = item.Trim() + }; var person = BLL.PersonService.GetPersonById(personInfo.PersonId); if (person != null) { diff --git a/SGGL/WebAPI/Controllers/DoorProject/uploadController.cs b/SGGL/WebAPI/Controllers/DoorProject/uploadController.cs index 2888a1cc..41ac3423 100644 --- a/SGGL/WebAPI/Controllers/DoorProject/uploadController.cs +++ b/SGGL/WebAPI/Controllers/DoorProject/uploadController.cs @@ -259,8 +259,8 @@ namespace WebAPI.Controllers { if (!string.IsNullOrEmpty(person.OutTime)) { - getPerson.OutTime = Funs.GetNewDateTime(person.OutTime); - PersonService.AddPerson(getPerson); + var outTime = Funs.GetNewDateTimeOrNow(person.OutTime); + PersonService.PersonOut(getPerson.PersonId, outTime); responeData.message = "更新出场时间"; } else