diff --git a/.vs/SGGL_SeDin_New/v17/.wsuo b/.vs/SGGL_SeDin_New/v17/.wsuo index 0fdfbad7..ccfe80e6 100644 Binary files a/.vs/SGGL_SeDin_New/v17/.wsuo and b/.vs/SGGL_SeDin_New/v17/.wsuo differ diff --git a/DataBase/版本日志/SGGLDB_V2024-12-06.sql b/DataBase/版本日志/SGGLDB_V2024-12-06.sql new file mode 100644 index 00000000..9eaf219b --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2024-12-06.sql @@ -0,0 +1,12 @@ + + +alter table HJGL_WeldTask + add CreateMan varchar(50), + AuditMan varchar(50), + AuditDate datetime, + AuditMan2 varchar(50), + AuditDate2 datetime; +go +alter table Tw_OutputMaster + add AuditMan2 varchar(50), + AuditDate2 datetime \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs index aa357836..4c719325 100644 --- a/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs +++ b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs @@ -1,4 +1,5 @@  +using Microsoft.SqlServer.Dts.Runtime; using Model; using System; using System.Collections; @@ -76,69 +77,54 @@ namespace BLL } } - - - public static List GetPipeMatMatch(string projectid, List pipelineIds,string WarehouseCode) - { - using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + /// + /// 根据所需材料列表和库存列表获取匹配结果 + /// + /// + /// + /// + /// + public static List GetMatMatchOutput(List requiredMaterials ,string warehouseCode ,string projectId) + { + Tw_MaterialStockOutput twMaterialStockOutput = new Tw_MaterialStockOutput { - var results = new List(); - - // 获取所需材料列表 - 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) && x.PrefabricatedComponents!= "" //x.PrefabricatedComponents!="" 用于筛选非散件材料 - 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, - MaterialSpec= y.MaterialSpec, - MaterialUnit= y.MaterialUnit, - MaterialDef= y.MaterialDef, - NeedNum=x.Number, - } - ).ToList(); - Tw_MaterialStockOutput tw_MaterialStockOutput=new Tw_MaterialStockOutput(); - tw_MaterialStockOutput .WarehouseCode=WarehouseCode; - var stockList= TwMaterialstockService.GetTw_MaterialStockByModle(tw_MaterialStockOutput).ToList();//获取库存列表 - - // 模拟库存管理 - foreach (var material in requiredMaterials) + WarehouseCode = warehouseCode, + ProjectId = projectId + }; + var stockList = TwMaterialstockService.GetTw_MaterialStockByModle(twMaterialStockOutput).ToList();//获取库存列表 + foreach (var material in requiredMaterials) + { + material.Id = Guid.NewGuid().ToString(); + var thisMaterialStockNum = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode)?.StockNum ?? 0; + if (thisMaterialStockNum >= material.NeedNum) { - var thisMaterialStockNum = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode)?.StockNum??0; - if (thisMaterialStockNum >= material.NeedNum) - { - material.MatchNum=material.NeedNum; - material.MatchRate=1; - material.MatchRateString="100%"; - } - else - { - material.MatchNum = thisMaterialStockNum<0?0:thisMaterialStockNum; - material.MatchRate = (material.NeedNum == 0 ? 0 : material.MatchNum??0 / material.NeedNum); - material.MatchRateString = Math.Round((decimal)material.MatchRate * 100, 2).ToString() + "%"; - - } - //修改stockList对应的库存数量 - var stock = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode); - if (stock != null) - { - stock.StockNum -= material.MatchNum; - } + material.MatchNum = material.NeedNum; + material.MatchRate = 1; + material.MatchRateString = "100%"; } - results = requiredMaterials; - return results; - } - } + else + { + material.MatchNum = thisMaterialStockNum < 0 ? 0 : thisMaterialStockNum; + material.MatchRate = (material.NeedNum == 0 ? 0 : ((material.MatchNum ?? 0) / material.NeedNum)); + material.MatchRateString = Math.Round((decimal)(material.MatchRate ?? 0) * 100, 2).ToString() + "%"; + } + //修改stockList对应的库存数量 + var stock = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode); + if (stock != null) + { + stock.StockNum -= material.MatchNum; + } + } + + var results = requiredMaterials; + return results; + } + /// + /// 获取管线匹配率 + /// + /// + /// public static decimal? GetPipeMatch(string pipelineId) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) @@ -169,41 +155,18 @@ namespace BLL MaterialDef = y.MaterialDef, NeedNum = x.Number, } - ).ToList(); - Tw_MaterialStockOutput tw_MaterialStockOutput = new Tw_MaterialStockOutput(); - tw_MaterialStockOutput.WarehouseCode = warehouseCode; - var stockList = TwMaterialstockService.GetTw_MaterialStockByModle(tw_MaterialStockOutput).ToList();//获取库存列表 - - // 模拟库存管理 - foreach (var material in requiredMaterials) - { - var thisMaterialStockNum = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode)?.StockNum ?? 0; - if (thisMaterialStockNum >= material.NeedNum) - { - material.MatchNum = material.NeedNum; - material.MatchRate = 1; - material.MatchRateString = "100%"; - } - else - { - material.MatchNum = thisMaterialStockNum < 0 ? 0 : thisMaterialStockNum; - material.MatchRate = (material.NeedNum == 0 ? 0 : material.MatchNum ?? 0 / material.NeedNum); - material.MatchRateString = Math.Round((decimal)material.MatchRate * 100, 2).ToString() + "%"; - - } - //修改stockList对应的库存数量 - var stock = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode); - if (stock != null) - { - stock.StockNum -= material.MatchNum; - } - } - twPipeMatMatchOutputs = requiredMaterials; + ).ToList(); + + twPipeMatMatchOutputs = GetMatMatchOutput(requiredMaterials, warehouseCode, pipelineModel.ProjectId); var result = twPipeMatMatchOutputs.Count==0?0: twPipeMatMatchOutputs.Sum(x=>x.MatchRate)/ twPipeMatMatchOutputs.Count; return result; } } - + /// + /// 根据出库单主键获取材料匹配信息 + /// + /// + /// public static List GetMatMatchByOutPlanMasterId(string outPlanMasterId) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) @@ -227,44 +190,83 @@ namespace BLL MaterialSpec = y.MaterialSpec, MaterialUnit = y.MaterialUnit, MaterialDef = y.MaterialDef, - NeedNum = x.Number, + NeedNum = x.Number, } ).ToList(); - var masterModle = db.Tw_InOutPlanMaster.FirstOrDefault(x => x.Id == outPlanMasterId); - Tw_MaterialStockOutput tw_MaterialStockOutput = new Tw_MaterialStockOutput(); - tw_MaterialStockOutput.WarehouseCode = masterModle.WarehouseCode; - var stockList = TwMaterialstockService.GetTw_MaterialStockByModle(tw_MaterialStockOutput).ToList();//获取库存列表 - - // 模拟库存管理 - foreach (var material in requiredMaterials) - { - var thisMaterialStockNum = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode)?.StockNum ?? 0; - if (thisMaterialStockNum >= material.NeedNum) - { - material.MatchNum = material.NeedNum; - material.MatchRate = 1; - material.MatchRateString = "100%"; - } - else - { - material.MatchNum = thisMaterialStockNum < 0 ? 0 : thisMaterialStockNum; - material.MatchRate = (material.NeedNum == 0 ? 0 : material.MatchNum ?? 0 / material.NeedNum); - material.MatchRateString = Math.Round((decimal)material.MatchRate * 100, 2).ToString() + "%"; - - } - //修改stockList对应的库存数量 - var stock = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode); - if (stock != null) - { - stock.StockNum -= material.MatchNum; - } - } - results = requiredMaterials; + var masterModle = db.Tw_InOutPlanMaster.FirstOrDefault(x => x.Id == outPlanMasterId); + results = GetMatMatchOutput(requiredMaterials.OrderBy(x=>x.PipelineId).ThenBy(x=>x.MaterialCode).ToList(), masterModle.WarehouseCode, masterModle.ProjectId); return results; } } + /// + /// 根据管线id获取材料匹配信息 + /// + /// + /// + /// + /// + public static List GetPipeMatMatch(string projectId, List pipelineIds, string warehouseCode) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var results = new List(); + + // 获取所需材料列表 + 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) && x.PrefabricatedComponents != "" //x.PrefabricatedComponents!="" 用于筛选非散件材料 + 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, + MaterialSpec = y.MaterialSpec, + MaterialUnit = y.MaterialUnit, + MaterialDef = y.MaterialDef, + NeedNum = x.Number, + } + ).ToList(); + var newRequiredMaterials = new List(); + foreach (string id in pipelineIds) + { + newRequiredMaterials.AddRange(requiredMaterials.Where(x => x.PipelineId == id)); + } + results = GetMatMatchOutput(newRequiredMaterials, warehouseCode, projectId); + return results; + } + } + /// + /// 根据管线材料匹配结果,获取管线匹配率 + /// + /// + /// + public static List GetPipeMatch(List twPipeMatMatch) + { + var result = twPipeMatMatch + .GroupBy(item => new { item.PipelineId, item.PipelineCode, item.UnitWorkName }) // 按 PipelineId 和 PipelineCode 分组 + .Select(group => new Tw_PipeMatchOutput + { + PipelineId = group.Key.PipelineId, // 当前组的 PipelineId + PipelineCode = group.Key.PipelineCode, // 当前组的 PipelineCode + UnitWorkName = group.Key.UnitWorkName, // 当前组的 UnitWorkName + SumNeedNum = group.Sum(item => item.NeedNum), + SumMatchNum = group.Sum(item => item.MatchNum), + MatchRate = group.Sum(item => item.MatchNum) > 0 && group.Sum(item => item.NeedNum) > 0 ? (decimal)group.Sum(item => item.MatchNum) / (decimal)group.Sum(item => item.NeedNum) : 0, + MatchRateString = Math.Round((decimal)group.Sum(item => item.MatchNum) / (decimal)group.Sum(item => item.NeedNum) * 100, 2).ToString() + "%" + }) + .ToList(); // 转换为 List + return result; + } + } } diff --git a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs index 0216bf0f..3cd7dc75 100644 --- a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs +++ b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs @@ -82,6 +82,7 @@ namespace BLL AuditManName = auditperson.PersonName, AuditDate = x.AuditDate, Remark = x.Remark, + AuditMan2 = x.AuditMan2, AuditManName2 = auditperson2.PersonName, AuditDate2 = x.AuditDate2, WarehouseMan = x.WarehouseMan, @@ -139,6 +140,7 @@ namespace BLL AuditManName = x.AuditManName, AuditDate = x.AuditDate, Remark = x.Remark, + AuditMan2=x.AuditMan2, AuditManName2 = x.AuditManName2, AuditDate2 = x.AuditDate2, WarehouseMan = x.WarehouseMan, @@ -187,9 +189,10 @@ namespace BLL AuditManName = x.AuditManName, AuditDate = x.AuditDate, Remark = x.Remark, + AuditMan2 = x.AuditMan2, AuditManName2 = x.AuditManName2, AuditDate2 = x.AuditDate2, - WarehouseMan = x.WarehouseMan, + WarehouseMan = x.WarehouseMan, WarehouseDate = x.WarehouseDate, WarehouseManName= x.WarehouseManName }; diff --git a/SGGL/BLL/CLGL/TwMaterialstockService.cs b/SGGL/BLL/CLGL/TwMaterialstockService.cs index 465a89be..72e15ab3 100644 --- a/SGGL/BLL/CLGL/TwMaterialstockService.cs +++ b/SGGL/BLL/CLGL/TwMaterialstockService.cs @@ -23,32 +23,35 @@ namespace BLL get; set; } - public static IQueryable GetTw_MaterialStockByModle(Model.Tw_MaterialStockOutput table) + public static List GetTw_MaterialStockByModle(Model.Tw_MaterialStockOutput table) { - var q = from x in Funs.DB.Tw_MaterialStock - join mat in Funs.DB.HJGL_MaterialCodeLib on x.PipeLineMatCode equals mat.MaterialCode into mm - from mat in mm.DefaultIfEmpty() - where - (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && - (string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) && - (string.IsNullOrEmpty(table.PipeLineMatCode) || x.PipeLineMatCode.Contains(table.PipeLineMatCode)) && - (string.IsNullOrEmpty(table.MaterialUnit) || mat.MaterialUnit.Contains(table.MaterialUnit)) && - (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) - select new Model.Tw_MaterialStockOutput - { - Id = x.Id, - WarehouseCode = x.WarehouseCode, - PipeLineMatCode = x.PipeLineMatCode, - StockNum = x.StockNum, - ProjectId = x.ProjectId, - MaterialName = mat.MaterialName, - MaterialSpec = mat.MaterialSpec, - MaterialUnit = mat.MaterialUnit, - MaterialDef = mat.MaterialDef - } - ; + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var q = from x in db.Tw_MaterialStock + join mat in db.HJGL_MaterialCodeLib on x.PipeLineMatCode equals mat.MaterialCode into mm + from mat in mm.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) && + (string.IsNullOrEmpty(table.PipeLineMatCode) || x.PipeLineMatCode.Contains(table.PipeLineMatCode)) && + (string.IsNullOrEmpty(table.MaterialUnit) || mat.MaterialUnit.Contains(table.MaterialUnit)) && + (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) + select new Model.Tw_MaterialStockOutput + { + Id = x.Id, + WarehouseCode = x.WarehouseCode, + PipeLineMatCode = x.PipeLineMatCode, + StockNum = x.StockNum, + ProjectId = x.ProjectId, + MaterialName = mat.MaterialName, + MaterialSpec = mat.MaterialSpec, + MaterialUnit = mat.MaterialUnit, + MaterialDef = mat.MaterialDef + } + ; - return q; + return q.ToList(); + } } /// @@ -65,7 +68,7 @@ namespace BLL { return null; } - q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize); + q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList(); // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); return from x in q select x; diff --git a/SGGL/BLL/CLGL/TwOutputmasterService.cs b/SGGL/BLL/CLGL/TwOutputmasterService.cs index f93580b7..8650d177 100644 --- a/SGGL/BLL/CLGL/TwOutputmasterService.cs +++ b/SGGL/BLL/CLGL/TwOutputmasterService.cs @@ -34,6 +34,8 @@ namespace BLL from person in persons.DefaultIfEmpty() join auditperson in Funs.DB.Person_Persons on x.AuditMan equals auditperson.PersonId into auditpersons from auditperson in auditpersons.DefaultIfEmpty() + join auditperson2 in Funs.DB.Person_Persons on x.AuditMan2 equals auditperson2.PersonId into auditpersons2 + from auditperson2 in auditpersons2.DefaultIfEmpty() join warehouseperson in Funs.DB.Person_Persons on x.WarehouseMan equals warehouseperson.PersonId into warehousepersons from warehouseperson in warehousepersons.DefaultIfEmpty() join unit in Funs.DB.Base_Unit on x.ReqUnitId equals unit.UnitId into units @@ -70,6 +72,9 @@ namespace BLL AuditMan = x.AuditMan, AuditManName = auditperson.PersonName, AuditDate = x.AuditDate, + AuditMan2 = x.AuditMan2, + AuditManName2 = auditperson2.PersonName, + AuditDate2 = x.AuditDate2, WarehouseMan = x.WarehouseMan, WarehouseDate = x.WarehouseDate, WarehouseManName = warehouseperson.PersonName @@ -118,6 +123,9 @@ namespace BLL AuditMan = x.AuditMan, AuditManName = x.AuditManName, AuditDate = x.AuditDate, + AuditMan2 = x.AuditMan2, + AuditManName2 = x.AuditManName2, + AuditDate2 = x.AuditDate2, WarehouseMan = x.WarehouseMan, WarehouseManName = x.WarehouseManName, WarehouseDate = x.WarehouseDate @@ -159,6 +167,9 @@ namespace BLL AuditMan = x.AuditMan, AuditManName = x.AuditManName, AuditDate = x.AuditDate, + AuditMan2 = x.AuditMan2, + AuditManName2 = x.AuditManName2, + AuditDate2 = x.AuditDate2, WarehouseMan = x.WarehouseMan, WarehouseManName = x.WarehouseManName, WarehouseDate = x.WarehouseDate @@ -192,6 +203,8 @@ namespace BLL ReqUnitId = newtable.ReqUnitId, AuditMan = newtable.AuditMan, AuditDate = newtable.AuditDate, + AuditMan2 = newtable.AuditMan2, + AuditDate2 = newtable.AuditDate2, WarehouseMan = newtable.WarehouseMan, WarehouseDate = newtable.WarehouseDate, }; @@ -219,6 +232,8 @@ namespace BLL table.ReqUnitId = newtable.ReqUnitId; table.AuditMan = newtable.AuditMan; table.AuditDate = newtable.AuditDate; + table.AuditMan2 = newtable.AuditMan2; + table.AuditDate2 = newtable.AuditDate2; table.WarehouseMan = newtable.WarehouseMan; table.WarehouseDate = newtable.WarehouseDate; Funs.DB.SubmitChanges(); @@ -276,6 +291,8 @@ namespace BLL ReqUnitId = plan.ReqUnitId, AuditMan = plan.AuditMan, AuditDate = plan.AuditDate, + AuditMan2 = plan.AuditMan2, + AuditDate2 = plan.AuditDate2, WarehouseMan = plan.WarehouseMan, WarehouseDate = plan.WarehouseDate }; @@ -325,7 +342,9 @@ namespace BLL TwMaterialstockService.UpdateStockNum(master.ProjectId, detail.MaterialCode, master.WarehouseCode, TwConst.InOutType.入库, detail.ActNum); } var planModel= TwInOutplanmasterService.GetById(planId); - planModel.State= (int)TwConst.State.已审核; + planModel.State= (int)TwConst.State.已审核; + planModel.WarehouseMan = null; + planModel.WarehouseDate = null; TwInOutplanmasterService.Update(planModel); return result; } diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs index 023cc34d..222195ed 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs @@ -41,7 +41,7 @@ namespace BLL string oldCode = list[0]; if (oldCode.Length > 4) { - string partCode = oldCode.Substring(oldCode.Length - 4); + string partCode = oldCode.Substring(8,3); int num = Funs.GetNewIntOrZero(partCode) + 1; if (num < 10) { diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx index 8e3d08b4..8f14dbfe 100644 --- a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx @@ -19,7 +19,7 @@ } .f-grid-row.red { - background-color: Yellow; + background-color: red; } diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs index 4507a6b8..939e3475 100644 --- a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs @@ -1,4 +1,5 @@ using BLL; +using Model; using System; using System.Collections.Generic; using System.Linq; @@ -50,6 +51,16 @@ namespace FineUIPro.Web.CLGL //tb = GetFilteredTable(Grid1.FilteredData, tb); Grid1.DataSource = tb; Grid1.DataBind(); + for (int i = 0; i < Grid1.Rows.Count; i++) + { + var model = Grid1.Rows[i].DataItem as Tw_ArrivalStatisticsOutPut; + + if (model?.MatchRate < 1 || model?.MatchRate == null) + { + Grid1.Rows[i].RowCssClass = "red"; + + } + } } #endregion diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx index a308f150..5fd4633a 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx @@ -16,10 +16,15 @@ color: blue; font-weight: bold; } - .f-grid-row-summary .f-grid-cell-inner { + + .f-grid-row-summary .f-grid-cell-inner { font-weight: bold; color: red; } + + .f-grid-row.red { + background-color: red; + } @@ -85,7 +90,7 @@ + @@ -136,7 +141,7 @@ FieldType="String" HeaderText="审核人(专工)" TextAlign="Left" HeaderTextAlign="Center"> + RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="审核时间(专工)" TextAlign="Left" HeaderTextAlign="Center"> @@ -162,7 +167,7 @@ - + ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode" ExpandAllRowGroups="false" + SortDirection="DESC" EnableRowGroup="true" DataRowGroupField="PipelineCode" AllowPaging="true" IsDatabasePaging="true" PageSize="10000" RowGroupRendererFunction="onGrid3RowGroupRenderer"> + @@ -281,23 +325,35 @@ } function onGrid3RowGroupRenderer(groupValue, rowData) { var Total = 0, + SumMatchNum = 0, + SumNeedNum = 0, Len = rowData.children.length; for (var i = 0; i < Len; i++) { var childData = rowData.children[i]; var genderValue = childData.values['MatchRate']; - - console.log(genderValue); + var MatchNum = childData.values['MatchNum']; + var NeedNum = childData.values['NeedNum']; + console.log(genderValue); // 确保值存在再进行累加 - if (genderValue !== undefined) { - genderValue = parseFloat(genderValue); // 确保是数字 - genderValue = genderValue > 0 ? genderValue : 0; - Total += genderValue; + + if (MatchNum !== undefined) { + MatchNum = parseFloat(MatchNum); // 确保是数字 + MatchNum = MatchNum > 0 ? MatchNum : 0; + SumMatchNum += MatchNum; } + if (NeedNum !== undefined) { + NeedNum = parseFloat(NeedNum); // 确保是数字 + NeedNum = NeedNum > 0 ? NeedNum : 0; + SumNeedNum += NeedNum; + } + + + } // 检查 Len 是否大于零,以防止除以零 - var TotalRate = Len > 0 ? ((Total * 100) / Len).toFixed(2) + "%" : "0%"; + var TotalRate = SumNeedNum > 0 ? ((SumMatchNum * 100) / SumNeedNum).toFixed(2) + "%" : "0%"; return F.formatString('{0},匹配率:{1}', groupValue, TotalRate); } diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs index d16e0228..147ffba1 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs @@ -102,28 +102,41 @@ namespace FineUIPro.Web.CLGL } private void BindDetailRelationGrid(string inOutPlanMasterId) { - /* Model.Tw_InOutPlanDetail_Relation table = new Model.Tw_InOutPlanDetail_Relation(); - table.InOutPlanMasterId = inOutPlanMasterId; - var tb = BLL.TwInoutplandetailRelationService.GetListData(table, Grid3); - Grid3.DataSource = tb; - Grid3.DataBind(); -*/ - + var inOutPlanMasterModel = TwInOutplanmasterService.GetById(inOutPlanMasterId); var tb = BLL.TwArrivalStatisticsService.GetMatMatchByOutPlanMasterId(inOutPlanMasterId); - Grid3.DataSource = tb; - Grid3.DataBind(); - //if (tb!= null && tb.Count > 0) - //{ - // string Rate = Math.Round((decimal)tb.Average(item => item.MatchRate) * 100, 2).ToString() + "%"; - // JObject summary = new JObject(); - // //summary.Add("Major", "全部合计"); - // summary.Add("MatchRateString", Rate); + if (inOutPlanMasterModel != null) + { + if (inOutPlanMasterModel.State== (int)TwConst.State.已完成|| inOutPlanMasterModel.State == (int)TwConst.State.已审核) + { + TabStrip2.Hidden = true; + TabStrip3.Hidden = false; + Grid4.DataSource = tb; + Grid4.DataBind(); - // Grid3.SummaryData = summary; - //} + } + else + { + TabStrip2.Hidden = false; + TabStrip3.Hidden = true; + Grid3.DataSource = tb; + Grid3.DataBind(); + for (int i = 0; i < Grid3.Rows.Count; i++) + { + var model = Grid3.Rows[i].DataItem as Tw_PipeMatMatchOutput; + if (model?.MatchRate < 1 || model?.MatchRate == null) + { + Grid3.Rows[i].RowCssClass = "red"; + } + } + } + } + + + + } #endregion diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.designer.cs index 01bf030f..947c4f13 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.designer.cs @@ -284,6 +284,24 @@ namespace FineUIPro.Web.CLGL /// protected global::FineUIPro.Grid Grid3; + /// + /// TabStrip3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tab TabStrip3; + + /// + /// Grid4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid4; + /// /// Window1 控件。 /// diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx index c3d6af57..6a800010 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx +++ b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx @@ -132,10 +132,16 @@ RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="发起时间" TextAlign="Left" HeaderTextAlign="Center"> + FieldType="String" HeaderText="审核人(专工)" TextAlign="Left" HeaderTextAlign="Center"> + RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="审核时间(专工)" TextAlign="Left" HeaderTextAlign="Center"> + + + + diff --git a/SGGL/FineUIPro.Web/File/Fastreport/材料出库单.frx b/SGGL/FineUIPro.Web/File/Fastreport/材料出库单.frx index 035e6146..ea4c5193 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; @@ -84,7 +84,7 @@ namespace FastReport } - + @@ -199,30 +199,38 @@ namespace FastReport - - - - - - - + + + + + + + + + + + + + - + - + - + + + - + diff --git a/SGGL/FineUIPro.Web/File/Fastreport/材料出库计划单.frx b/SGGL/FineUIPro.Web/File/Fastreport/材料出库计划单.frx index ef835ecc..c308aa62 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; @@ -84,7 +84,7 @@ namespace FastReport } - + @@ -196,26 +196,34 @@ namespace FastReport - - - - - + + + + + + + - + - + - + - + + + + + - + + + diff --git a/SGGL/FineUIPro.Web/File/Fastreport/焊口打印.frx b/SGGL/FineUIPro.Web/File/Fastreport/焊口打印.frx index 27e3594e..4b79aab2 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/File/Fastreport/管道焊接任务单.frx b/SGGL/FineUIPro.Web/File/Fastreport/管道焊接任务单.frx index 15f229ee..c6bc0ac7 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; @@ -43,11 +43,23 @@ namespace FastReport rowData.Next(); }   } + + private void Table6_ManualBuild(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("Table1"); + // init the data source + rowData.Init(); + Table6.PrintRow(0); + Table6.PrintColumns(); + Table6.PrintRow(1); + Table6.PrintColumns();   + rowData.Next(); + } } } - + @@ -60,6 +72,9 @@ namespace FastReport + + + @@ -67,6 +82,7 @@ namespace FastReport + @@ -148,17 +164,17 @@ namespace FastReport - + - + - + @@ -175,11 +191,17 @@ namespace FastReport - - - - - + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx index 53344db4..5cb2ae6e 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx @@ -84,7 +84,7 @@ diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs index e24f0534..d8925c9b 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs @@ -13,9 +13,19 @@ namespace FineUIPro.Web.HJGL.WeldingManage { public int pageSize = PipelineService.pageSize; //public Dictionary dicSeclectPipeLine = new Dictionary(); - public static List tw_PipeMatMatchOutputs ; - public static decimal Rate = 0; - public static string WarehouseCode = "工厂预制"; + //public static List tw_PipeMatMatchOutputs ; + public static decimal Rate = 0; + public string WarehouseCode + { + get + { + return (string)ViewState["WarehouseCode"]; + } + set + { + ViewState["WarehouseCode"] = value; + } + } public string PipeArea { get @@ -49,6 +59,19 @@ namespace FineUIPro.Web.HJGL.WeldingManage ViewState["dicSeclectPipeLine"] = value; } } + public List tw_PipeMatMatchOutputs + { + get + { + return (List)ViewState["tw_PipeMatMatchOutputs"]; + } + set + { + ViewState["tw_PipeMatMatchOutputs"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) { //ctlAuditFlow.Url = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId); @@ -60,6 +83,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage { WarehouseCode = "现场安装"; } + else + { + WarehouseCode = "工厂预制"; + } HJGL_MaterialService.materialStockItems_FIELD = new List(); HJGL_MaterialService.materialStockItems_SHOP = new List(); dicSeclectPipeLine=new Dictionary(); @@ -88,6 +115,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage rootNode1.Text = "建筑工程"; rootNode1.CommandName = "建筑工程"; rootNode1.Selectable = false; + rootNode1.EnableCheckBox = false; this.tvControlItem.Nodes.Add(rootNode1); TreeNode rootNode2 = new TreeNode(); @@ -95,6 +123,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage rootNode2.Text = "安装工程"; rootNode2.CommandName = "安装工程"; rootNode2.Expanded = true; + rootNode2.EnableCheckBox = false; this.tvControlItem.Nodes.Add(rootNode2); var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); @@ -168,6 +197,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); tn2.EnableExpandEvent = true; tn2.EnableClickEvent= true; + tn2.EnableCheckBox = false; + rootNode2.Nodes.Add(tn2); if (a > 0) { @@ -225,7 +256,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage newNode.Text = item.PipelineCode ; newNode.NodeID = item.PipelineId; newNode.CommandName = "管线"; - newNode.EnableClickEvent = true; + newNode.EnableClickEvent = true; node.Nodes.Add(newNode); } if (pageindex < pageCount) @@ -303,40 +334,39 @@ namespace FineUIPro.Web.HJGL.WeldingManage } void BindGrid2() { - var result = tw_PipeMatMatchOutputs - .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 + //var result = tw_PipeMatMatchOutputs + // .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 - // 如果需要将结果转换为自定义类型,可以这样做 - List output = result.Select(r => new Tw_PipeMatMatchOutput - { - PipelineId = r.PipelineId, - PipelineCode = r.PipelineCode, - UnitWorkName = r.UnitWorkName, - MatchRate = r.AverageMatchRate, - MatchRateString = Math.Round((decimal)r.AverageMatchRate * 100, 2).ToString() + "%" - }).ToList(); + //// 如果需要将结果转换为自定义类型,可以这样做 + //List output = result.Select(r => new Tw_PipeMatMatchOutput + //{ + // PipelineId = r.PipelineId, + // PipelineCode = r.PipelineCode, + // UnitWorkName = r.UnitWorkName, + // MatchRate = r.AverageMatchRate, + // MatchRateString = Math.Round((decimal)r.AverageMatchRate * 100, 2).ToString() + "%" + //}).ToList(); + var output = TwArrivalStatisticsService.GetPipeMatch(tw_PipeMatMatchOutputs); Grid2.DataSource = output; Grid2.DataBind(); - if (output.Any()) + /*if (output.Any()) { Rate = Math.Round((decimal)output.Average(item => item.MatchRate) * 100, 2); lbRate.Text = "匹配率:" + Rate.ToString() + "%"; - } + }*/ var selectList = new List() ; for (int i = 0; i < Grid2.Rows.Count; i++) { - var model = Grid2.Rows[i].DataItem as Tw_PipeMatMatchOutput; - - - + var model = Grid2.Rows[i].DataItem as Tw_PipeMatchOutput; + if (model.MatchRate >=1) { Grid2.Rows[i].RowCssClass = "green"; @@ -370,7 +400,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (relationModle!= null) { Grid3.Rows[i].RowCssClass = "yellow"; - } + } } } @@ -396,6 +426,17 @@ namespace FineUIPro.Web.HJGL.WeldingManage var tb = tw_PipeMatMatchOutputs.Where(x => x.PipelineId == Grid2.SelectedRowID).ToList(); Grid1.DataSource = tb; Grid1.DataBind(); + for (int i = 0; i < Grid1.Rows.Count; i++) + { + var model = Grid1.Rows[i].DataItem as Tw_PipeMatMatchOutput; + + if (model?.MatchRate < 1 || model?.MatchRate==null) + { + Grid1.Rows[i].RowCssClass = "red"; + + } + + } } protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) @@ -521,17 +562,18 @@ namespace FineUIPro.Web.HJGL.WeldingManage protected void btnAddPipelineMatchMat_Click(object sender, EventArgs e) { - if (this.tvControlItem.SelectedNode.CommandName == "管线") - { - if (dicSeclectPipeLine.Where(x => x.Key == this.tvControlItem.SelectedNodeID).Count() == 0) + var selectNodes= tvControlItem.GetCheckedNodes(); + foreach (var node in selectNodes) + { + if (dicSeclectPipeLine.Where(x => x.Key == node.NodeID).Count() == 0 && node.CommandName== "管线") { - dicSeclectPipeLine.Add(this.tvControlItem.SelectedNodeID, this.tvControlItem.SelectedNode.Text); - tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), WarehouseCode); - - BindGrid3(); - BindGrid2(); + dicSeclectPipeLine.Add(node.NodeID, node.Text); } } + tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), WarehouseCode); + + BindGrid3(); + BindGrid2(); } protected void btnDeletePipelineMatchMat_Click(object sender, EventArgs e) @@ -539,6 +581,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (Grid3.SelectedRowID != "") { dicSeclectPipeLine.Remove(Grid3.SelectedRowID); + var node = tvControlItem.FindNode(Grid3.SelectedRowID); + if (node != null) + { + node.Checked = false; + } + tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), WarehouseCode); BindGrid3(); @@ -572,6 +620,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage where Grid2.SelectedRowIDArray.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null && x.WeldingMethodCode != null select x).ToList(); + if (PipeArea=="1") //工厂预制的管线,则只选择预制口 + { + selectRowId = selectRowId.Where(x => x.JointAttribute == "预制口").ToList(); + } foreach (var weldjoint in selectRowId) { string canWeldingRodName = string.Empty; @@ -583,7 +635,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage 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; + NewTask.WeldJointId = weldjoint.WeldJointId; var oldWeldTask = BLL.WeldTaskService.GetWeldTaskByWeldJointId(NewTask.WeldJointId); if (oldWeldTask != null) { diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx index 24e47ec2..1deb0646 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx @@ -86,6 +86,10 @@ + + + +