From 4d7e4d180624fd48b4e95435bef9e0d04d47cc0f Mon Sep 17 00:00:00 2001 From: geh <1923421292@qq.com> Date: Mon, 14 Apr 2025 19:47:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=B8=80=E4=BA=BA=E4=B8=80=E6=A1=A3?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SUBQHSE/BLL/API/HSSE/APITestRecordService.cs | 69 +++ SUBQHSE/BLL/BLL.csproj | 36 +- SUBQHSE/BLL/Common/WordHelp.cs | 38 +- SUBQHSE/BLL/HSSE/SitePerson/PersonService.cs | 24 + SUBQHSE/BLL/SysManage/SysConstSetService.cs | 14 + .../Person/安全教育培训打印整套(电工).doc | Bin 0 -> 134144 bytes SUBQHSE/FineUIPro.Web/FineUIPro.Web.csproj | 3 + .../HSSE/SitePerson/PersonList.aspx | 3 + .../HSSE/SitePerson/PersonList.aspx.cs | 518 ++++++++++++++++ .../SitePerson/PersonList.aspx.designer.cs | 9 + SUBQHSE/Model/APIItem/HSSE/TestRecordItem.cs | 14 + SUBQHSE/Model/Model.cs | 561 ++++++++++++++---- .../Controllers/HSSE/TestRecordController.cs | 493 +++++++++------ 13 files changed, 1483 insertions(+), 299 deletions(-) create mode 100644 SUBQHSE/FineUIPro.Web/File/Word/Person/安全教育培训打印整套(电工).doc diff --git a/SUBQHSE/BLL/API/HSSE/APITestRecordService.cs b/SUBQHSE/BLL/API/HSSE/APITestRecordService.cs index c411888..03cd753 100644 --- a/SUBQHSE/BLL/API/HSSE/APITestRecordService.cs +++ b/SUBQHSE/BLL/API/HSSE/APITestRecordService.cs @@ -897,5 +897,74 @@ namespace BLL } } #endregion + + + public static List getTrainingTestRecordListByDepartId( string unitId, string departId, string strPass, string strParam) + { + using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) + { + var getDataLists = (from x in db.Training_TestRecord + join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId + join z in db.Sys_User on x.TestManId equals z.UserId + where x.ProjectId == null && x.TestStartTime.HasValue && x.TestEndTime.HasValue + orderby x.TestStartTime descending + select new Model.TestRecordItem + { + TestRecordId = x.TestRecordId, + ProjectId = x.ProjectId, + TestPlanId = x.TestPlanId, + TestPlanName = y.PlanName, + UnitId = z.UnitId, + UnitName = getUnitName(z.UnitId), + WorkPostId = z.WorkPostId, + WorkPostName = db.Base_WorkPost.FirstOrDefault(p => p.WorkPostId == z.WorkPostId).WorkPostName, + DepartId = z.DepartId, + TestManId = x.TestManId, + TestManName = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == x.TestManId).PersonName, + TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime), + TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime), + Duration = x.Duration, + TestPlanEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime.Value.AddMinutes(x.Duration)), + TotalScore = y.TotalScore ?? 0, + TestScores = x.TestScores ?? 0, + TestType = x.TestType, + TemporaryUser = x.TemporaryUser, + }); + if (!string.IsNullOrEmpty(unitId)) + { + getDataLists = getDataLists.Where(x => x.UnitId == unitId); + } + if (!string.IsNullOrEmpty(departId)) + { + getDataLists = getDataLists.Where(x => x.DepartId == departId); + } + if (!string.IsNullOrEmpty(strParam)) + { + getDataLists = getDataLists.Where(x => x.TestManName.Contains(strParam)); + } + if (!string.IsNullOrEmpty(strPass)) + { + int PassingScore = SysConstSetService.getPassScoreForApi(); + if (strPass == "0") + { + getDataLists = getDataLists.Where(x => x.TestScores < PassingScore); + } + else + { + getDataLists = getDataLists.Where(x => x.TestScores >= PassingScore); + } + } + foreach(var item in getDataLists) + { + var depart = db.Base_Depart.FirstOrDefault(x => x.DepartId == item.DepartId); + if (depart != null) + { + item.DepartName = depart.DepartName; + } + + } + return getDataLists.ToList(); + } + } } } \ No newline at end of file diff --git a/SUBQHSE/BLL/BLL.csproj b/SUBQHSE/BLL/BLL.csproj index 3591c44..562f9cb 100644 --- a/SUBQHSE/BLL/BLL.csproj +++ b/SUBQHSE/BLL/BLL.csproj @@ -67,8 +67,11 @@ ..\packages\SharpZipLib.1.3.3\lib\net45\ICSharpCode.SharpZipLib.dll - - ..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\netstandard2.0\Microsoft.Bcl.AsyncInterfaces.dll + + + ..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll ..\packages\Microsoft.QualityTools.Testing.Fakes.16.11.230815\lib\net35\Microsoft.QualityTools.Testing.Fakes.dll @@ -78,6 +81,7 @@ False C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.ManagedDTS\v4.0_16.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ManagedDTS.dll + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll @@ -97,12 +101,18 @@ False ..\FineUIPro\Reference BLL\NPOI.OpenXmlFormats.dll + + ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net461\Pipelines.Sockets.Unofficial.dll + ..\packages\Quartz.3.7.0\lib\netstandard2.0\Quartz.dll ..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll + + ..\packages\StackExchange.Redis.2.7.33\lib\net461\StackExchange.Redis.dll + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll @@ -119,6 +129,12 @@ + + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + + + ..\packages\System.IO.Pipelines.5.0.1\lib\net461\System.IO.Pipelines.dll + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll @@ -129,6 +145,9 @@ ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + @@ -142,6 +161,9 @@ + + ..\packages\System.Threading.Channels.5.0.0\lib\net461\System.Threading.Channels.dll + ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll @@ -263,6 +285,9 @@ + + + @@ -1504,6 +1529,13 @@ + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}. + + +