This commit is contained in:
高飞 2026-01-19 17:11:58 +08:00
parent 3943a1f9ef
commit 5dce699ffd
5 changed files with 247 additions and 6 deletions

View File

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

View File

@ -55,6 +55,7 @@
System.Timers.Timer Wtimer = new System.Timers.Timer();
//执行任务的周期 ,20分钟
Wtimer.Interval = 1000 * 60 * 60;
//Wtimer.Interval = 1000 * 60;
Wtimer.Enabled = true;
Wtimer.Start();
Wtimer.Elapsed += new System.Timers.ElapsedEventHandler(Wtimer_Elapsed);
@ -62,6 +63,241 @@
void Wtimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
#region
// 获取未进入批的已焊焊口
Model.SGGLDB db2 = Funs.DB;
var joint2s = from x in db2.HJGL_PW_JointInfo
join y in db2.HJGL_BO_BatchDetail on x.JOT_ID equals y.JOT_ID into g
from y in g.DefaultIfEmpty()
where x.DReportID != null && y.JOT_ID == null
select x;
var jointList = from x in db2.HJGL_PW_JointInfo select x;
var isoList = from x in db2.HJGL_PW_IsoInfo select x;
foreach (var newJointInfo in joint2s)
{
var isoInfo = isoList.FirstOrDefault(x => x.ISO_ID == newJointInfo.ISO_ID);
// 获取组批条件
var batchC = BLL.Project_SysSetService.GetSysSetBySetId("5", newJointInfo.ProjectId);
if (batchC != null)
{
string batchCondition = batchC.SetValue;
string[] condition = batchCondition.Split('|');
bool isPass = true;
foreach (string c in condition)
{
if (c == "1")
{
if (string.IsNullOrEmpty(newJointInfo.InstallationId))
{
isPass = false;
break;
}
}
if (c == "2")
{
if (string.IsNullOrEmpty(newJointInfo.NDTR_ID))
{
isPass = false;
break;
}
}
if (c == "3")
{
if (string.IsNullOrEmpty(newJointInfo.JOTY_ID))
{
isPass = false;
break;
}
}
if (c == "4")
{
if (string.IsNullOrEmpty(isoInfo.ISC_ID))
{
isPass = false;
break;
}
}
if (c == "5")
{
if (string.IsNullOrEmpty(isoInfo.STE_ID))
{
isPass = false;
break;
}
}
if (c == "6")
{
if (string.IsNullOrEmpty(isoInfo.ISO_Executive))
{
isPass = false;
break;
}
}
if (c == "9")
{
if (string.IsNullOrEmpty(newJointInfo.ISO_ID))
{
isPass = false;
break;
}
}
if (c == "10")
{
if (string.IsNullOrEmpty(isoInfo.SER_ID))
{
isPass = false;
break;
}
}
if (c == "11")
{
if (string.IsNullOrEmpty(newJointInfo.PressureTestPackageNo))
{
isPass = false;
break;
}
}
}
if (isPass)
{
string strSql = @"SELECT BatchId FROM dbo.HJGL_BO_Batch
WHERE (BatchIsClosed=0 OR BatchIsClosed IS NULL)
AND ProjectId = @ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", newJointInfo.ProjectId));
if (condition.Contains("1"))
{
strSql += " AND InstallationId =@InstallationId";
listStr.Add(new SqlParameter("@InstallationId", newJointInfo.InstallationId));
}
if (condition.Contains("2"))
{
strSql += " AND NDTR_ID =@NDTR_ID";
listStr.Add(new SqlParameter("@NDTR_ID", newJointInfo.NDTR_ID));
}
if (condition.Contains("3"))
{
strSql += " AND JOTY_ID =@JOTY_ID";
listStr.Add(new SqlParameter("@JOTY_ID", newJointInfo.JOTY_ID));
}
if (condition.Contains("4"))
{
strSql += " AND ISC_ID =@ISC_ID";
listStr.Add(new SqlParameter("@ISC_ID", isoInfo.ISC_ID));
}
if (condition.Contains("5"))
{
strSql += " AND STE_ID =@STE_ID";
listStr.Add(new SqlParameter("@STE_ID", isoInfo.STE_ID));
}
if (condition.Contains("6"))
{
strSql += " AND ExecStandardId =@ExecStandardId";
listStr.Add(new SqlParameter("@ExecStandardId", isoInfo.ISO_Executive));
}
if (condition.Contains("7"))
{
strSql += " AND IsSpecial =@IsSpecial";
listStr.Add(new SqlParameter("@IsSpecial", newJointInfo.IsSpecial));
}
if (condition.Contains("8"))
{
strSql += " AND WED_ID =@WED_ID";
listStr.Add(new SqlParameter("@WED_ID", newJointInfo.JOT_CellWelder));
}
if (condition.Contains("9"))
{
strSql += " AND ISO_ID =@ISO_ID";
listStr.Add(new SqlParameter("@ISO_ID", newJointInfo.ISO_ID));
}
if (condition.Contains("10"))
{
strSql += " AND SER_ID =@SER_ID";
listStr.Add(new SqlParameter("@SER_ID", isoInfo.SER_ID));
}
if (condition.Contains("11"))
{
strSql += " AND TestPackage =@TestPackage";
listStr.Add(new SqlParameter("@TestPackage", newJointInfo.PressureTestPackageNo));
}
if (newJointInfo.IsGold == true) //黄金口单独组批
{
strSql += " AND IsGold =1";
}
SqlParameter[] parameter = listStr.ToArray();
DataTable batchInfo = SQLHelper.GetDataTableRunText(strSql, parameter);
//var batchInfo = from x in Funs.DB.HJGL_BO_Batch
// where x.ProjectId == this.drpProjectId.SelectedValue
// && x.InstallationId == newJointInfo.InstallationId && x.ISC_ID == isoInfo.ISC_ID
// && x.STE_ID == isoInfo.STE_ID
// && x.ExecStandardId == isoInfo.ISO_Executive && x.JOTY_ID == newJointInfo.JOTY_ID
// && x.NDTR_ID == newJointInfo.NDTR_ID && x.IsSpecial == newJointInfo.IsSpecial
// && (x.BatchIsClosed == null || x.BatchIsClosed == false)
// select x;
string batchId = string.Empty;
if (batchInfo.Rows.Count == 0)
{
Model.HJGL_BO_Batch batch = new Model.HJGL_BO_Batch();
batch.BatchId = SQLHelper.GetNewID(typeof(Model.HJGL_BO_Batch));
batchId = batch.BatchId;
//string perfix = ins.InstallationCode + "-" + isoC.ISC_IsoCode + "-" + ser.SER_Abbreviate + "-" + execS.ExecStandardName + "-";
batch.BatchCode = BLL.SQLHelper.RunProcFlowCode("SpGetFlowCode", "dbo.HJGL_BO_Batch", "BatchCode", newJointInfo.ProjectId);
batch.ProjectId = newJointInfo.ProjectId;
batch.InstallationId = newJointInfo.InstallationId;
batch.BatchCondition = batchC.SetValue;
batch.NDTR_ID = newJointInfo.NDTR_ID;
batch.JOTY_ID = newJointInfo.JOTY_ID;
batch.ISC_ID = isoInfo.ISC_ID;
batch.STE_ID = isoInfo.STE_ID;
batch.ExecStandardId = isoInfo.ISO_Executive;
batch.IsSpecial = newJointInfo.IsSpecial;
batch.WED_ID = newJointInfo.JOT_CellWelder;
batch.ISO_ID = newJointInfo.ISO_ID;
batch.SER_ID = isoInfo.SER_ID;
batch.TestPackage = newJointInfo.PressureTestPackageNo;
batch.BatchStartDate = DateTime.Now.Date;
if (newJointInfo.IsGold == true) //黄金口单独组批
{
batch.IsGold = true;
}
BLL.HJGL_BO_BatchService.AddBatch(batch);
}
else
{
batchId = batchInfo.Rows[0][0].ToString();
}
var bd = BLL.HJGL_BO_BatchDetailService.GetBatchDetailByJotId(newJointInfo.JOT_ID);
if (bd == null)
{
try
{
Model.HJGL_BO_BatchDetail batchDetail = new Model.HJGL_BO_BatchDetail();
batchDetail.BatchDetailId = SQLHelper.GetNewID(typeof(Model.HJGL_BO_BatchDetail));
batchDetail.BatchId = batchId;
batchDetail.ISO_ID = newJointInfo.ISO_ID;
batchDetail.JOT_ID = newJointInfo.JOT_ID;
BLL.Funs.DB.HJGL_BO_BatchDetail.InsertOnSubmit(batchDetail);
BLL.Funs.DB.SubmitChanges();
}
catch
{
}
}
}
}
}
#endregion
// 得到 hour minute second 如果等于某个值就开始执行某个程序。
int intHour = e.SignalTime.Hour;
int intMinute = e.SignalTime.Minute;
@ -749,6 +985,8 @@
}
db1.SubmitChanges();
#endregion
}
protected void Session_Start(object sender, EventArgs e)

View File

@ -8,6 +8,9 @@ using System.Text;
using System.Security.Cryptography;
using CodeName.APPa;
using System.Linq;
using System.Data.SqlClient;
using System.Data;
using System.Collections.Generic;
namespace FineUIPro.Web
{
@ -49,10 +52,10 @@ namespace FineUIPro.Web
/// <param name="e"></param>
protected void btnLogin_Click(object sender, EventArgs e)
{
string userName = this.tbxUserName.Text;
string password = this.tbxPassword.Text;
bool rememberMe = this.savemessgae.Checked;
bool rememberMe = this.savemessgae.Checked;
bool isLogin = false;
var sysUser = Funs.DB.Sys_User.FirstOrDefault(x => x.Account == userName && x.IsPost == true);
if (sysUser != null)

View File

@ -11,7 +11,7 @@
<FineUIPro DebugMode="false" Theme="Cupertino"/>
<appSettings>
<!--连接字符串-->
<add key="ConnectionString" value="Server=.\SQL2022;Database=HJGLDB_DS;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Max Pool Size = 1000;Connect Timeout=1200"/>
<add key="ConnectionString" value="Server=.\MSSQLSERVER01;Database=HJGLDB_DS;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Max Pool Size = 1000;Connect Timeout=1200"/>
<!--系统名称-->
<add key="SystemName" value="诺必达焊接管理系统"/>
<add key="ChartImageHandler" value="storage=file;timeout=20;url=~/Images/;"/>
@ -67,7 +67,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="FastReport.Export.axd" verb="*" type="FastReport.Web.Handlers.WebExport"/>
</httpHandlers>
<compilation debug="false" targetFramework="4.6.1">
<compilation debug="true" targetFramework="4.6.1">
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />