diff --git a/DataBase/版本日志/SGGLDB_CD_V2023-04-26-001.sql b/DataBase/版本日志/SGGLDB_CD_V2023-04-26-001.sql new file mode 100644 index 00000000..13d1d751 Binary files /dev/null and b/DataBase/版本日志/SGGLDB_CD_V2023-04-26-001.sql differ diff --git a/SGGL/BLL/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs index 4df566b2..29138bf6 100644 --- a/SGGL/BLL/API/APIPersonService.cs +++ b/SGGL/BLL/API/APIPersonService.cs @@ -95,7 +95,7 @@ namespace BLL Telephone = x.Telephone, PhotoUrl = x.PhotoUrl, DepartName = x.DepartName, - IsUsed = x.IsUsed == 1 ? true : false, + IsUsed = x.IsUsed .HasValue?x.IsUsed.Value.ToString():"", IsUsedName = x.IsUsed == 0 ? "不启用" : "启用", AuditorId = x.AuditorId, AuditorName = db.Sys_User.First(z => z.UserId == x.AuditorId).UserName, @@ -202,7 +202,7 @@ namespace BLL Telephone = x.Telephone, PhotoUrl = x.PhotoUrl, DepartName = x.DepartName, - IsUsed = x.IsUsed==1?true:false, + IsUsed = x.IsUsed.HasValue?x.IsUsed.Value.ToString():"", IsUsedName = x.IsUsed == 0 ? "不启用" : "启用", AuditorId = x.AuditorId, AuditorName = db.Sys_User.First(z => z.UserId == x.AuditorId).UserName, @@ -400,7 +400,7 @@ namespace BLL OutResult = x.OutResult, Telephone = x.Telephone, PhotoUrl = x.PhotoUrl, - IsUsed = x.IsUsed==1?true:false, + IsUsed = x.IsUsed.HasValue?x.IsUsed.ToString():"", IsUsedName = (x.IsUsed == 1 ? "启用" : "未启用"), WorkAreaId = x.WorkAreaId, WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId), @@ -567,13 +567,19 @@ namespace BLL /// 培训岗位ID /// 培训类型ID /// - public static List getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId) + public static List getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId,string InTime,string strParam) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { + DateTime inDateTime=DateTime.Now; + if (!string.IsNullOrEmpty(InTime)) + { + inDateTime = DateTime.Parse(InTime); + } + List unitIdList = Funs.GetStrListByStr(unitIds, ','); var getPersons = from x in db.View_SitePerson_Person - where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == 1 + where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == 1 &&(string.IsNullOrEmpty(strParam)||x.PersonName.Contains(strParam)) && (string.IsNullOrEmpty(InTime) || x.InTime < inDateTime) && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now) select new Model.PersonItem { @@ -723,13 +729,9 @@ namespace BLL { newPerson.ViceCNProfessionalId = person.ViceCNProfessionalId; } - if (person.IsUsed == true) + if (!string.IsNullOrEmpty(person.IsUsed)) { - newPerson.IsUsed = 1; - } - else - { - newPerson.IsUsed = 0; + newPerson.IsUsed = int.Parse(person.IsUsed); } newPerson.Password = PersonService.GetPersonPassWord(person.IdentityCard); string rootUrl = ConfigurationManager.AppSettings["localRoot"]; @@ -808,7 +810,10 @@ namespace BLL } else { - getPerson.IsUsed = person.IsUsed?1:0; + if (!string.IsNullOrEmpty(person.IsUsed)) + { + getPerson.IsUsed = int.Parse(person.IsUsed); + } getPerson.AuditorDate = DateTime.Now; } getPerson.AuditorId = person.AuditorId; diff --git a/SGGL/BLL/API/HSSE/APITestRecordService.cs b/SGGL/BLL/API/HSSE/APITestRecordService.cs index 2a60876d..adddf092 100644 --- a/SGGL/BLL/API/HSSE/APITestRecordService.cs +++ b/SGGL/BLL/API/HSSE/APITestRecordService.cs @@ -35,6 +35,7 @@ namespace BLL TestScores = x.TestScores ?? 0, TestType = x.TestType, TemporaryUser = x.TemporaryUser, + Signature= x.Signature }).ToList(); foreach(var item in getDataLists) @@ -90,6 +91,7 @@ namespace BLL TestScores = x.TestScores ?? 0, TestType = x.TestType, TemporaryUser = x.TemporaryUser, + Signature= x.Signature }; var res = getDataLists.FirstOrDefault(); if (res != null) @@ -845,5 +847,29 @@ namespace BLL } } #endregion + + + + + /// + /// 修改考试记录信息 + /// + /// + public static void updateTestRecord(Model.Training_TestRecord testRecord) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + Model.Training_TestRecord newTestRecord = db.Training_TestRecord.FirstOrDefault(e => e.TestRecordId == testRecord.TestRecordId); + if (newTestRecord != null) + { + newTestRecord.TestScores = testRecord.TestScores; + newTestRecord.TestEndTime = testRecord.TestEndTime; + newTestRecord.IsFiled = testRecord.IsFiled; + newTestRecord.Signature = testRecord.Signature; + newTestRecord.Fingerprint = testRecord.Fingerprint; + db.SubmitChanges(); + } + } + } } } \ No newline at end of file diff --git a/SGGL/BLL/Common/PrinterDocService.cs b/SGGL/BLL/Common/PrinterDocService.cs index f4ade49a..5a3ac2b1 100644 --- a/SGGL/BLL/Common/PrinterDocService.cs +++ b/SGGL/BLL/Common/PrinterDocService.cs @@ -1451,7 +1451,17 @@ sb.Append(""); sb.Append(""); - sb.AppendFormat(" ", "姓名:" + testName); + if (!string.IsNullOrEmpty(getTestRecord.Signature)) + { + sb.AppendFormat(" "); + } + else + { + sb.AppendFormat(" "); + + //sb.AppendFormat(" ", "姓名:" + testName); + + } sb.AppendFormat(" ", "身份证号:" + idCard); sb.AppendFormat(" ", "分数:" + (getTestRecord.TestScores ?? 0).ToString()); sb.Append(""); diff --git a/SGGL/FineUIPro.Web/CQMS/Foreign/ITPListProject.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Foreign/ITPListProject.aspx.cs index 51192bbe..cb366ddd 100644 --- a/SGGL/FineUIPro.Web/CQMS/Foreign/ITPListProject.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Foreign/ITPListProject.aspx.cs @@ -58,7 +58,7 @@ namespace FineUIPro.Web.CQMS.Foreign ,[Memo] ,[CheckDate] ,[FileType] - FROM CQMS_Foreign_ITPListProject where 1=1 "; + FROM CQMS_Foreign_ITPListProject where ProjectId='"+this.CurrUser.LoginProjectId+"' "; List listStr = new List(); diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index 5f282702..00dc6d31 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -1 +1,98 @@ - \ No newline at end of file + +错误信息开始=====> +错误类型:HttpException +错误信息:文件“/HSSE/AttachFile/webuploader.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) +出错时间:04/25/2023 18:54:47 +出错文件:http://localhost:1295/HSSE/AttachFile/webuploader.aspx?toKeyId=&path=FileUpload/SafePersonQualityAttachUrl&menuId=750F5074-45B9-470E-AE1E-6204957421E6&type=-1 +IP地址:::1 + +出错时间:04/25/2023 18:54:47 + + +错误信息开始=====> +错误类型:SqlException +错误信息:参数化查询 '(@ProjectId nvarchar(4000))SELECT DISTINCT PersonQuality.SafePer' 需要参数 '@ProjectId',但未提供该参数。 +错误堆栈: + 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) + 在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) + 在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) + 在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) + 在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() + 在 System.Data.SqlClient.SqlDataReader.get_MetaData() + 在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) + 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) + 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) + 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) + 在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) + 在 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) + 在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) + 在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) + 在 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) + 在 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) + 在 BLL.SQLHelper.GetDataTableRunText(String strSql, SqlParameter[] parameters) 位置 D:\project\vs\sggl_cd\SGGL\BLL\SQLHelper.cs:行号 311 + 在 FineUIPro.Web.HSSE.QualityAudit.SafePersonQuality.BindGrid() 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\QualityAudit\SafePersonQuality.aspx.cs:行号 102 + 在 FineUIPro.Web.HSSE.QualityAudit.SafePersonQuality.Page_Load(Object sender, EventArgs e) 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\QualityAudit\SafePersonQuality.aspx.cs:行号 60 + 在 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) +出错时间:04/25/2023 19:01:25 +出错文件:http://localhost:1295/HSSE/QualityAudit/SafePersonQuality.aspx +IP地址:::1 +操作人员:JT + +出错时间:04/25/2023 19:01:25 + + +错误信息开始=====> +错误类型:NullReferenceException +错误信息:未将对象引用设置到对象的实例。 +错误堆栈: + 在 FineUIPro.Web.CQMS.Check.EditJointCheck.Page_Load(Object sender, EventArgs e) 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\CQMS\Check\EditJointCheck.aspx.cs:行号 58 + 在 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) +出错时间:04/26/2023 15:31:55 +出错文件:http://localhost:1295/CQMS/Check/EditJointCheck.aspx +IP地址:::1 +操作人员:JT + +出错时间:04/26/2023 15:31:55 + + +错误信息开始=====> +错误类型:HttpCompileException +错误信息:d:\project\vs\sggl_cd\SGGL\FineUIPro.Web\HSSE\Check\CheckSpecial.aspx(56): error CS1061: “ASP.hsse_check_checkspecial_aspx”不包含“drpType_SelectedIndexChanged”的定义,并且找不到可接受类型为“ASP.hsse_check_checkspecial_aspx”的第一个参数的扩展方法“drpType_SelectedIndexChanged”(是否缺少 using 指令或程序集引用?) +错误堆栈: + 在 System.Web.Compilation.AssemblyBuilder.Compile() + 在 System.Web.Compilation.BuildProvidersCompiler.PerformBuild() + 在 System.Web.Compilation.BuildManager.CompileWebFile(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) +出错时间:04/27/2023 15:21:49 +出错文件:http://localhost:1295/HSSE/Check/CheckSpecial.aspx +IP地址:::1 + +出错时间:04/27/2023 15:21:49 + diff --git a/SGGL/FineUIPro.Web/FileUpload/SafePersonQualityAttachUrl/2023-04/638180458829725872_附件3:2023年度工作通报事项一览表_(4).xlsx b/SGGL/FineUIPro.Web/FileUpload/SafePersonQualityAttachUrl/2023-04/638180458829725872_附件3:2023年度工作通报事项一览表_(4).xlsx new file mode 100644 index 00000000..35fe88e8 Binary files /dev/null and b/SGGL/FineUIPro.Web/FileUpload/SafePersonQualityAttachUrl/2023-04/638180458829725872_附件3:2023年度工作通报事项一览表_(4).xlsx differ diff --git a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx index dd7012d3..40e2e5ec 100644 --- a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx +++ b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx @@ -38,7 +38,7 @@ ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch"> - - - - - + + - + - - + + + + + + + + @@ -127,13 +131,16 @@ + diff --git a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.cs index a29b5998..7ba933a8 100644 --- a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.cs @@ -37,6 +37,16 @@ namespace FineUIPro.Web.HSSE.Check if (!IsPostBack) { Funs.DropDownPageSize(this.ddlPageSize); + ListItem[] item = new ListItem[5]; + item[0] = new ListItem("请选择", "-1"); + item[1] = new ListItem("专项检查", "0"); + item[2] = new ListItem("安全周检", "1"); + item[3] = new ListItem("安全月检", "2"); + item[4] = new ListItem("节前节后安全检查", "3"); + this.drpType.DataValueField = "Value"; + this.drpType.DataTextField = "Text"; + this.drpType.DataSource = item; + this.drpType.DataBind(); this.ProjectId = this.CurrUser.LoginProjectId; if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.ProjectId) { @@ -57,38 +67,40 @@ namespace FineUIPro.Web.HSSE.Check /// private void BindGrid() { - string strSql = @"SELECT CheckSpecial.CheckSpecialId,CodeRecords.Code AS CheckSpecialCode," - + @" CheckItemSet.CheckItemName,CheckSpecial.CheckTime,(CASE WHEN CheckSpecial.CheckType ='1' THEN '联合检查' ELSE '专项检查' END) AS CheckTypeName" + string strSql = @"SELECT 0 [index], CheckSpecial.CheckSpecialId,CodeRecords.Code AS CheckSpecialCode," + + @" CASE WHEN CheckSpecial.CheckType ='0' THEN CheckItemSet.CheckItemName else '综合大检查' end CheckItemName ,CheckSpecial.CheckTime, + (CASE WHEN CheckSpecial.CheckType ='1' THEN '安全周检' + WHEN CheckSpecial.CheckType ='2' THEN '安全月检' + WHEN CheckSpecial.CheckType ='3' THEN '节前节后安全检查' + WHEN CheckSpecial.CheckType ='0' THEN '专项检查' + ELSE '专项检查' END) AS CheckTypeName" + @" ,(CASE WHEN CheckSpecial.States='2' THEN '已完成' WHEN CheckSpecial.States='1' THEN '待整改' ELSE '待提交' END) AS StatesName" + @" FROM Check_CheckSpecial AS CheckSpecial " + @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON CheckSpecial.CheckSpecialId=CodeRecords.DataId " + @" LEFT JOIN Technique_CheckItemSet AS CheckItemSet ON CheckItemSet.CheckItemSetId = CheckSpecial.CheckItemSetId where 1=1"; List listStr = new List(); strSql += " AND CheckSpecial.ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); if (this.rbStates.SelectedValue!="-1") { strSql += " AND CheckSpecial.States = @States"; listStr.Add(new SqlParameter("@States", this.rbStates.SelectedValue)); } - if (this.rbType.SelectedValue != "-1") + if (this.drpType.SelectedValue != "-1") { - if (this.rbType.SelectedValue == "1") - { + strSql += " AND CheckSpecial.CheckType = @CheckType"; - listStr.Add(new SqlParameter("@CheckType", this.rbType.SelectedValue)); - } - else - { - strSql += " AND (CheckSpecial.CheckType = @CheckType OR CheckSpecial.CheckType IS NULL) "; - listStr.Add(new SqlParameter("@CheckType", this.rbType.SelectedValue)); - } + listStr.Add(new SqlParameter("@CheckType", this.drpType.SelectedValue)); + } - if (this.drpSupCheckItemSet.SelectedValue!=BLL.Const._Null) + if (this.drpSupCheckItemSet.SelectedValue != BLL.Const._Null) { - strSql += " AND CheckSpecial.CheckItemSetId = @CheckItemSetId"; - listStr.Add(new SqlParameter("@CheckItemSetId", this.drpSupCheckItemSet.SelectedValue )); + if (drpSupCheckItemSet.SelectedValue != "0"&& drpSupCheckItemSet.SelectedValue != "-1") + { + strSql += " AND CheckSpecial.CheckItemSetId = @CheckItemSetId"; + listStr.Add(new SqlParameter("@CheckItemSetId", this.drpSupCheckItemSet.SelectedValue)); + } } if (!string.IsNullOrEmpty(this.txtStartTime.Text.Trim())) { @@ -103,7 +115,13 @@ namespace FineUIPro.Web.HSSE.Check SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); - + if (tb != null) + { + foreach (DataRow row in tb.Rows) + { + row["index"] = int.Parse(System.Text.RegularExpressions.Regex.Replace(row["CheckSpecialCode"].ToString(), @"[^0-9]+", "")); + } + } Grid1.RecordCount = tb.Rows.Count; var table = this.GetPagedDataTable(Grid1, tb); @@ -245,25 +263,33 @@ namespace FineUIPro.Web.HSSE.Check /// private void GetButtonPower() { - if (Request.Params["value"] == "0") + try { - return; + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectCheckSpecialMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuModify.Hidden = false; + this.btnMenuClose.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDel.Hidden = false; + } + } } - var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectCheckSpecialMenuId); - if (buttonList.Count() > 0) + catch (Exception e) { - if (buttonList.Contains(BLL.Const.BtnAdd)) - { - this.btnNew.Hidden = false; - } - if (buttonList.Contains(BLL.Const.BtnModify)) - { - this.btnMenuModify.Hidden = false; - } - if (buttonList.Contains(BLL.Const.BtnDelete)) - { - this.btnMenuDel.Hidden = false; - } + } } #endregion @@ -297,8 +323,32 @@ namespace FineUIPro.Web.HSSE.Check this.BindGrid(); } - protected void drpSupCheckItemSet_SelectedIndexChanged(object sender, EventArgs e) + protected void drpType_SelectedIndexChanged(object sender, EventArgs e) { + drpSupCheckItemSet.Items.Clear(); + if (drpType.SelectedValue == "0") + { + Technique_CheckItemSetService.InitCheckItemSetDropDownList(this.drpSupCheckItemSet, "2", "0", true); + + } + else + { + ListItem[] item = new ListItem[2]; + item[0] = new ListItem("请选择", "-1"); + item[1] = new ListItem("联合", "0"); + this.drpSupCheckItemSet.DataValueField = "Value"; + this.drpSupCheckItemSet.DataTextField = "Text"; + this.drpSupCheckItemSet.DataSource = item; + this.drpSupCheckItemSet.DataBind(); + + } + this.drpSupCheckItemSet.SelectedIndex = 0; + this.BindGrid(); + } + + protected void drpSupCheckItemSet_SelectedIndexChanged(object sender, EventArgs e) + { + this.BindGrid(); } @@ -356,8 +406,9 @@ namespace FineUIPro.Web.HSSE.Check string filePath = string.Empty; initTemplatePath = "File\\Word\\HSSE\\专项检查.doc"; uploadfilepath = rootPath + initTemplatePath; - newUrl = uploadfilepath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".doc"); - filePath = initTemplatePath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf"); + string docfilename = Funs.GetNewFileName(); + newUrl = uploadfilepath.Replace(".doc", docfilename + ".doc"); + filePath = initTemplatePath.Replace(".doc", docfilename + ".pdf"); if (File.Exists(newUrl)) { File.Delete(newUrl); } @@ -467,7 +518,7 @@ namespace FineUIPro.Web.HSSE.Check builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First; builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐 builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐 - builder.CellFormat.Width = 60; + builder.CellFormat.Width = 120; builder.Write(string.IsNullOrEmpty(detail.UnitName) ? "" : detail.UnitName); //问题描述 builder.InsertCell(); @@ -475,7 +526,7 @@ namespace FineUIPro.Web.HSSE.Check builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First; builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐 builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐 - builder.CellFormat.Width = 140; + builder.CellFormat.Width = 40; builder.Write(string.IsNullOrEmpty(detail.Unqualified) ? "" : detail.Unqualified); //问题类型 builder.InsertCell(); @@ -483,7 +534,7 @@ namespace FineUIPro.Web.HSSE.Check builder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.First; builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐 builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐 - builder.CellFormat.Width = 60; + builder.CellFormat.Width = 100; builder.Write(string.IsNullOrEmpty(detail.CheckItemName)?"": detail.CheckItemName); //处理结果 @@ -501,7 +552,7 @@ namespace FineUIPro.Web.HSSE.Check builder.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;//垂直居中对齐 builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;//水平居中对齐 builder.CellFormat.Width = 50; - builder.Write(string.IsNullOrEmpty(detail.HiddenHazardTypeName) ? "" : detail.HiddenHazardTypeName); + builder.Write(string.IsNullOrEmpty(detail.RiskLevel) ? "" : detail.RiskLevel); builder.EndRow(); num++; } @@ -527,5 +578,82 @@ namespace FineUIPro.Web.HSSE.Check File.Delete(pdfUrl); } #endregion + + #region 闭环 + /// + /// 闭环按钮 + /// + /// + /// + protected void btnMenuClose_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string CheckSpecialId = Grid1.SelectedRowID.Split(',')[0]; + var checkSpecial = BLL.Check_CheckSpecialService.GetCheckSpecialByCheckSpecialId(CheckSpecialId); + if (checkSpecial != null) + { + var details = BLL.Check_CheckSpecialDetailService.GetCheckSpecialDetailByCheckSpecialId(CheckSpecialId); + foreach (var item in details) + { + item.CompleteStatus = true; + BLL.Check_CheckSpecialDetailService.UpdateCheckSpecialDetail(item); + } + checkSpecial.States = Const.State_2; + Check_CheckSpecialService.UpdateCheckSpecial(checkSpecial); + var hazardRegisters = from x in Funs.DB.HSSE_Hazard_HazardRegister where x.CheckSpecialId == CheckSpecialId select x; + foreach (var item in hazardRegisters) + { + item.States = "3"; + BLL.HSSE_Hazard_HazardRegisterService.UpdateHazardRegister(item); + } + BindGrid(); + ShowNotify("闭环成功!", MessageBoxIcon.Success); + } + } + #endregion + + + protected string ConvertState(object state) + { + if (state != null) + { + var checkSpecial = Funs.DB.Check_CheckSpecial.Where(y => y.CheckSpecialId == state.ToString()).FirstOrDefault(); + if (checkSpecial != null) + { + if (checkSpecial.States == "2") + { + return "已完成"; + } + else if (checkSpecial.States == "1") + { + var details = Funs.DB.Check_CheckSpecialDetail.Where(x => x.CheckSpecialId == state.ToString()).ToList(); + if (details != null && details.Count > 0) + { + string res = "待整改"; + foreach (var d in details) + { + if (d.CompleteStatus.HasValue && d.CompleteStatus.Value) + { + res = "部分待整改"; + } + } + return res; + } + } + else + { + return "待提交"; + } + + + + } + } + return ""; + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.designer.cs index c8899bfd..7b198a2c 100644 --- a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.Check { - - - public partial class CheckSpecial { - +namespace FineUIPro.Web.HSSE.Check +{ + + + public partial class CheckSpecial + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar2 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// rbStates 控件。 /// @@ -65,16 +67,16 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.RadioButtonList rbStates; - + /// - /// rbType 控件。 + /// drpType 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.RadioButtonList rbType; - + protected global::FineUIPro.DropDownList drpType; + /// /// drpSupCheckItemSet 控件。 /// @@ -83,7 +85,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpSupCheckItemSet; - + /// /// txtStartTime 控件。 /// @@ -92,7 +94,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtStartTime; - + /// /// txtEndTime 控件。 /// @@ -101,7 +103,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtEndTime; - + /// /// ToolbarFill1 控件。 /// @@ -110,7 +112,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnNew 控件。 /// @@ -119,7 +121,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnNew; - + /// /// btnOut 控件。 /// @@ -128,16 +130,25 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnOut; - + /// - /// lblNumber 控件。 + /// labNumber 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::System.Web.UI.WebControls.Label lblNumber; - + protected global::System.Web.UI.WebControls.Label labNumber; + + /// + /// labStatesName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label labStatesName; + /// /// ToolbarSeparator1 控件。 /// @@ -146,7 +157,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -155,7 +166,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -164,7 +175,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// Window1 控件。 /// @@ -173,7 +184,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// Menu1 控件。 /// @@ -182,7 +193,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuModify 控件。 /// @@ -191,7 +202,16 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuModify; - + + /// + /// btnMenuClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuClose; + /// /// btnPrinter 控件。 /// @@ -200,7 +220,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnPrinter; - + /// /// btnMenuDel 控件。 /// diff --git a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecialEdit.aspx b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecialEdit.aspx index b3bdbebb..3a03abc2 100644 --- a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecialEdit.aspx +++ b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecialEdit.aspx @@ -1,23 +1,25 @@ <%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="CheckSpecialEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.Check.CheckSpecialEdit" %> - <%@ Register Src="~/Controls/FlowOperateControl.ascx" TagName="FlowOperateControl" TagPrefix="uc1" %> 编辑专项检查 - -
diff --git a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx.cs b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx.cs index ecd65cbb..a371b3c5 100644 --- a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx.cs @@ -107,8 +107,20 @@ namespace FineUIPro.Web.HSSE.HiddenInspection } if (!string.IsNullOrEmpty(this.dpRiskLevel.SelectedValue.Trim())) { - strSql += " AND Risk_Level = @Risk_Level"; - listStr.Add(new SqlParameter("@Risk_Level", this.dpRiskLevel.SelectedText) ); + if (this.dpRiskLevel.SelectedText == "重大") + { + strSql += " AND Risk_Level in('重大','3','高') "; + } + else if (this.dpRiskLevel.SelectedText == "较大") + { + strSql += " AND Risk_Level in('较大','2','较高') "; + } + else if (this.dpRiskLevel.SelectedText == "一般") + { + strSql += " AND Risk_Level in('一般','1','低') "; + } + + } if (!string.IsNullOrEmpty(this.drpType.SelectedValue.Trim())) { @@ -163,6 +175,32 @@ namespace FineUIPro.Web.HSSE.HiddenInspection Grid1.DataSource = table; Grid1.DataBind(); + + + for (int i = 0; i < Grid1.Rows.Count; i++) + { + string HazardRegisterId = Grid1.Rows[i].DataKeys[0].ToString(); + Model.View_Hazard_HazardRegister registration = (from x in Funs.DB.View_Hazard_HazardRegister where x.HazardRegisterId == HazardRegisterId select x).FirstOrDefault(); + + if (registration != null) + { + if (registration.Risk_Level == "一般" || registration.Risk_Level == "1" || registration.Risk_Level == "低") + { + Grid1.Rows[i].RowCssClass = "Blue"; + }else if (registration.Risk_Level == "较大" || registration.Risk_Level == "2" || registration.Risk_Level == "较高") + { + Grid1.Rows[i].RowCssClass = "Yellow"; + } + else if (registration.Risk_Level == "重大" || registration.Risk_Level == "3") + { + Grid1.Rows[i].RowCssClass = "Red"; + } + } + } + + + + } #endregion diff --git a/SGGL/FineUIPro.Web/Person/EduTrain/PlanEdit.aspx.cs b/SGGL/FineUIPro.Web/Person/EduTrain/PlanEdit.aspx.cs index 940f91bb..3af5fbaf 100644 --- a/SGGL/FineUIPro.Web/Person/EduTrain/PlanEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/EduTrain/PlanEdit.aspx.cs @@ -90,7 +90,7 @@ namespace FineUIPro.Web.Person.EduTrain { dpCompanyTraining.SelectedValueArray = planItem; } - var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, trainingPlan.UnitIds, trainingPlan.WorkPostId,"", trainingPlan.TrainTypeId).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList(); + var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, trainingPlan.UnitIds, trainingPlan.WorkPostId,"", trainingPlan.TrainTypeId,"","").OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList(); dpSysUser.DataTextField = "PersonName"; dpSysUser.DataValueField = "PersonId"; dpSysUser.DataSource = getDataList; @@ -431,7 +431,7 @@ namespace FineUIPro.Web.Person.EduTrain dpSysUser.Items.Clear(); string unitIds=string.Join(",",dpUnit.SelectedValue); string workPostIds = string.Join(",", dpDepart.SelectedValue); - var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, unitIds, workPostIds,"", drpTrainType.SelectedValue).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList(); + var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, unitIds, workPostIds,"", drpTrainType.SelectedValue,"","").OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList(); dpSysUser.DataTextField = "PersonName"; dpSysUser.DataValueField = "PersonId"; dpSysUser.DataSource = getDataList; diff --git a/SGGL/FineUIPro.Web/index.aspx b/SGGL/FineUIPro.Web/index.aspx index 9773e4f5..96ba1898 100644 --- a/SGGL/FineUIPro.Web/index.aspx +++ b/SGGL/FineUIPro.Web/index.aspx @@ -670,12 +670,12 @@ // refreshWhenExist: 添加选项卡时,如果选项卡已经存在,是否刷新内部IFrame // refreshWhenTabChange: 切换选项卡时,是否刷新内部IFrame F.initTreeTabStrip(mainMenu, mainTabStrip, true, false, false); - var themeTitle = F.cookie('Theme_Pro_Title'); - var themeName = F.cookie('Theme_Pro'); - if (themeTitle) { - F.removeCookie('Theme_Pro_Title'); - //notify('主题更改为:' + themeTitle + '(' + themeName + ')'); - } + //var themeTitle = F.cookie('Theme_Pro_Title'); + //var themeName = F.cookie('Theme_Pro'); + //if (themeTitle) { + // F.removeCookie('Theme_Pro_Title'); + // //notify('主题更改为:' + themeTitle + '(' + themeName + ')'); + //} }); diff --git a/SGGL/FineUIPro.Web/indexProject.aspx b/SGGL/FineUIPro.Web/indexProject.aspx index 8658c983..a34bdd36 100644 --- a/SGGL/FineUIPro.Web/indexProject.aspx +++ b/SGGL/FineUIPro.Web/indexProject.aspx @@ -762,12 +762,12 @@ // refreshWhenExist: 添加选项卡时,如果选项卡已经存在,是否刷新内部IFrame // refreshWhenTabChange: 切换选项卡时,是否刷新内部IFrame F.initTreeTabStrip(mainMenu, mainTabStrip, true, false, false); - var themeTitle = F.cookie('Theme_Pro_Title'); - var themeName = F.cookie('Theme_Pro'); - if (themeTitle) { - F.removeCookie('Theme_Pro_Title'); - //notify('主题更改为:' + themeTitle + '(' + themeName + ')'); - } + //var themeTitle = F.cookie('Theme_Pro_Title'); + //var themeName = F.cookie('Theme_Pro'); + //if (themeTitle) { + // F.removeCookie('Theme_Pro_Title'); + // //notify('主题更改为:' + themeTitle + '(' + themeName + ')'); + //} }); diff --git a/SGGL/FineUIPro.Web/res/qiaming.png b/SGGL/FineUIPro.Web/res/qiaming.png new file mode 100644 index 00000000..0dcc1a33 Binary files /dev/null and b/SGGL/FineUIPro.Web/res/qiaming.png differ diff --git a/SGGL/Model/APIItem/HSSE/PersonItem.cs b/SGGL/Model/APIItem/HSSE/PersonItem.cs index b549f141..78d0ec7c 100644 --- a/SGGL/Model/APIItem/HSSE/PersonItem.cs +++ b/SGGL/Model/APIItem/HSSE/PersonItem.cs @@ -120,7 +120,7 @@ namespace Model /// /// 是否启用 /// - public bool IsUsed { get; set; } + public string IsUsed { get; set; } /// /// 是否启用 /// diff --git a/SGGL/Model/APIItem/HSSE/TestRecordItem.cs b/SGGL/Model/APIItem/HSSE/TestRecordItem.cs index 2b4e16bd..16a4a1b8 100644 --- a/SGGL/Model/APIItem/HSSE/TestRecordItem.cs +++ b/SGGL/Model/APIItem/HSSE/TestRecordItem.cs @@ -247,5 +247,19 @@ namespace Model get; set; } + /// + /// 签名 + /// + public string Signature + { + get; + set; + } + public string Fingerprint + { + get; + set; + } + } } diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index e63a3170..22801700 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -360605,6 +360605,10 @@ namespace Model private int _Duration; + private string _Signature; + + private string _Fingerprint; + private EntityRef _Training_TestPlan; private EntitySet _Training_TestRecordItem; @@ -360635,6 +360639,10 @@ namespace Model partial void OnIsFiledChanged(); partial void OnDurationChanging(int value); partial void OnDurationChanged(); + partial void OnSignatureChanging(string value); + partial void OnSignatureChanged(); + partial void OnFingerprintChanging(string value); + partial void OnFingerprintChanged(); #endregion public Training_TestRecord() @@ -360868,6 +360876,46 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Signature", DbType="NVarChar(1000)")] + public string Signature + { + get + { + return this._Signature; + } + set + { + if ((this._Signature != value)) + { + this.OnSignatureChanging(value); + this.SendPropertyChanging(); + this._Signature = value; + this.SendPropertyChanged("Signature"); + this.OnSignatureChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Fingerprint", DbType="NVarChar(1000)")] + public string Fingerprint + { + get + { + return this._Fingerprint; + } + set + { + if ((this._Fingerprint != value)) + { + this.OnFingerprintChanging(value); + this.SendPropertyChanging(); + this._Fingerprint = value; + this.SendPropertyChanged("Fingerprint"); + this.OnFingerprintChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Training_TestRecord_Training_TestPlan", Storage="_Training_TestPlan", ThisKey="TestPlanId", OtherKey="TestPlanId", IsForeignKey=true)] public Training_TestPlan Training_TestPlan { diff --git a/SGGL/WebAPI/Controllers/DoorProject/DoorServiceController.cs b/SGGL/WebAPI/Controllers/DoorProject/DoorServiceController.cs index d8e27223..b0cdf281 100644 --- a/SGGL/WebAPI/Controllers/DoorProject/DoorServiceController.cs +++ b/SGGL/WebAPI/Controllers/DoorProject/DoorServiceController.cs @@ -174,11 +174,14 @@ namespace WebAPI.Controllers OutResult = person.OutResult, Birthday = person.Birthday, Telephone = person.Telephone, - IsUsed = (person.IsUsed == false ? 0 : 1), InTime = Funs.GetNewDateTimeOrNow(person.InTime), Password = BLL.PersonService.GetPersonPassWord(person.IdentityCard), Isprint = "0", }; + if (!string.IsNullOrEmpty(person.IsUsed)) + { + newPerson.IsUsed = int.Parse(person.IsUsed); + } if (!string.IsNullOrEmpty(person.TeamGroupName) && !string.IsNullOrEmpty(newPerson.UnitId)) { var getTeamGroup = TeamGroupService.getTeamGroupByTeamGroupName(getProject.ProjectId, newPerson.UnitId, person.TeamGroupName); diff --git a/SGGL/WebAPI/Controllers/HSSE/TestRecordController.cs b/SGGL/WebAPI/Controllers/HSSE/TestRecordController.cs index a07fbb43..d97c3654 100644 --- a/SGGL/WebAPI/Controllers/HSSE/TestRecordController.cs +++ b/SGGL/WebAPI/Controllers/HSSE/TestRecordController.cs @@ -1,5 +1,8 @@ using System; using System.Collections.Generic; +using System.Configuration; +using System.Drawing; +using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -350,7 +353,7 @@ namespace WebAPI.Controllers /// 交卷 /// /// 试卷ID - public Model.ResponeData getSubmitTestRecordByTestRecordId(string testRecordId) + public Model.ResponeData getSubmitTestRecordByTestRecordId(string testRecordId,string Signature) { var responeData = new Model.ResponeData(); try @@ -364,6 +367,7 @@ namespace WebAPI.Controllers { if (getTestRecord.TestStartTime.HasValue) { + getTestRecord.Signature = Signature; getTestRecord.TestEndTime = DateTime.Now; var getRItem = db.Training_TestRecordItem.Where(x => x.TestRecordId == testRecordId); if (getRItem.Count() > 0) @@ -410,5 +414,104 @@ namespace WebAPI.Controllers return responeData; } #endregion + + #region 交卷 + /// + /// 交卷 + /// + public Model.ResponeData SaveSubmitTestRecordByTestRecordId(Model.TestRecordItem testRecordItem) + { + string testRecordId = testRecordItem.TestRecordId; + string Signature = testRecordItem.Signature; + string Fingerprint = testRecordItem.Fingerprint; + var responeData = new Model.ResponeData(); + try + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var getTestRecord = db.Training_TestRecord.FirstOrDefault(e => e.TestRecordId == testRecordId); + if (getTestRecord != null) + { + string rootUrl = ConfigurationManager.AppSettings["localRoot"]; + string SignatureUrl = @"FileUpload\TestRecord\" + getTestRecord.TestRecordId + "~签名" + ".png"; + string FingerprintUrl = @"FileUpload\TestRecord\" + getTestRecord.TestRecordId + "~指纹" + ".png"; + string Signaturefilename = rootUrl + SignatureUrl; + string Fingerprintfilename = rootUrl + FingerprintUrl; + + if (!string.IsNullOrEmpty(Signature)) + { + Signature = Signature.Replace("data:image/svg+xml;base64,", "").Replace("data:image/png;base64,", "").Replace("data:image/jgp;base64,", "").Replace("data:image/jpg;base64,", "").Replace("data:image/jpeg;base64,", "");//将base64头部信息替换 + byte[] bytes = Convert.FromBase64String(Signature); + + MemoryStream memStream = new MemoryStream(bytes); + Image mImage = Image.FromStream(memStream); + Bitmap bp = new Bitmap(mImage); + MemoryStream ms = new MemoryStream(); + bp.Save(Signaturefilename, System.Drawing.Imaging.ImageFormat.Png); + // System.IO.File.WriteAllBytes(Signaturefilename, Convert.FromBase64String(Signature)); + + getTestRecord.Signature = Signaturefilename.Replace(rootUrl, ""); + + } + if (!string.IsNullOrEmpty(Fingerprint)) + { + Fingerprint = Fingerprint.Replace("data:image/svg+xml;base64,", "").Replace("data:image/png;base64,", "").Replace("data:image/jgp;base64,", "").Replace("data:image/jpg;base64,", "").Replace("data:image/jpeg;base64,", "");//将base64头部信息替换 + + byte[] bytes = Convert.FromBase64String(Fingerprint); + + MemoryStream memStream = new MemoryStream(bytes); + Image mImage = Image.FromStream(memStream); + Bitmap bp = new Bitmap(mImage); + MemoryStream ms = new MemoryStream(); + bp.Save(Fingerprintfilename, System.Drawing.Imaging.ImageFormat.Png); + + getTestRecord.Fingerprint = Fingerprintfilename.Replace(rootUrl, ""); + + } + + APITestRecordService.updateTestRecord(getTestRecord); + string returnTestRecordId = string.Empty; + ////考试分数 + decimal getTestScores = APITestRecordService.getSubmitTestRecord(getTestRecord); + ////及格分数 + int getPassScores = 80; + var testRule = db.Sys_TestRule.FirstOrDefault(); + if (testRule != null) + { + getPassScores = testRule.PassingScore; + } + if (getTestScores <= getPassScores) + { + int testCount = db.Training_TestRecord.Where(x => x.TestPlanId == getTestRecord.TestPlanId && x.TestManId == getTestRecord.TestManId).Count(); + if (testCount < 2) + { + ////重新生成一条考试记录 以及考试试卷 + returnTestRecordId = APITestRecordService.getResitTestRecord(getTestRecord); + responeData.message = "考试不合格!您的成绩为:【" + getTestScores.ToString() + "】,您将进入补考。"; + } + else + { + APITestRecordService.updateAll(getTestRecord.TestPlanId); + responeData.message = "考试不合格!您的成绩为:【" + getTestScores.ToString() + "】,请再次参加培训后补考。"; + } + } + else + { + APITestRecordService.updateAll(getTestRecord.TestPlanId); + responeData.message = "恭喜考试通过!您的成绩为:【" + getTestScores.ToString() + "】。"; + } + + responeData.data = new { getTestScores, getPassScores, returnTestRecordId }; + } + } + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + return responeData; + } + #endregion } } diff --git a/SGGL/WebAPI/Controllers/PersonController.cs b/SGGL/WebAPI/Controllers/PersonController.cs index 1ea7b715..e93df0bb 100644 --- a/SGGL/WebAPI/Controllers/PersonController.cs +++ b/SGGL/WebAPI/Controllers/PersonController.cs @@ -349,7 +349,7 @@ namespace WebAPI.Controllers /// 培训类型ID(可为空) /// 分页 /// - public Model.ResponeData getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId, int pageIndex) + public Model.ResponeData getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId, int pageIndex,string strParam,string InTime) { var responeData = new Model.ResponeData(); try @@ -366,7 +366,7 @@ namespace WebAPI.Controllers } else { - var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(projectId, unitIds, workPostIds, departIds, trainTypeId).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList(); + var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(projectId, unitIds, workPostIds, departIds, trainTypeId, InTime, strParam).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList(); int pageCount = getDataList.Count; if (pageCount > 0 && pageIndex > 0)
{0}{0}{0}{0}