diff --git a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user index a1d9585..72b6a27 100644 --- a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -2,7 +2,7 @@ true - Release|Any CPU + Debug|Any CPU diff --git a/HJGL_DS/FineUIPro.Web/Global.asax.cs b/HJGL_DS/FineUIPro.Web/Global.asax.cs index 33189ed..21fba8a 100644 --- a/HJGL_DS/FineUIPro.Web/Global.asax.cs +++ b/HJGL_DS/FineUIPro.Web/Global.asax.cs @@ -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 listStr = new List(); + 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) diff --git a/HJGL_DS/FineUIPro.Web/Login.aspx.cs b/HJGL_DS/FineUIPro.Web/Login.aspx.cs index 624bb35..ccfb8d1 100644 --- a/HJGL_DS/FineUIPro.Web/Login.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/Login.aspx.cs @@ -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 /// 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) diff --git a/HJGL_DS/FineUIPro.Web/Web.config b/HJGL_DS/FineUIPro.Web/Web.config index 30834b7..0066e09 100644 --- a/HJGL_DS/FineUIPro.Web/Web.config +++ b/HJGL_DS/FineUIPro.Web/Web.config @@ -11,7 +11,7 @@ - + @@ -67,7 +67,7 @@ - + diff --git a/HJGL_DS/WebAPI/WebAPI.csproj.user b/HJGL_DS/WebAPI/WebAPI.csproj.user index 28be9c4..a48b337 100644 --- a/HJGL_DS/WebAPI/WebAPI.csproj.user +++ b/HJGL_DS/WebAPI/WebAPI.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU FolderProfile true