This commit is contained in:
佘春生 2024-06-20 18:02:27 +08:00
parent 2e6503a4c6
commit 42535c3a7b
6 changed files with 78 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View File

@ -2,7 +2,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort />

View File

@ -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;

View File

@ -51,7 +51,7 @@
<add path="ChartImg.axd" verb="GET,POST,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" validate="false"/>
</httpHandlers>
<compilation debug="false" targetFramework="4.8">
<compilation debug="true" targetFramework="4.8">
<assemblies>
<!--<add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />-->
<add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

View File

@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
</PropertyGroup>
<ProjectExtensions>