diff --git a/DataBase/hjglDB_7_2024.06.20.rar b/DataBase/hjglDB_7_2024.06.20.rar new file mode 100644 index 0000000..e85ccd6 Binary files /dev/null and b/DataBase/hjglDB_7_2024.06.20.rar differ diff --git a/HJGL/.vs/HJGL/v17/.suo b/HJGL/.vs/HJGL/v17/.suo index 9bd2582..01103c4 100644 Binary files a/HJGL/.vs/HJGL/v17/.suo and b/HJGL/.vs/HJGL/v17/.suo differ diff --git a/HJGL/FineUIPro.Web/FineUIPro.Web.csproj.user b/HJGL/FineUIPro.Web/FineUIPro.Web.csproj.user index 0baedd9..8d0cdf2 100644 --- a/HJGL/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/HJGL/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -2,7 +2,7 @@ ProjectFiles - Release|Any CPU + Debug|Any CPU true diff --git a/HJGL/FineUIPro.Web/Global.asax.cs b/HJGL/FineUIPro.Web/Global.asax.cs index 32e6b03..972f1ff 100644 --- a/HJGL/FineUIPro.Web/Global.asax.cs +++ b/HJGL/FineUIPro.Web/Global.asax.cs @@ -46,13 +46,17 @@ AppDomain.Unload(AppDomain.CurrentDomain); } - // 开启线程 + // 开启线程 点口周期 不用了 //System.Threading.Thread LoadServiceData = new System.Threading.Thread(new System.Threading.ThreadStart(ExpirePoint)); //LoadServiceData.Start(); // 开启超焊信息提取 System.Threading.Thread LoadServiceSuperQue = new System.Threading.Thread(new System.Threading.ThreadStart(SuperQueWelding)); LoadServiceSuperQue.Start(); + + // 开启WPS可焊焊工提取 + System.Threading.Thread LoadServiceWPSWelder = new System.Threading.Thread(new System.Threading.ThreadStart(WPSWelder)); + LoadServiceWPSWelder.Start(); } private void ExpirePoint() @@ -278,6 +282,76 @@ Funs.DB.SubmitChanges(); } + private void WPSWelder() + { + //定义一个定时器,并开启和配置相关属性 + System.Timers.Timer WPSWelder = new System.Timers.Timer(); + //执行任务的周期 ,60分钟 + WPSWelder.Interval = 1000 * 60 * 60; + WPSWelder.Enabled = true; + WPSWelder.Start(); + WPSWelder.Elapsed += new System.Timers.ElapsedEventHandler(WPSWelder_Elapsed); + } + + void WPSWelder_Elapsed(object sender, System.Timers.ElapsedEventArgs e) + { + var wpsList = from x in Funs.DB.WPQ_WPQList where x.ProjectId == ((Model.Sys_User)Session["CurrUser"]).LoginProjectId select x; + var welderList = from x in Funs.DB.Welder_ProjectWelder where x.ProjectId == ((Model.Sys_User)Session["CurrUser"]).LoginProjectId select x; + foreach (var wps in wpsList) + { + string testWelder = string.Empty; + string materialStr = string.Empty; + + if (wps.MaterialId1 != null) + { + string[] matList = wps.MaterialId1.Split('|'); + + foreach (var matId in matList) + { + var mat = from x in Funs.DB.Base_Material where x.MaterialId == matId select x; + if (mat.Count() > 0 && !materialStr.Contains(mat.First().MaterialType)) + { + materialStr += mat.First().MaterialType + ","; + } + + } + } + if (materialStr != null) + { + materialStr = materialStr.Substring(0, materialStr.Length - 1); + } + string[] wpsMaterial = materialStr.Split(','); + + // 焊工考试情况 + foreach (var welder in welderList) + { + var welderTestList = from x in Funs.DB.Welder_TestInfo where x.WelderId == welder.WelderId select x; + if (welderTestList.Count() > 0) + { + foreach (var t in welderTestList) + { + if (t.MaterialId != null && wps.WeldingMethodId != null) + { + string[] testMaterial = t.MaterialId.Split(','); + if (wpsMaterial.All(x => testMaterial.Contains(x)) && wps.WeldingMethodId.Contains(t.WeldMethodId) && t.IsPass == true) + { + testWelder += welder.WelderId + "|"; + break; + } + } + } + } + } + if (testWelder != string.Empty) + { + testWelder = testWelder.Substring(0, testWelder.Length - 1); + wps.WelderIds = testWelder; + Funs.DB.SubmitChanges(); + } + } + } + + protected void Session_Start(object sender, EventArgs e) { Session.Timeout = 36000; diff --git a/HJGL/FineUIPro.Web/Web.config b/HJGL/FineUIPro.Web/Web.config index 8868ed3..baa8804 100644 --- a/HJGL/FineUIPro.Web/Web.config +++ b/HJGL/FineUIPro.Web/Web.config @@ -51,7 +51,7 @@ - + diff --git a/HJGL/WebApi/WebApi.csproj.user b/HJGL/WebApi/WebApi.csproj.user index 33091aa..6db81e9 100644 --- a/HJGL/WebApi/WebApi.csproj.user +++ b/HJGL/WebApi/WebApi.csproj.user @@ -8,7 +8,7 @@ - Release|Any CPU + Debug|Any CPU FolderProfile