diff --git a/.vs/SGGL_SeDin_New/v17/.wsuo b/.vs/SGGL_SeDin_New/v17/.wsuo index 925b2b9b..181fa974 100644 Binary files a/.vs/SGGL_SeDin_New/v17/.wsuo and b/.vs/SGGL_SeDin_New/v17/.wsuo differ diff --git a/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs index 21b9cb28..5949c5f7 100644 --- a/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs +++ b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs @@ -16,6 +16,7 @@ namespace BLL { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { + ///所需材料数量列表 var NeedOutMateriaList = from x in db.HJGL_PipeLineMat join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode join z in db.HJGL_Pipeline on x.PipelineId equals z.PipelineId @@ -27,7 +28,7 @@ namespace BLL g.Key, NeedNum = g.Sum(x => x.Number) ?? 0, }; - + ///实际材料入库数量列表 var RealInMateriaList = from x in db.Tw_InputDetail join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode group x by x.MaterialCode @@ -44,9 +45,12 @@ namespace BLL from y in gg.DefaultIfEmpty() join z in db.HJGL_MaterialCodeLib on x.Key equals z.MaterialCode into zz from z in zz.DefaultIfEmpty() + join m in db.Tw_MaterialStock on x.Key equals m.PipeLineMatCode into mm + from m in mm.DefaultIfEmpty() select new Tw_ArrivalStatisticsOutPut { MaterialCode = x.Key, + StockNum = m==null?0: (decimal)m.StockNum, NeedNum = x.NeedNum, RealNum = y==null?0:y.RealNum, MaterialName = z.MaterialName, @@ -75,12 +79,15 @@ namespace BLL var requiredMaterials = (from x in db.HJGL_PipeLineMat join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode join z in db.HJGL_Pipeline on x.PipelineId equals z.PipelineId + join m in db.WBS_UnitWork on z.UnitWorkId equals m.UnitWorkId where z.ProjectId == projectid && pipelineIds.Contains(z.PipelineId) select new Tw_PipeMatMatchOutput { Id= Guid.NewGuid().ToString(), PipelineId =x.PipelineId, PipelineCode=z.PipelineCode, + UnitWorkId=z.UnitWorkId, + UnitWorkName=m.UnitWorkName, PrefabricatedComponents=x.PrefabricatedComponents, MaterialCode = x.MaterialCode, MaterialName= y.MaterialName, diff --git a/SGGL/BLL/CLGL/TwInOutplandetailRelationService.cs b/SGGL/BLL/CLGL/TwInOutplandetailRelationService.cs index f49782b3..0be38443 100644 --- a/SGGL/BLL/CLGL/TwInOutplandetailRelationService.cs +++ b/SGGL/BLL/CLGL/TwInOutplandetailRelationService.cs @@ -80,7 +80,14 @@ namespace BLL return Funs.DB.Tw_InOutPlanDetail_Relation.FirstOrDefault(x => x.Id == Id); } - + public static Model.Tw_InOutPlanDetail_Relation GetByPipelineId(string pipelineId,string WarehouseCode) + { + var q= from x in Funs.DB.Tw_InOutPlanDetail_Relation + join y in Funs.DB .Tw_InOutPlanMaster on x.InOutPlanMasterId equals y.Id + where x.PipelineId == pipelineId && y.WarehouseCode == WarehouseCode + select x; + return q.FirstOrDefault(); + } public static void Add(Model.Tw_InOutPlanDetail_Relation newtable) { diff --git a/SGGL/BLL/CLGL/TwInputmasterService.cs b/SGGL/BLL/CLGL/TwInputmasterService.cs index f8296046..a4df4628 100644 --- a/SGGL/BLL/CLGL/TwInputmasterService.cs +++ b/SGGL/BLL/CLGL/TwInputmasterService.cs @@ -254,7 +254,7 @@ namespace BLL ReqUnitId = plan.ReqUnitId, AuditMan = plan.CreateMan, AuditDate = plan.AuditDate, - Remark=plan.Remark + Remark= remark }; if ((TwConst.TypeInt)plan.TypeInt!= TwConst.TypeInt.采购入库) { diff --git a/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs b/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs index 54061f84..ccdbee57 100644 --- a/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs @@ -25,6 +25,7 @@ namespace BLL /// 已装箱 /// public static int state_2 = 2; + /// /// 获取状态名称 diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx index d1a6575c..8f9f240a 100644 --- a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx @@ -37,7 +37,7 @@ - + @@ -77,6 +77,9 @@ + + diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs index 9c58a5c7..54b4b056 100644 --- a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs @@ -30,7 +30,7 @@ namespace FineUIPro.Web.CLGL { var tb = BLL.TwArrivalStatisticsService.GetStatistics(this.CurrUser.LoginProjectId, txtMaterialCode.Text.Trim()); - lbRate.Text="匹配率:"+ Math.Round( tb.Sum(x=>x.MatchRate)*100/tb.Count() ,4) + "%"; + lbRate.Text="总体匹配率:"+ Math.Round( tb.Sum(x=>x.MatchRate)*100/tb.Count() ,4) + "%"; //tb = GetFilteredTable(Grid1.FilteredData, tb); Grid1.DataSource = tb; Grid1.DataBind(); diff --git a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx index 1b06b217..32fb161f 100644 --- a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx +++ b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx @@ -42,7 +42,7 @@ - + diff --git a/SGGL/FineUIPro.Web/File/Fastreport/焊口打印.frx b/SGGL/FineUIPro.Web/File/Fastreport/焊口打印.frx index 736ac671..272a4e17 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 } - + @@ -137,26 +137,26 @@ namespace FastReport - - - - - - - + + + + + + + - + - + - + - + diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx index 105946ce..b84d5f5e 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx @@ -21,6 +21,18 @@ .tn-color-green .f-tree-folder { color: green; } + + .f-grid-row.yellow { + background-color: darkgoldenrod; + } + + .f-grid-row.red { + background-color: red; + } + + .f-grid-row.green { + background-color: green; + } @@ -47,10 +59,10 @@ - + + EnablePostBack="true" OnClick="btnrefresh_Click" runat="server" Hidden="true"> @@ -65,7 +77,7 @@ @@ -73,9 +85,8 @@ - - + @@ -83,7 +94,7 @@ - @@ -96,7 +107,7 @@ + TitleToolTip="三维模型显示" AutoScroll="true" IFrameUrl="../../CLGL/ArrivalStatistics.aspx" EnableIFrame="true"> - + + + - + + SortField="PipelineId" SortDirection="ASC" EnableCheckBoxSelect="true" > + + @@ -131,7 +148,7 @@ Title="底部面板" ShowBorder="false" Height="320px" ShowHeader="false" BodyPadding="1px" Layout="Fit"> - diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs index 6aaec7a4..1b51bc4d 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs @@ -1,5 +1,6 @@ using BLL; using Model; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Data; @@ -14,6 +15,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage //public Dictionary dicSeclectPipeLine = new Dictionary(); public static List tw_PipeMatMatchOutputs ; public static decimal Rate = 0; + public static string WarehouseCode = "工厂预制"; public string PipeArea { get @@ -54,6 +56,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage { tw_PipeMatMatchOutputs=new List(); PipeArea = Request.Params["PipeArea"]; + if (PipeArea == "2") + { + WarehouseCode = "现场安装"; + } HJGL_MaterialService.materialStockItems_FIELD = new List(); HJGL_MaterialService.materialStockItems_SHOP = new List(); dicSeclectPipeLine=new Dictionary(); @@ -168,18 +174,30 @@ namespace FineUIPro.Web.HJGL.WeldingManage } private void BindNodes(TreeNode node) { - var NowComPipelineCode = PipelineService.GetNoComPipelinesByUnitWordId(node.NodeID); - if (!node.Text.Contains("|")) - { - node.Text += "|" + NowComPipelineCode.Count(); + //var NowComPipelineCode = PipelineService.GetNoComPipelinesByUnitWordId(node.NodeID); + //if (!node.Text.Contains("|")) + //{ + // node.Text += "|" + NowComPipelineCode.Count(); + + //} + var CompleteInOutPlanDetail_RelationList = from x in Funs.DB.Tw_InOutPlanDetail_Relation + join y in Funs.DB.Tw_InOutPlanMaster on x.InOutPlanMasterId equals y.Id + where y.State==(int)TwConst.State.已完成 && y.WarehouseCode == WarehouseCode + select x; - } var pipeline = (from x in Funs.DB.HJGL_Pipeline - where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID + join y in CompleteInOutPlanDetail_RelationList on x.PipelineId equals y.PipelineId into temp + from y in temp.DefaultIfEmpty() + where y == null && x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) orderby x.PipelineCode select x).ToList(); - pipeline= pipeline.Where(x => NowComPipelineCode.Contains(x.PipelineCode)).ToList(); + //pipeline= pipeline.Where(x => NowComPipelineCode.Contains(x.PipelineCode)).ToList(); + if (!node.Text.Contains("|")) + { + node.Text += "|" + pipeline.Count(); + + } int pageindex = int.Parse(node.CommandName.Split('|')[0]); int pageCount = int.Parse(node.CommandName.Split('|')[1]); if (pageindex <= pageCount) @@ -274,11 +292,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage void BindGrid2() { var result = tw_PipeMatMatchOutputs - .GroupBy(item => new { item.PipelineId, item.PipelineCode }) // 按 PipelineId 和 PipelineCode 分组 + .GroupBy(item => new { item.PipelineId, item.PipelineCode,item.UnitWorkName }) // 按 PipelineId 和 PipelineCode 分组 .Select(group => new { PipelineId = group.Key.PipelineId, // 当前组的 PipelineId PipelineCode = group.Key.PipelineCode, // 当前组的 PipelineCode + UnitWorkName = group.Key.UnitWorkName, // 当前组的 UnitWorkName AverageMatchRate = group.Average(item => item.MatchRate) // 计算平均 MatchRate }) .ToList(); // 转换为 List @@ -287,14 +306,34 @@ namespace FineUIPro.Web.HJGL.WeldingManage List output = result.Select(r => new Tw_PipeMatMatchOutput { PipelineId = r.PipelineId, - PipelineCode = r.PipelineCode, + PipelineCode = r.PipelineCode, + UnitWorkName = r.UnitWorkName, MatchRate = r.AverageMatchRate, MatchRateString = Math.Round((decimal)r.AverageMatchRate * 100, 2).ToString() + "%" }).ToList(); Grid2.DataSource = output; Grid2.DataBind(); - Rate = Math.Round((decimal)output.Average(item => item.MatchRate) * 100, 2); - lbRate.Text = "匹配率:" + Rate.ToString() + "%"; + if (output.Any()) + { + Rate = Math.Round((decimal)output.Average(item => item.MatchRate) * 100, 2); + lbRate.Text = "匹配率:" + Rate.ToString() + "%"; + } + for (int i = 0; i < Grid2.Rows.Count; i++) + { + var model = Grid2.Rows[i].DataItem as Tw_PipeMatMatchOutput; + + + + if (model.MatchRate >=1) + { + Grid2.Rows[i].RowCssClass = "green"; + } + else + { + Grid2.Rows[i].RowCssClass = "red"; + } + + } } void BindGrid3() @@ -302,6 +341,19 @@ namespace FineUIPro.Web.HJGL.WeldingManage Grid3.DataSource = dicSeclectPipeLine; Grid3.DataBind(); + for (int i = 0; i < Grid3.Rows.Count; i++) + { + var model = Grid3.Rows[i].DataItem ; + var model2= JsonConvert.DeserializeObject>(JsonConvert.SerializeObject(model)); + string pipeid= model2.First().Value; + + var relationModle=TwInoutplandetailRelationService.GetByPipelineId(pipeid,WarehouseCode); + if (relationModle!= null) + { + Grid3.Rows[i].RowCssClass = "yellow"; + } + + } } #endregion @@ -371,10 +423,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage #endregion #region 按钮事件 - protected void btnNew_Click(object sender, EventArgs e) - { - - } protected void btnrefresh_Click(object sender, EventArgs e) { @@ -459,7 +507,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (dicSeclectPipeLine.Where(x => x.Key == this.tvControlItem.SelectedNodeID).Count() == 0) { dicSeclectPipeLine.Add(this.tvControlItem.SelectedNodeID, this.tvControlItem.SelectedNode.Text); - tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), "工厂预制"); + tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), WarehouseCode); BindGrid3(); BindGrid2(); @@ -472,31 +520,35 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (Grid3.SelectedRowID != "") { dicSeclectPipeLine.Remove(Grid3.SelectedRowID); - tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), "工厂预制"); + tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), WarehouseCode); BindGrid3(); BindGrid2(); } } protected void btnGenTask_Click(object sender, EventArgs e) - { - if (Rate<(decimal)85) + { if (Grid2.SelectedRowIDArray.Count() > 0) { - ShowNotify(" 匹配率小于85%,请重新匹配!", MessageBoxIcon.Warning); - return; + SaveTask(); + Response.Redirect(Request.Url.ToString()); + ShowNotify("生成任务单成功!", MessageBoxIcon.Warning); + } - SaveTask(); - Response.Redirect(Request.Url.ToString()); + else + { + ShowNotify("请先选择需要发起任单的管线!", MessageBoxIcon.Warning); + } + } private void SaveTask() { var weldingRods = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "2" select x; var weldingWires = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "1" select x; var toDoMatterList = (from x in Funs.DB.View_HJGL_NoWeldJointFind - where dicSeclectPipeLine.Keys.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null + where Grid2.SelectedRowIDArray.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null select x).ToList(); var selectRowId = (from x in Funs.DB.View_HJGL_NoWeldJointFind - where dicSeclectPipeLine.Keys.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null + where Grid2.SelectedRowIDArray.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null select x).ToList(); foreach (var weldjoint in selectRowId) { diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs index bf2cad69..1fd97a43 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs @@ -158,15 +158,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// protected global::FineUIPro.Button btnDeletePipelineMatchMat; - /// - /// btnGenTask 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnGenTask; - /// /// Grid3 控件。 /// @@ -221,6 +212,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// protected global::FineUIPro.Label lbRate; + /// + /// btnGenTask 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnGenTask; + /// /// Grid2 控件。 /// diff --git a/SGGL/Model/CLGL/Tw_ArrivalStatisticsOutPut.cs b/SGGL/Model/CLGL/Tw_ArrivalStatisticsOutPut.cs index ba7dd3c1..697f8620 100644 --- a/SGGL/Model/CLGL/Tw_ArrivalStatisticsOutPut.cs +++ b/SGGL/Model/CLGL/Tw_ArrivalStatisticsOutPut.cs @@ -13,6 +13,7 @@ namespace Model public string MaterialSpec { get; set; } public string MaterialUnit { get; set; } public string MaterialDef { get; set; } + public decimal StockNum { get; set; } public decimal NeedNum { get; set; } public decimal RealNum { get; set; } public decimal MatchRate { get; set; } diff --git a/SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs b/SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs index e75ec67a..227d2066 100644 --- a/SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs +++ b/SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs @@ -11,6 +11,8 @@ namespace Model public string Id { get; set; } public string PipelineId { get; set; } public string PipelineCode { get; set; } + public string UnitWorkId { get; set; } + public string UnitWorkName { get; set; } public string PrefabricatedComponents { get; set; } public string MaterialCode { get; set; } public string MaterialName { get; set; }