From 9c2b6d962a5068e5d56de9d081c672cc21053719 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Thu, 26 Dec 2024 14:42:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=90=E6=96=99=E5=8C=B9=E9=85=8D=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=84=8A=E6=8E=A5=E4=BB=BB=E5=8A=A1=E5=8D=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/SGGL_SeDin_New/v17/.wsuo | Bin 60928 -> 71680 bytes SGGL/BLL/CLGL/TwInOutplanmasterService.cs | 44 +++++++-- .../BLL/HJGL/WeldingManage/WeldTaskService.cs | 37 ++++++-- .../CLGL/OutPlanMasterSelect.aspx.cs | 1 + .../Fastreport/管道焊口检测委托单NoPic.frx | 16 ++-- .../File/Fastreport/管道焊接任务单.frx | 4 +- .../File/Fastreport/组件打印.frx | 4 +- .../HJGL/DataImport/MaterialInformation.aspx | 6 +- .../DataImport/MaterialInformation.aspx.cs | 34 ++++++- .../WeldingManage/SelectTaskWeldJoint.aspx.cs | 24 +++-- .../HJGL/WeldingManage/WeldMatMatch.aspx | 4 +- .../HJGL/WeldingManage/WeldMatMatch.aspx.cs | 29 +++++- .../HJGL/WeldingManage/WeldTask.aspx.cs | 41 +++++---- SGGL/Model/Model.cs | 84 ++++++++++++++++++ 14 files changed, 272 insertions(+), 56 deletions(-) diff --git a/.vs/SGGL_SeDin_New/v17/.wsuo b/.vs/SGGL_SeDin_New/v17/.wsuo index 49c981724525a2d528c6e26b047bbbb49e2ef9b0..f619c8e51db83e10cc195d92181ef74659a5facb 100644 GIT binary patch delta 7922 zcmeHMYfu~472XvB%UFOR*uk~}LM9F-2qYu{q5_L&gab$*0rnV=y+|vN5fYJhF?O0t z>1&!aO+hDV@}o%|C)3PiJRNsPfAldE;^aqvWD;klKbq#{X`E@AbdqTXezd+x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.cs +++ b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs @@ -181,7 +181,7 @@ namespace BLL ReqUnitId = x.ReqUnitId, ReqUnitName = x.ReqUnitName, UnitWorkId = x.UnitWorkId, - WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == DateTime.ParseExact(x.WeldTaskId.Split('|')[2].ToString(), "yyyyMMdd", null).Date)?.TaskCode : "" : "", + WeldTaskCode = GetWeldTaskCode(x.WeldTaskId), CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key, @@ -198,6 +198,38 @@ namespace BLL }; } + public static string GetWeldTaskCode( string WeldTaskId) + { + string result=String.Empty; + + if (string.IsNullOrEmpty(WeldTaskId)) return result; + + if (WeldTaskId.Split('|').Length==3) //用于处理历史数据 + { + result = (from x in Funs.DB.HJGL_WeldTask + where x.UnitWorkId == WeldTaskId.Split('|')[0].ToString() + && x.UnitId == WeldTaskId.Split('|')[1].ToString() + && x.TaskDate.Value.Date == + DateTime.ParseExact(WeldTaskId.Split('|')[2].ToString(), "yyyyMMdd", null) + select x.TaskCode).FirstOrDefault() + ?.ToString(); + + } + else if (WeldTaskId.Split('|').Length == 4) + { + result = (from x in Funs.DB.HJGL_WeldTask + where x.UnitWorkId == WeldTaskId.Split('|')[0].ToString() + && x.UnitId == WeldTaskId.Split('|')[1].ToString() + && x.TaskDate.Value.Date == + DateTime.ParseExact(WeldTaskId.Split('|')[2].ToString(), "yyyyMMdd", null) + && x.SerialNumber== WeldTaskId.Split('|')[3] + select x.TaskCode).FirstOrDefault() + ?.ToString(); + } + + return result; + + } #endregion @@ -560,15 +592,15 @@ namespace BLL /// /// /// - public static void GenOutPlanmasterByWeldTaskId(string unitworkid,string unitid,DateTime date,string Personid) + public static void GenOutPlanmasterByWeldTaskId(string unitworkid,string unitid,DateTime date,string serialNumber, string Personid) { Model.SGGLDB db = Funs.DB; - Model.View_HJGL_WeldingTask weldTask = db.View_HJGL_WeldingTask.FirstOrDefault(e => e.UnitWorkId==unitworkid && e.UnitId==unitid&& e.TaskDate.Value.Date==date.Date); + Model.View_HJGL_WeldingTask weldTask = db.View_HJGL_WeldingTask.FirstOrDefault(e => e.UnitWorkId==unitworkid && e.UnitId==unitid&& e.TaskDate.Value.Date==date.Date && e.SerialNumber==serialNumber); if (weldTask==null) { return; } - string WeldTaskId= unitworkid+"|"+unitid+ "|" + string.Format("{0:yyyyMMdd}", date); + string WeldTaskId= unitworkid+"|"+unitid+ "|" + string.Format("{0:yyyyMMdd}", date)+"|"+serialNumber; //判断是否已经生成过出库计划单 var queryIsExitInMaster = new Tw_InOutMasterOutput(); queryIsExitInMaster.WeldTaskId = WeldTaskId; @@ -579,7 +611,7 @@ namespace BLL { return; } - var pipelineList = db.View_HJGL_WeldingTask.Where(e => e.UnitWorkId == unitworkid && e.UnitId == unitid && e.TaskDate.Value.Date == date.Date).Select(x=>x.PipelineId).Distinct().ToList(); + var pipelineList = db.View_HJGL_WeldingTask.Where(e => e.UnitWorkId == unitworkid && e.UnitId == unitid && e.TaskDate.Value.Date == date.Date && e.SerialNumber == serialNumber).Select(x=>x.PipelineId).Distinct().ToList(); var MaterDatial= from x in db.HJGL_PipeLineMat join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode @@ -700,5 +732,5 @@ namespace BLL } - } + } } \ No newline at end of file diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs index 222195ed..188a9ede 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs @@ -35,10 +35,13 @@ namespace BLL public static string GetTaskCodeByDate(string projectId, string date,string unitworkid,string unitid) { string code = string.Empty; - var list = (from x in Funs.DB.HJGL_WeldTask where x.ProjectId == projectId && x.TaskDate == Convert.ToDateTime(date) orderby x.TaskCode descending select x.TaskCode).Distinct().ToList(); - if (list.Count > 0) + var list = (from x in Funs.DB.HJGL_WeldTask where x.ProjectId == projectId && x.UnitWorkId== unitworkid && x.UnitId== unitid && x.TaskDate == Convert.ToDateTime(date) orderby x.TaskCode descending select x.TaskCode).Distinct().ToList(); + var count = list.Count; + code = date +"-"+ (count + 1).ToString("D3") + UnitService.GetUnitCodeByUnitId(unitid) + "-" + UnitWorkService.getUnitWorkByUnitWorkId(unitworkid)?.UnitWorkCode; + /*if (list.Count > 0) { string oldCode = list[0]; + if (oldCode.Length > 4) { string partCode = oldCode.Substring(8,3); @@ -65,15 +68,32 @@ namespace BLL { code = date + "-001"; } - code = code.Replace("-", "") + "-" + UnitService.GetUnitCodeByUnitId(unitid) + "-" + UnitWorkService.getUnitWorkByUnitWorkId(unitworkid)?.UnitWorkCode; + code = code.Replace("-", "") + "-" + UnitService.GetUnitCodeByUnitId(unitid) + "-" + UnitWorkService.getUnitWorkByUnitWorkId(unitworkid)?.UnitWorkCode;*/ return code; } - public static List GetWeldingTaskList(string ProjectId, string UnitWorkId, string unitId, DateTime taskDate, string canWelder) + public static string GetSerialNumberByDate(string projectId, string date, string unitworkid, string unitid) + { + string code = string.Empty; + var list = (from x in Funs.DB.HJGL_WeldTask where x.ProjectId == projectId && x.UnitWorkId == unitworkid && x.UnitId == unitid && x.TaskDate == Convert.ToDateTime(date) orderby x.TaskCode descending select x.TaskCode).Distinct().ToList(); + var count = list.Count; + code = (count + 1).ToString("D3"); + return code; + } + public static string GetSerialNumberByDate(string projectId,string taskCode) + { + string result = string.Empty; + var list = (from x in Funs.DB.HJGL_WeldTask where x.ProjectId == projectId && x.TaskCode == taskCode orderby x.SerialNumber descending select x.SerialNumber).FirstOrDefault(); + + result = list?.ToString(); + return result; + } + + public static List GetWeldingTaskList(string ProjectId, string UnitWorkId, string unitId, DateTime taskDate, string canWelder,string serialNumber) { var q = from x in Funs.DB.View_HJGL_WeldingTask where x.ProjectId == ProjectId && x.UnitWorkId == UnitWorkId - && x.TaskDate.Value.Date == taskDate.Date + && x.TaskDate.Value.Date == taskDate.Date && x.SerialNumber==serialNumber select x; if (!string.IsNullOrEmpty(unitId)) { @@ -115,7 +135,9 @@ namespace BLL WeldingRod = WeldTask.WeldingRod, WeldingWire = WeldTask.WeldingWire, CanWeldingRodName = WeldTask.CanWeldingRodName, - CanWeldingWireName = WeldTask.CanWeldingWireName + CanWeldingWireName = WeldTask.CanWeldingWireName, + PipeLineSortIndex = WeldTask.PipeLineSortIndex, + SerialNumber = WeldTask.SerialNumber }; @@ -146,7 +168,8 @@ namespace BLL newWeldTask.TableDate = WeldTask.TableDate; newWeldTask.WeldingMode = WeldTask.WeldingMode; newWeldTask.IsSaved = WeldTask.IsSaved; - + newWeldTask.SerialNumber= WeldTask.SerialNumber; + newWeldTask.PipeLineSortIndex= WeldTask.PipeLineSortIndex; db.SubmitChanges(); } } diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelect.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelect.aspx.cs index 7b8d0010..6f441cfc 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelect.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelect.aspx.cs @@ -224,6 +224,7 @@ namespace FineUIPro.Web.CLGL from z in zz.DefaultIfEmpty() join lib in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals lib.MaterialCode where y.ProjectId == this.CurrUser.LoginProjectId + && z.ProjectId == this.CurrUser.LoginProjectId && y.UnitWorkId == this.UnitWorkId && y.PipelineId == this.tvControlItem.SelectedNodeID && (x.PrefabricatedComponents==null||x.PrefabricatedComponents=="") diff --git a/SGGL/FineUIPro.Web/File/Fastreport/管道焊口检测委托单NoPic.frx b/SGGL/FineUIPro.Web/File/Fastreport/管道焊口检测委托单NoPic.frx index a5fedbe1..e84a3140 100644 --- a/SGGL/FineUIPro.Web/File/Fastreport/管道焊口检测委托单NoPic.frx +++ b/SGGL/FineUIPro.Web/File/Fastreport/管道焊口检测委托单NoPic.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -89,7 +89,7 @@ namespace FastReport } - + @@ -122,7 +122,7 @@ namespace FastReport - + @@ -241,7 +241,7 @@ namespace FastReport - + @@ -272,8 +272,8 @@ namespace FastReport - - + + @@ -297,7 +297,7 @@ namespace FastReport - + @@ -338,7 +338,7 @@ namespace FastReport - + diff --git a/SGGL/FineUIPro.Web/File/Fastreport/管道焊接任务单.frx b/SGGL/FineUIPro.Web/File/Fastreport/管道焊接任务单.frx index 78ec0792..2bc28a83 100644 --- a/SGGL/FineUIPro.Web/File/Fastreport/管道焊接任务单.frx +++ b/SGGL/FineUIPro.Web/File/Fastreport/管道焊接任务单.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -59,7 +59,7 @@ namespace FastReport } - + diff --git a/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx b/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx index 5777f8af..ccf889e3 100644 --- a/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx +++ b/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -99,7 +99,7 @@ namespace FastReport } - + diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx index 0dca75f9..053453af 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx @@ -241,7 +241,7 @@ - + @@ -282,13 +282,13 @@ - - diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs index 1092e77d..f84e9497 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs @@ -487,7 +487,7 @@ namespace FineUIPro.Web.HJGL.DataImport #region 右键菜单删除 - protected void btnDelMat_Click(object sender, EventArgs e) + protected void btnDelMatGrid2_Click(object sender, EventArgs e) { if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldJointMenuId, Const.BtnDelete)) { @@ -517,6 +517,38 @@ namespace FineUIPro.Web.HJGL.DataImport ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); } } + + protected void btnDelMatGrid3_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldJointMenuId, Const.BtnDelete)) + { + if (Grid3.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + + foreach (int rowIndex in Grid3.SelectedRowIndexArray) + { + string rowID = Grid3.DataKeys[rowIndex][0].ToString(); + + BLL.PipelineMatService.DeletePipeLineMat(rowID); + //BLL.Sys_LogService.AddLog(BLL.Const.System_6, this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_PipelineMenuId, Const.BtnDelete, rowID); + ShowNotify("删除成功!", MessageBoxIcon.Success); + + } + + this.BindGrid1(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text); + this.BindGrid2(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text); + this.BindGrid3(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text); + + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + protected void btnDelMatGrid1_Click(object sender, EventArgs e) { if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldJointMenuId, Const.BtnDelete)) diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs index e19c6f55..99420417 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs @@ -42,7 +42,17 @@ namespace FineUIPro.Web.HJGL.WeldingManage ViewState["UnitWorkId"] = value; } } - + public string SerialNumber + { + get + { + return (string)ViewState["SerialNumber"]; + } + set + { + ViewState["SerialNumber"] = value; + } + } // 任务日期 public string TaskDate { @@ -123,12 +133,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage string strList = Request.Params["strList"]; List list = Funs.GetStrListByStr(strList, '|'); - if (list.Count() == 3) + if (list.Count() == 4) { this.UnitWorkId = list[0]; string unitId = list[1]; TaskDate = list[2]; - + SerialNumber = list[3]; InitDropList(); Model.WBS_UnitWork UnitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(this.UnitWorkId); @@ -142,7 +152,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage txtTaskDate.Enabled = false; var task = (from x in Funs.DB.HJGL_WeldTask where x.UnitWorkId == UnitWorkId && x.UnitId == unitId - && x.TaskDate.Value.Date.ToString() == Convert.ToDateTime(txtTaskDate.Text.Trim()).ToString("yyyy-MM-dd") + && x.TaskDate.Value.Date.ToString() == Convert.ToDateTime(txtTaskDate.Text.Trim()).ToString("yyyy-MM-dd") && x.SerialNumber==SerialNumber select x).FirstOrDefault(); if (task != null) { @@ -169,14 +179,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage Model.WBS_UnitWork UnitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(this.UnitWorkId); BLL.UnitService.InitUnitDropDownListByUnitIds(this.drpUnit, UnitWork.UnitId, false);//单位 this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text, list[0], drpUnit.SelectedValue); - + SerialNumber= BLL.WeldTaskService.GetSerialNumberByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text, list[0], drpUnit.SelectedValue); if (!string.IsNullOrEmpty(TaskDate)) { txtTaskDate.Text = TaskDate; txtTaskDate.Enabled = false; var task = (from x in Funs.DB.HJGL_WeldTask where x.UnitWorkId == UnitWorkId - && x.TaskDate.Value.Date.ToString() == Convert.ToDateTime(txtTaskDate.Text.Trim()).ToString("yyyy-MM-dd") + && x.TaskDate.Value.Date.ToString() == Convert.ToDateTime(txtTaskDate.Text.Trim()).ToString("yyyy-MM-dd") && x.SerialNumber == SerialNumber select x).FirstOrDefault(); if (task != null) { @@ -540,6 +550,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage NewTask.UnitId = drpUnit.SelectedValue; NewTask.TaskCode = this.txtTaskCode.Text.Trim(); + NewTask.SerialNumber = SerialNumber; + NewTask.WeldTaskId = SQLHelper.GetNewID(); NewTask.WeldJointId = selectRowId[i]; var oldWeldTask = BLL.WeldTaskService.GetWeldTaskByWeldJointId(NewTask.WeldJointId); diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx index 5cb2ae6e..be578e6c 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx @@ -91,7 +91,7 @@ + BodyPadding="10px" AutoScroll="true"> @@ -104,7 +104,7 @@ - unitworkTaskCode = new Dictionary(); + Dictionary unitworkSerialNumber = new Dictionary(); + Dictionary matchPipeline = new Dictionary(); + foreach (var rowIndex in Grid2.SelectedRowIndexArray) + { + matchPipeline.Add(rowIndex+1, Grid2.Rows[rowIndex].RowID); + } if (PipeArea=="1") //工厂预制的管线,则只选择预制口 { selectRowId = selectRowId.Where(x => x.JointAttribute == "预制口").ToList(); @@ -632,8 +640,26 @@ namespace FineUIPro.Web.HJGL.WeldingManage NewTask.ProjectId = this.CurrUser.LoginProjectId; NewTask.UnitWorkId = PipelineService.GetPipelineByPipelineId(weldjoint.PipelineId)?.UnitWorkId; NewTask.UnitId = this.CurrUser.UnitId; + if (unitworkTaskCode.FirstOrDefault(x=>x.Key== NewTask.UnitWorkId).Value!=null) + { + NewTask.TaskCode = unitworkTaskCode.FirstOrDefault(x => x.Key == NewTask.UnitWorkId).Value; + } + else + { + NewTask.TaskCode = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, DateTime.Now.Date.ToString("yyyy-MM-dd"), NewTask.UnitWorkId, this.CurrUser.UnitId); + unitworkTaskCode.Add(NewTask.UnitWorkId, NewTask.TaskCode); + } + + if (unitworkSerialNumber.FirstOrDefault(x => x.Key == NewTask.UnitWorkId).Value != null) + { + NewTask.SerialNumber = unitworkSerialNumber.FirstOrDefault(x => x.Key == NewTask.UnitWorkId).Value; + } + else + { + NewTask.SerialNumber = BLL.WeldTaskService.GetSerialNumberByDate(this.CurrUser.LoginProjectId, DateTime.Now.Date.ToString("yyyy-MM-dd"), NewTask.UnitWorkId, this.CurrUser.UnitId); + unitworkSerialNumber.Add(NewTask.UnitWorkId, NewTask.SerialNumber); + } - NewTask.TaskCode = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, DateTime.Now.Date.ToString("yyyy-MM-dd"), NewTask.UnitWorkId, this.CurrUser.UnitId); NewTask.WeldTaskId = SQLHelper.GetNewID(); NewTask.WeldJointId = weldjoint.WeldJointId; var oldWeldTask = BLL.WeldTaskService.GetWeldTaskByWeldJointId(NewTask.WeldJointId); @@ -645,6 +671,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage Model.HJGL_WeldJoint weldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(NewTask.WeldJointId); if (weldJoint != null) { + NewTask.PipeLineSortIndex = matchPipeline.FirstOrDefault(x => x.Value == weldJoint.PipelineId).Key; NewTask.WeldingRod = weldJoint.WeldingRod; NewTask.WeldingWire = weldJoint.WeldingWire; //获取可替代焊丝焊条 diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs index 521da344..021305ba 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs @@ -235,15 +235,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage where x.UnitWorkId == node.NodeID && x.TaskDate < Convert.ToDateTime(this.txtTaskDateMonth.Text.Trim() + "-01").AddMonths(1) && x.TaskDate >= Convert.ToDateTime(this.txtTaskDateMonth.Text.Trim() + "-01") - select new { x.TaskDate.Value.Date, x.UnitId }).Distinct().ToList().OrderByDescending(x => x.Date); + select new { x.TaskDate.Value.Date, x.UnitId,x.SerialNumber }).Distinct().ToList().OrderByDescending(x => x.Date); if (p.Count() > 0) { foreach (var item in p) { TreeNode newNode = new TreeNode(); newNode.CommandName = "Date"; - newNode.Text = string.Format("{0:yyyy-MM-dd}", item.Date) + "(" + BLL.UnitService.getUnitNamesUnitIds(item.UnitId) + ")"; - newNode.NodeID = node.NodeID + "|" + item.UnitId + "|" + string.Format("{0:yyyy-MM-dd}", item.Date); + newNode.Text = string.Format("{0:yyyy-MM-dd}", item.Date)+"-"+ item.SerialNumber + "(" + BLL.UnitService.getUnitNamesUnitIds(item.UnitId) + ")"; + newNode.NodeID = node.NodeID + "|" + item.UnitId + "|" + string.Format("{0:yyyy-MM-dd}", item.Date) + "|" + item.SerialNumber; newNode.EnableClickEvent = true; node.Nodes.Add(newNode); } @@ -255,15 +255,16 @@ namespace FineUIPro.Web.HJGL.WeldingManage join y in Funs.DB.HJGL_WeldJoint on x.WeldJointId equals y.WeldJointId where x.UnitWorkId == node.NodeID && y.WeldJointCode.Contains(this.txtWeldJointCode.Text.Trim()) orderby x.TaskDate descending - select new { x.TaskDate.Value.Date, x.UnitId }).Distinct().ToList().OrderByDescending(x => x.Date); + select new { x.TaskDate.Value.Date, x.UnitId, x.SerialNumber }).Distinct().ToList().OrderByDescending(x => x.Date); if (p.Count() > 0) { foreach (var item in p) { TreeNode newNode = new TreeNode(); newNode.CommandName = "Date"; - newNode.Text = string.Format("{0:yyyy-MM-dd}", item.Date) + "(" + BLL.UnitService.getUnitNamesUnitIds(item.UnitId) + ")"; - newNode.NodeID = node.NodeID + "|" + item.UnitId + "|" + string.Format("{0:yyyy-MM-dd}", item.Date); + // newNode.Text = string.Format("{0:yyyy-MM-dd}", item.Date) + "(" + BLL.UnitService.getUnitNamesUnitIds(item.UnitId) + ")"; + newNode.Text = string.Format("{0:yyyy-MM-dd}", item.Date) + "-" + item.SerialNumber + "(" + BLL.UnitService.getUnitNamesUnitIds(item.UnitId) + ")"; + newNode.NodeID = node.NodeID + "|" + item.UnitId + "|" + string.Format("{0:yyyy-MM-dd}", item.Date)+"|"+item.SerialNumber; newNode.EnableClickEvent = true; node.Nodes.Add(newNode); } @@ -618,19 +619,20 @@ namespace FineUIPro.Web.HJGL.WeldingManage //GetCanWelderDropDownList(GetWeldingTaskList); } - string unitWorkId = string.Empty, unitId2 = string.Empty; string taskdate = string.Empty; + string unitWorkId = string.Empty, unitId2 = string.Empty; string taskdate = string.Empty;string serialNumber=string.Empty; if (tvControlItem.SelectedNodeID.Contains("|")) { unitWorkId = tvControlItem.SelectedNodeID.Split('|')[0]; unitId2 = tvControlItem.SelectedNodeID.Split('|')[1]; taskdate = tvControlItem.SelectedNodeID.Split('|')[2]; + serialNumber= tvControlItem.SelectedNodeID.Split('|')[3]; } else { unitWorkId = tvControlItem.SelectedNodeID; } List GetWeldingTaskList = null; - GetWeldingTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, unitWorkId, unitId2, Convert.ToDateTime(taskdate), this.rbIsAudit.SelectedValue); + GetWeldingTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, unitWorkId, unitId2, Convert.ToDateTime(taskdate), this.rbIsAudit.SelectedValue, serialNumber); this.BindGrid(GetWeldingTaskList); Alert.ShowInTop("已生成可焊焊工!", MessageBoxIcon.Success); @@ -985,19 +987,20 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } } - string unitWorkId = string.Empty, unitId = string.Empty; - + string unitWorkId = string.Empty, unitId = string.Empty; string serialNumber = string.Empty; + if (tvControlItem.SelectedNodeID.Contains("|")) { unitWorkId = tvControlItem.SelectedNodeID.Split('|')[0]; unitId = tvControlItem.SelectedNodeID.Split('|')[1]; + serialNumber = tvControlItem.SelectedNodeID.Split('|')[3]; } else { unitWorkId = tvControlItem.SelectedNodeID; } List GetWeldingTaskList = null; - GetWeldingTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, unitWorkId, unitId, Convert.ToDateTime(hdTaskWeldJoint.Text.Trim()), this.rbIsAudit.SelectedValue); + GetWeldingTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, unitWorkId, unitId, Convert.ToDateTime(hdTaskWeldJoint.Text.Trim()), this.rbIsAudit.SelectedValue, serialNumber); this.BindGrid(GetWeldingTaskList); } @@ -1083,7 +1086,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage DateTime? taskTime = Funs.GetNewDateTime(tvControlItem.SelectedNodeID.Split('|')[2]); if (taskTime != null) { - List GetWeldingTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID.Split('|')[0], tvControlItem.SelectedNodeID.Split('|')[1], Convert.ToDateTime(taskTime), this.rbIsAudit.SelectedValue); + List GetWeldingTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID.Split('|')[0], tvControlItem.SelectedNodeID.Split('|')[1], Convert.ToDateTime(taskTime), this.rbIsAudit.SelectedValue, tvControlItem.SelectedNodeID.Split('|')[3]); this.BindGrid(GetWeldingTaskList); } @@ -1142,7 +1145,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage unitWorkId = tvControlItem.SelectedNodeID; } List GetWeldingTaskList = null; - GetWeldingTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, unitWorkId, unitId, Convert.ToDateTime(txtTaskDate.Text), this.rbIsAudit.SelectedValue); + GetWeldingTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, unitWorkId, unitId, Convert.ToDateTime(txtTaskDate.Text), this.rbIsAudit.SelectedValue, tvControlItem.SelectedNodeID.Split('|')[3]); this.BindGrid(GetWeldingTaskList); drpCanWelder.Items.Clear(); //GetCanWelderDropDownList(GetWeldingTaskList); @@ -1205,7 +1208,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage DateTime? taskTime = Funs.GetNewDateTime(tvControlItem.SelectedNodeID.Split('|')[2]); if (taskTime != null) { - List GetWeldingTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID.Split('|')[0], tvControlItem.SelectedNodeID.Split('|')[1], Convert.ToDateTime(taskTime), this.rbIsAudit.SelectedValue); + List GetWeldingTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID.Split('|')[0], tvControlItem.SelectedNodeID.Split('|')[1], Convert.ToDateTime(taskTime), this.rbIsAudit.SelectedValue, tvControlItem.SelectedNodeID.Split('|')[3]); this.BindGrid(GetWeldingTaskList); } } @@ -1215,7 +1218,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage DateTime? taskTime = Funs.GetNewDateTime(tvControlItem.SelectedNodeID.Split('|')[2]); if (taskTime != null) { - var pipelines = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID.Split('|')[0], tvControlItem.SelectedNodeID.Split('|')[1], Convert.ToDateTime(taskTime), this.rbIsAudit.SelectedValue).Select(x => x.PipelineId).Distinct().ToList(); + var pipelines = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID.Split('|')[0], tvControlItem.SelectedNodeID.Split('|')[1], Convert.ToDateTime(taskTime), this.rbIsAudit.SelectedValue, tvControlItem.SelectedNodeID.Split('|')[3]).Select(x => x.PipelineId).Distinct().ToList(); if (pipelines.Any()) { @@ -1265,7 +1268,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage DateTime? taskTime = Funs.GetNewDateTime(tvControlItem.SelectedNodeID.Split('|')[2]); if (taskTime != null) { - List GetWeldingTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID.Split('|')[0], tvControlItem.SelectedNodeID.Split('|')[1], Convert.ToDateTime(taskTime), this.rbIsAudit.SelectedValue); + List GetWeldingTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID.Split('|')[0], tvControlItem.SelectedNodeID.Split('|')[1], Convert.ToDateTime(taskTime), this.rbIsAudit.SelectedValue, tvControlItem.SelectedNodeID.Split('|')[3]); this.BindGrid(GetWeldingTaskList); } } @@ -1275,12 +1278,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID)) { string unitWorkId = string.Empty, unitId2 = string.Empty; string taskdate = string.Empty; + string serialNumber = string.Empty; if (tvControlItem.SelectedNodeID.Contains("|")) { unitWorkId = tvControlItem.SelectedNodeID.Split('|')[0]; unitId2 = tvControlItem.SelectedNodeID.Split('|')[1]; taskdate = tvControlItem.SelectedNodeID.Split('|')[2]; - TwInOutplanmasterService.GenOutPlanmasterByWeldTaskId(unitWorkId, unitId2, Convert.ToDateTime(taskdate), this.CurrUser.PersonId); + serialNumber = tvControlItem.SelectedNodeID.Split('|')[3]; + TwInOutplanmasterService.GenOutPlanmasterByWeldTaskId(unitWorkId, unitId2, Convert.ToDateTime(taskdate), serialNumber, this.CurrUser.PersonId); ShowNotify("生成出库申请单成功", MessageBoxIcon.Success); } else @@ -1343,7 +1348,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage DateTime? taskTime = Funs.GetNewDateTime(tvControlItem.SelectedNodeID.Split('|')[2]); if (taskTime != null) { - var weldTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID.Split('|')[0], tvControlItem.SelectedNodeID.Split('|')[1], Convert.ToDateTime(taskTime), this.rbIsAudit.SelectedValue); + var weldTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID.Split('|')[0], tvControlItem.SelectedNodeID.Split('|')[1], Convert.ToDateTime(taskTime), this.rbIsAudit.SelectedValue, tvControlItem.SelectedNodeID.Split('|')[3]); var pipelines = weldTaskList.Select(x => x.PipelineId).Distinct().ToList(); if (pipelines.Any()) diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 620285d9..b0f0189b 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -100360,6 +100360,10 @@ namespace Model private System.Nullable _AuditDate2; + private string _SerialNumber; + + private System.Nullable _PipeLineSortIndex; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -100414,6 +100418,10 @@ namespace Model partial void OnAuditMan2Changed(); partial void OnAuditDate2Changing(System.Nullable value); partial void OnAuditDate2Changed(); + partial void OnSerialNumberChanging(string value); + partial void OnSerialNumberChanged(); + partial void OnPipeLineSortIndexChanging(System.Nullable value); + partial void OnPipeLineSortIndexChanged(); #endregion public HJGL_WeldTask() @@ -100921,6 +100929,46 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SerialNumber", DbType="NVarChar(50)")] + public string SerialNumber + { + get + { + return this._SerialNumber; + } + set + { + if ((this._SerialNumber != value)) + { + this.OnSerialNumberChanging(value); + this.SendPropertyChanging(); + this._SerialNumber = value; + this.SendPropertyChanged("SerialNumber"); + this.OnSerialNumberChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipeLineSortIndex", DbType="Int")] + public System.Nullable PipeLineSortIndex + { + get + { + return this._PipeLineSortIndex; + } + set + { + if ((this._PipeLineSortIndex != value)) + { + this.OnPipeLineSortIndexChanging(value); + this.SendPropertyChanging(); + this._PipeLineSortIndex = value; + this.SendPropertyChanged("PipeLineSortIndex"); + this.OnPipeLineSortIndexChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -281421,6 +281469,10 @@ namespace Model private System.Nullable _TableDate; + private string _SerialNumber; + + private System.Nullable _PipeLineSortIndex; + private string _WeldJointCode; private System.Nullable _Dia; @@ -281695,6 +281747,38 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SerialNumber", DbType="NVarChar(50)")] + public string SerialNumber + { + get + { + return this._SerialNumber; + } + set + { + if ((this._SerialNumber != value)) + { + this._SerialNumber = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipeLineSortIndex", DbType="Int")] + public System.Nullable PipeLineSortIndex + { + get + { + return this._PipeLineSortIndex; + } + set + { + if ((this._PipeLineSortIndex != value)) + { + this._PipeLineSortIndex = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldJointCode", DbType="NVarChar(50)")] public string WeldJointCode {