From f4f7f93835287f44b3fba92f24bcc8a299740d8b Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Fri, 6 Dec 2024 22:17:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=90=E6=96=99=E7=AE=A1=E7=90=86=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=88=E6=89=93=E5=8D=B0=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=8D=95=E5=B7=B2=E5=AE=A1=E6=A0=B8=E5=B7=B2?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=B8=8D=E8=AE=A1=E7=AE=97=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E7=8E=87=EF=BC=89=E6=9D=90=E6=96=99=E5=8C=B9=E9=85=8D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E7=84=8A=E6=8E=A5=E4=BB=BB=E5=8A=A1=E5=8D=95?= =?UTF-8?q?=E4=BF=AE=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 -> 65536 bytes DataBase/版本日志/SGGLDB_V2024-12-06.sql | 12 + SGGL/BLL/CLGL/TwArrivalStatisticsService.cs | 244 +++++++++--------- SGGL/BLL/CLGL/TwInOutplanmasterService.cs | 5 +- SGGL/BLL/CLGL/TwMaterialstockService.cs | 53 ++-- SGGL/BLL/CLGL/TwOutputmasterService.cs | 21 +- .../BLL/HJGL/WeldingManage/WeldTaskService.cs | 2 +- .../FineUIPro.Web/CLGL/ArrivalStatistics.aspx | 2 +- .../CLGL/ArrivalStatistics.aspx.cs | 11 + SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx | 82 +++++- SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs | 47 ++-- .../CLGL/OutPlanMaster.aspx.designer.cs | 18 ++ SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx | 10 +- .../File/Fastreport/材料出库单.frx | 34 ++- .../File/Fastreport/材料出库计划单.frx | 32 ++- .../File/Fastreport/焊口打印.frx | 4 +- .../File/Fastreport/管道焊接任务单.frx | 42 ++- .../HJGL/WeldingManage/WeldMatMatch.aspx | 2 +- .../HJGL/WeldingManage/WeldMatMatch.aspx.cs | 130 +++++++--- .../HJGL/WeldingManage/WeldTask.aspx | 4 + .../HJGL/WeldingManage/WeldTask.aspx.cs | 215 ++++++++++----- .../WeldingManage/WeldTask.aspx.designer.cs | 18 ++ SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs | 15 ++ SGGL/Model/Model.cs | 170 +++++++++++- 24 files changed, 850 insertions(+), 323 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2024-12-06.sql diff --git a/.vs/SGGL_SeDin_New/v17/.wsuo b/.vs/SGGL_SeDin_New/v17/.wsuo index 0fdfbad7838c03294b1fe58bb28793c7852e6de5..ccfe80e6983800780dfeeb6004b787efd80bbac5 100644 GIT binary patch delta 2110 zcmchXT})eL7{||hdcdyq16qV`DQ&@al)83>mX9p59fd(RK87N(a~NTKgqUm@ks@wx zJxg|@nF!~vaTmrgOq49UARcbKvJo%5FdJ9KgnbZ)5jQgvL*tex_`Iye`aKifoBYms zp69$D&-;I$_b69%iXzRnicCVO=-RS050f7us)-t+mcSK*y=^xcdkC3$oOpt0AR39iL=(|W zM2UUGexikFCE5tS;R8emG0M}M>^W2V5;j1K1Rq2Io?oPnK!-r@1X_R7Uf{tQeo| zfokskN6mRkUA-}mpLvmTwIJCQsuu*tXd-IvFH!v{JS63UTsjjXIL?Zo>K=0sSI1m~PhkL85YC^R&eK_LoRG&$rGUmgI z+m58yr}@ghWSfR+Z7?xj$^7nTl4Z?^TMrm@e3k5Q6H?YreNI*gBet`uqk(Uo1rc|& zqru#U{E{#lbk!IuX)y^t>RysHB*#yV0e5ZtG4H6?ltP86{&^GQi}RmQCJAlT-%5G@ zUka!}+Bm=KMOkaIM#O{btP1g+31cOF2ob!gRZ%^!@Jwm=~4ii^Z7woDAilg5lU!?O?1t?I)o;o77S1Lgzh+ zd+hei%;6h^Y-z)F(D}Q2``eaZRlP60CVHrFkjt;H?K!=`&tOntKE<< zl;QU4+b}U|z|^%|L{3cLr};vBch$;{p|tOicKrI3$PVNDL>qQ3Z)30VAeM%TaOs8< zPcI+E>^ToQZWz(O*p1{{eoTGk6pu0}7v0*$ub*Q0Vfh^Odza1O{O50A{2M7%Q6vub`k-Cl@H;L2QscB~~k?^0^o0{eTLJR3RQYLnc{HCM(&!&EC&nLfUeo{;&_5@Y%43T2a*hE1PwlS!& zRdk+!P&bYThK-oz=;T4HJYYZY0Xt{_^*{n!a6N#Tzk&}(b?vOqe7|9VDHIDp-D zz&{?WS{hczA-f*XHCE*w%waG|!`4zMja3Fb1*X6>m;qTZ3!VmZAP4f`G&lp!f&!Qa z3t$l}fo1RvcosYd&VlpbdGG>w5nKQ-ftLlLNw|o`E1(Dzuyt)Rq?uCHm``;4otT$u zV{XL2hL`;g!HAv_`Pyt4w#~3L)`mTo>!9BUc$RoJc$RASxs6*8=!&KBFZ0m?Uv6)V zLsj|zkPnBC4%lrZ+C3H?0*c$?r+6GVyatW6G4pyf)_m@&%H0p>BarD!dt9@7*f#m= zfBO$Uqx+p-GZvsqLy5PttHfM-#Z_<8+7eEICxy2rPZIBDHcCp{lMYi=wWCf_r7dGK z*H}`~e^nC`lxT?Qs;DxpDe16cpU2B^qhix7C*zIDi?gZ?(xv8iG)_za%Fe&ZhPR0ZOP|a(s{3fu|=Al>7P>QESMK4n6U1S}k zcuP#AidU9?#_>?af;bo+DD?L9hoyx=q+jZbMhnvX^5CEpDa=Psp6prb8(3PV4_h;o z$p+}B!$+8z*vw}X&U(q4Jx1kxP!IaPV_GgwYVLx2K^j<^@0G&+g`UV_UwCky@m9&j z%-LIZGUs3C4z!y0XucqAf0Bk;qx8$v#NM;19WL(_?CqJLzA=+!q|TM8aaN?oSs&fV9ih{? l6^iHM=DP)(kCBQ(-N<|Ncs9F@vm 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 @@ + + + +