diff --git a/DataBase/版本日志/SGGLDB_V2025-07-30-001-bwj.sql b/DataBase/版本日志/SGGLDB_V2025-07-30-001-bwj.sql deleted file mode 100644 index 04de2474..00000000 --- a/DataBase/版本日志/SGGLDB_V2025-07-30-001-bwj.sql +++ /dev/null @@ -1,7 +0,0 @@ -alter table HJGL_PackagingManage add CompileMan nvarchar(50) -alter table HJGL_PackagingManage add CompileDate datetime -go -ALTER TABLE [dbo].[PTP_TestPackage] DROP CONSTRAINT [FK_PTP_TestPackage_Base_Unit] -GO -alter table PTP_TestPackage alter column UnitId nvarchar(500) -go diff --git a/DataBase/版本日志/SGGLDB_V2025-08-03-001-bwj.sql b/DataBase/版本日志/SGGLDB_V2025-08-03-001-bwj.sql new file mode 100644 index 00000000..3ca5eb4b --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2025-08-03-001-bwj.sql @@ -0,0 +1,176 @@ +alter table HJGL_PackagingManage add CompileMan nvarchar(50) +alter table HJGL_PackagingManage add CompileDate datetime +go +ALTER TABLE [dbo].[PTP_TestPackage] DROP CONSTRAINT [FK_PTP_TestPackage_Base_Unit] +GO +alter table PTP_TestPackage alter column UnitId nvarchar(500) +go + +alter table HJGL_ProductionSchedulingPlan alter column CompletedCount decimal(18,2) +alter table HJGL_ProductionSchedulingPlan add OnDayCompleteDyne decimal(18,2) +alter table HJGL_ProductionSchedulingPlan add NextDayCompleteDyne decimal(18,2) +go +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'OnDayCompleteDyne' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ӧ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'NextDayCompleteDyne' +GO + + +ALTER PROCEDURE [dbo].[Sp_ProductionSchedulingPlanStatistics] + @projectId nvarchar(50)=null, + @unitWorkId nvarchar(50)=null, + @flowingSection nvarchar(50)=null, + @caliber nvarchar(50)=null +AS +/************Ųƻͳ**********/ +SELECT distinct unitWork.UnitWorkId, +unitWork.UnitWorkCode, +unitWork.UnitWorkName, +unitWork.ProjectId, +pipeline.FlowingSection, +p.SteelType, +(case p.SteelType when '1' then '̼' when '2' then '' when '3' then '' when '4' then 'ͺϽ' when '5' then 'Ͻ' when '6' then 'ѺϽ' when '7' then '' end) as Material, +'<'+ @caliber as Caliber +--isnull(weldJoint.Dia,0) as Dia, +--isnull(maxDia.maxTotalDia+weldJoint.Dia,0) as totalDia, +--isnull(cTotal.cTotalCount,0) as cTotalCount, +--(case when isnull(total.totalCount,0)>0 then +--isnull(cTotal.cTotalCount,0) / isnull(cast(total.totalCount as decimal(18,2)),0)*100.0 else 0 end) as rate, +--(case when isnull(ScTotal.ScTotalCount,0)>0 then +--isnull(Stotal.StotalCount,0)/isnull(cast(ScTotal.ScTotalCount as decimal(18,2)),0)*100.0 else 0 end)as Srate +FROM WBS_UnitWork AS unitWork +LEFT JOIN (select FlowingSection,UnitWorkId from HJGL_Pipeline where PipeArea='1' and FlowingSection is not null and FlowingSection!='') as pipeline on pipeline.UnitWorkId = unitWork.UnitWorkId +-- +left join (select SteelType,UnitWorkId from HJGL_Pipeline + left join Base_Material on Base_Material.MaterialId = HJGL_Pipeline.MaterialId + where PipeArea='1' and HJGL_Pipeline.MaterialId is not null and HJGL_Pipeline.MaterialId!='' + )as p on p.UnitWorkId = unitWork.UnitWorkId +---- +--LEFT JOIN (select sum(Size) as Dia,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint +-- left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId +-- left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id +-- where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' +-- and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)<@caliber +-- group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as weldJoint on weldJoint.UnitWorkId =unitWork.UnitWorkId +-- and weldJoint.FlowingSection = pipeline.FlowingSection +----ڿھĴ +LEFT JOIN (select sum(Size) as maxTotalDia,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint + left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId + left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id + where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' + and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)>=@caliber + group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as maxDia on maxDia.UnitWorkId =unitWork.UnitWorkId + and maxDia.FlowingSection = pipeline.FlowingSection +----ܺ +--LEFT JOIN (select count(*) as totalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint +-- left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId +-- left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id +-- where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' +-- and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)<@caliber +-- group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as total on total.UnitWorkId =unitWork.UnitWorkId +-- and total.FlowingSection = pipeline.FlowingSection +----ɺ +--LEFT JOIN (select count(*) as cTotalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint +-- left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId +-- left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id +-- where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' +-- and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)<@caliber +-- and HJGL_WeldJoint.WeldingDailyId is not null +-- group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as cTotal on cTotal.UnitWorkId =unitWork.UnitWorkId +-- and cTotal.FlowingSection = pipeline.FlowingSection +----ܺ +--LEFT JOIN (select count(*) as StotalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from HJGL_WeldJoint +-- left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId +-- where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' +-- group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as Stotal on Stotal.UnitWorkId =unitWork.UnitWorkId +-- and total.FlowingSection = pipeline.FlowingSection +----ɺ +--LEFT JOIN (select count(*) as ScTotalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from HJGL_WeldJoint +-- left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId +-- where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' +-- and HJGL_WeldJoint.WeldingDailyId is not null +-- group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as ScTotal on ScTotal.UnitWorkId =unitWork.UnitWorkId +-- and cTotal.FlowingSection = pipeline.FlowingSection +where (unitWork.ProjectId=@projectId or @projectId is null) +and (unitWork.UnitWorkId=@unitWorkId or @unitWorkId is null) +and (pipeline.FlowingSection=@flowingSection or @flowingSection is null) +union + +SELECT distinct unitWork.UnitWorkId, +unitWork.UnitWorkCode, +unitWork.UnitWorkName, +unitWork.ProjectId, +pipeline.FlowingSection, +p.SteelType, +(case p.SteelType when '1' then '̼' when '2' then '' when '3' then '' when '4' then 'ͺϽ' when '5' then 'Ͻ' when '6' then 'ѺϽ' when '7' then '' end) as Material, +''+@caliber as Caliber +--isnull(weldJoint.Dia,0) as Dia, +--isnull(weldJoint.Dia+minDia.minTotalDia,0) as TotalDia, +--isnull(cTotal.cTotalCount,0) as cTotalCount, +--(case when isnull(total.totalCount,0)>0 then +--isnull(cTotal.cTotalCount,0) / isnull(cast(total.totalCount as decimal(18,2)),0)*100.0 else 0 end) as rate, +--(case when isnull(ScTotal.ScTotalCount,0)>0 then +--isnull(Stotal.StotalCount,0)/isnull(cast(ScTotal.ScTotalCount as decimal(18,2)),0)*100.0 else 0 end)as Srate +FROM WBS_UnitWork AS unitWork +LEFT JOIN (select FlowingSection,UnitWorkId from HJGL_Pipeline where PipeArea='1' and FlowingSection is not null and FlowingSection!='') as pipeline on pipeline.UnitWorkId = unitWork.UnitWorkId + +-- +left join (select SteelType,UnitWorkId from HJGL_Pipeline + left join Base_Material on Base_Material.MaterialId = HJGL_Pipeline.MaterialId + where PipeArea='1' and HJGL_Pipeline.MaterialId is not null and HJGL_Pipeline.MaterialId!='' + )as p on p.UnitWorkId = unitWork.UnitWorkId + +--LEFT JOIN (select sum(Size) as Dia,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint +-- left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId +-- left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id +-- where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' +-- and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)>=@caliber +-- group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as weldJoint on weldJoint.UnitWorkId =unitWork.UnitWorkId +-- and weldJoint.FlowingSection = pipeline.FlowingSection +----СڿھĴ +--LEFT JOIN (select sum(Size) as minTotalDia,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint +-- left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId +-- left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id +-- where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' +-- and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)<@caliber +-- group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as minDia on minDia.UnitWorkId =unitWork.UnitWorkId +-- and minDia.FlowingSection = pipeline.FlowingSection + +----ܺ +--LEFT JOIN (select count(*) as totalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint +-- left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId +-- left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id +-- where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' +-- and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)>=@caliber +-- group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as total on total.UnitWorkId =unitWork.UnitWorkId +-- and total.FlowingSection = pipeline.FlowingSection +----ɺ +--LEFT JOIN (select count(*) as cTotalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint +-- left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId +-- left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id +-- where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' +-- and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)>=@caliber +-- and HJGL_WeldJoint.WeldingDailyId is not null +-- group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as cTotal on cTotal.UnitWorkId =unitWork.UnitWorkId +-- and cTotal.FlowingSection = pipeline.FlowingSection + +--ܺ +--LEFT JOIN (select count(*) as StotalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from HJGL_WeldJoint +-- left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId +-- where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' +-- group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as Stotal on Stotal.UnitWorkId =unitWork.UnitWorkId +-- and total.FlowingSection = pipeline.FlowingSection +----ɺ +--LEFT JOIN (select count(*) as ScTotalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from HJGL_WeldJoint +-- left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId +-- where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' +-- and HJGL_WeldJoint.WeldingDailyId is not null +-- group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as ScTotal on ScTotal.UnitWorkId =unitWork.UnitWorkId +-- and cTotal.FlowingSection = pipeline.FlowingSection +where (unitWork.ProjectId=@projectId or @projectId is null) +and (unitWork.UnitWorkId=@unitWorkId or @unitWorkId is null) +and (pipeline.FlowingSection=@flowingSection or @flowingSection is null) +GO + + diff --git a/SGGL/BLL/HJGL/PreDesign/ProductionSchedulingPlanService.cs b/SGGL/BLL/HJGL/PreDesign/ProductionSchedulingPlanService.cs index 6ace3fb8..ab72d20e 100644 --- a/SGGL/BLL/HJGL/PreDesign/ProductionSchedulingPlanService.cs +++ b/SGGL/BLL/HJGL/PreDesign/ProductionSchedulingPlanService.cs @@ -26,7 +26,7 @@ namespace BLL public static Model.HJGL_ProductionSchedulingPlan GetProductionSchedulingPlan(string loginProjectId, string flowingSection, string unitWorkId, string material, string caliber) { - return Funs.DB.HJGL_ProductionSchedulingPlan.FirstOrDefault(e => e.ProjectId == loginProjectId && e.FlowNum == flowingSection && e.PipelineId == unitWorkId && e.Caliber == caliber); + return Funs.DB.HJGL_ProductionSchedulingPlan.FirstOrDefault(e => e.ProjectId == loginProjectId && e.FlowNum == flowingSection && e.PipelineId == unitWorkId && e.Material == material && e.Caliber == caliber); } /// @@ -85,6 +85,8 @@ namespace BLL newPlan.CompletedCount = plan.CompletedCount; newPlan.CompletedRate = plan.CompletedRate; newPlan.TotalCompletedRate = plan.TotalCompletedRate; + newPlan.OnDayCompleteDyne = plan.OnDayCompleteDyne; + newPlan.NextDayCompleteDyne = plan.NextDayCompleteDyne; try { db.SubmitChanges(System.Data.Linq.ConflictMode.ContinueOnConflict); diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs index f2f06986..230f8d1e 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs @@ -485,13 +485,13 @@ namespace BLL if (!string.IsNullOrEmpty(model.WeldJointCode)) baseQuery = baseQuery.Where(x => x.WeldJointCode.Contains(model.WeldJointCode)); - return baseQuery.ToList() ; + return baseQuery.ToList(); } - public static (List Data, int Total)GetDataBymodel(Model.View_HJGL_WeldJoint model, int pageIndex = 0, int pageSize = 20) + public static (List Data, int Total) GetDataBymodel(Model.View_HJGL_WeldJoint model, int pageIndex = 0, int pageSize = 20) { // 阶段一:构建基础查询 var baseQuery = Funs.DB.View_HJGL_WeldJoint.AsQueryable(); - + // 阶段二:构建动态查询条件 if (!string.IsNullOrEmpty(model.ProjectId)) baseQuery = baseQuery.Where(x => x.ProjectId == model.ProjectId); @@ -500,16 +500,16 @@ namespace BLL if (!string.IsNullOrEmpty(model.PipelineId)) baseQuery = baseQuery.Where(x => x.PipelineId == model.PipelineId); if (!string.IsNullOrEmpty(model.PipelineCode)) - baseQuery = baseQuery.Where(x => x.PipelineCode .Contains(model.PipelineCode)); + baseQuery = baseQuery.Where(x => x.PipelineCode.Contains(model.PipelineCode)); if (!string.IsNullOrEmpty(model.WeldJointCode)) - baseQuery = baseQuery.Where(x => x.WeldJointCode.Contains( model.WeldJointCode)); - + baseQuery = baseQuery.Where(x => x.WeldJointCode.Contains(model.WeldJointCode)); + // 阶段三:排序与分页控制(索引优化关键) - var orderedQuery = baseQuery.OrderBy(x=>x.PipelineId).ThenBy(x => x.WeldJointCode); + var orderedQuery = baseQuery.OrderBy(x => x.PipelineId).ThenBy(x => x.WeldJointCode); // 阶段四:分页执行(数据库层面分页) var pagedData = orderedQuery - .Skip((pageIndex ) * pageSize) + .Skip((pageIndex) * pageSize) .Take(pageSize) .ToList(); @@ -542,7 +542,7 @@ namespace BLL var pagedData = orderedQuery .Skip((pageIndex) * pageSize) .Take(pageSize) - .ToList(); + .ToList(); return pagedData; } @@ -629,5 +629,103 @@ namespace BLL return result; } + + + + /// + /// 根据单位工程、流水号、材质、口径获取达因数 + /// + /// + /// 单位工程 + /// 流水段 + /// 材质 + /// 口径 + /// 1-总达因,2-完成总达因 + /// + public static decimal? GetSizeSum(string projectId, string unitWorkId, string flowingSection, string steelType, string caliber,string type) + { + Model.SGGLDB db = Funs.DB; + decimal? sizeSum = 0; + int c = 0; + if (!string.IsNullOrEmpty(caliber)) + { + c = Convert.ToInt32(caliber.Substring(1, caliber.Length - 1)); + var weldjoints = (from x in db.HJGL_WeldJoint + join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId + join z in db.Base_Material on y.MaterialId equals z.MaterialId + where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection && z.SteelType == steelType + && y.PipeArea == "1" && x.JointAttribute == "预制口" + //&& Convert.ToInt32(x.DNDia.Substring(2, x.DNDia.Length - 2)) < c + select x); + + foreach (var item in weldjoints) + { + int s = Convert.ToInt32(item.DNDia.Substring(2, item.DNDia.Length - 2)); + if (caliber.Substring(0, 1) == "<" && s < c) + { + if (type == "1") + { + sizeSum += item.Size; + } + else + { + if (!string.IsNullOrEmpty(item.WeldingDailyId)) + { + sizeSum += item.Size; + } + } + } + else if (caliber.Substring(0, 1) == "≥" && s >= c) + { + if (type == "1") + { + sizeSum += item.Size; + } + else + { + if (!string.IsNullOrEmpty(item.WeldingDailyId)) + { + sizeSum += item.Size; + } + } + } + } + } + return sizeSum; + } + + /// + /// 根据单位工程、流水段获取总达因 + /// + /// 项目id + /// 单位工程 + /// 流水段 + /// 1-总达因,2-完成总达因 + /// + public static decimal? GetSizeSumByUnitWorkIdAndFlowingSection(string projectId, string unitWorkId, string flowingSection,string type) + { + Model.SGGLDB db = Funs.DB; + decimal? sizeSum = 0; + if (type == "1") + { + sizeSum = (from x in db.HJGL_WeldJoint + join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId + join z in db.Base_Material on y.MaterialId equals z.MaterialId + where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection + && y.PipeArea == "1" && x.JointAttribute == "预制口" + select x.Size).Sum(); + } + else + { + sizeSum = (from x in db.HJGL_WeldJoint + join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId + join z in db.Base_Material on y.MaterialId equals z.MaterialId + where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection + && y.PipeArea == "1" && x.JointAttribute == "预制口" + && x.WeldingDailyId != "" && x.WeldingDailyId != null + select x.Size).Sum(); + } + return sizeSum; + } } } diff --git a/SGGL/FineUIPro.Web/File/Excel/DataOut/排产计划导出模板.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataOut/排产计划导出模板.xlsx index 24e30a80..0a4d300e 100644 Binary files a/SGGL/FineUIPro.Web/File/Excel/DataOut/排产计划导出模板.xlsx and b/SGGL/FineUIPro.Web/File/Excel/DataOut/排产计划导出模板.xlsx differ diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx b/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx index db3ff54e..adee1de5 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx @@ -12,52 +12,52 @@
- + - + - + - + - - + + - + - + - + - + - - + + - + + DataField="TotalDyne" SortField="TotalDyne" FieldType="String" HeaderTextAlign="Center" TextAlign="Left" + Width="90px"> - + - + - + - + - + - + - + - + - - - + <%-- + + --%> - + DataField="AvgDailyWorkload" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left" + Width="140px"> + - + - + + + + + + + + + + + DataField="CompletedRate" FieldType="String" HeaderTextAlign="Center" TextAlign="Left" + Width="130px"> + DataField="TotalCompletedRate" FieldType="String" HeaderTextAlign="Center" TextAlign="Left" + Width="150px"> - - + + - - - - + + + @@ -158,11 +171,11 @@ - + - + - + endDate) { + alert("计划开始时间不能大于计划结束时间"); + return; + } + // 计算时间差(毫秒) + const timeDifference = endDate - startDate; + // 将时间差转换为天数 + const daysDifference = timeDifference / (1000 * 60 * 60 * 24); + //平均每天工作量=总达因/天数 + const avgDailyWorkload = totalDia / (daysDifference + 1); + //次日应完成量=平均每天完成量-已完成量+平均每天完成量 + if (onDayCompleteDyne != "") { + var nextDayCompleteDyne = avgDailyWorkload - onDayCompleteDyne + avgDailyWorkload; + } + + me.updateCellValue(rowId, 'Days', daysDifference + 1);//天数 + me.updateCellValue(rowId, 'AvgDailyWorkload', avgDailyWorkload);//平均每天工作量 + me.updateCellValue(rowId, 'NextDayCompleteDyne', nextDayCompleteDyne);//次日应完成量 + } } diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.cs index b0c57b6e..d2a474a6 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.cs @@ -255,22 +255,43 @@ namespace FineUIPro.Web.HJGL.PreDesign BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanByUnitWorkIdAndFlowNum(this.CurrUser.LoginProjectId,this.tvControlItem.SelectedNode.ParentNode.Text, this.tvControlItem.SelectedNode.Text); for (int i = 0; i < tb.Rows.Count; i++) { - var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, tb.Rows[i]["FlowingSection"].ToString(), tb.Rows[i]["UnitWorkId"].ToString(), tb.Rows[i]["Material"].ToString(), tb.Rows[i]["Caliber"].ToString()); + string unitWorkId = tb.Rows[i]["UnitWorkId"].ToString();//单位工程 + string flowingSection = tb.Rows[i]["FlowingSection"].ToString();//流水号 + string steelType = tb.Rows[i]["SteelType"].ToString();//材质Value + string material = tb.Rows[i]["Material"].ToString();//材质Text + string caliber = tb.Rows[i]["Caliber"].ToString();//寸径 + + var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, flowingSection, unitWorkId, material, caliber); if (plan == null) { Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan(); newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan)); newPlan.ProjectId = this.CurrUser.LoginProjectId; - newPlan.PipelineId = tb.Rows[i]["UnitWorkId"].ToString();//装置ID - newPlan.FlowNum = tb.Rows[i]["FlowingSection"].ToString(); + newPlan.PipelineId = unitWorkId; + newPlan.FlowNum = flowingSection; newPlan.MainItemName = tb.Rows[i]["UnitWorkName"].ToString(); - newPlan.Material = tb.Rows[i]["Material"].ToString(); - newPlan.Caliber = tb.Rows[i]["Caliber"].ToString(); - newPlan.Dain = Funs.GetNewDecimalOrZero(tb.Rows[i]["Dia"].ToString()); - newPlan.TotalDyne = Funs.GetNewDecimalOrZero(tb.Rows[i]["TotalDia"].ToString()); - newPlan.CompletedCount = Funs.GetNewIntOrZero(tb.Rows[i]["cTotalCount"].ToString()); - newPlan.CompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["rate"].ToString()); - newPlan.TotalCompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["Srate"].ToString()); + newPlan.Material = material; + newPlan.Caliber = caliber; + newPlan.Dain = BLL.WeldJointService.GetSizeSum(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, steelType, caliber,"1"); + newPlan.TotalDyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(this.CurrUser.LoginProjectId, unitWorkId, flowingSection,"1"); + newPlan.CompletedCount = BLL.WeldJointService.GetSizeSum(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, steelType, caliber, "2"); + if (newPlan.Dain > 0) + { + newPlan.CompletedRate = (newPlan.CompletedCount / newPlan.Dain) * 100; + } + else + { + newPlan.CompletedRate = 0; + } + if (newPlan.TotalDyne > 0) + { + decimal? completeDinSum = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, "2"); + newPlan.TotalCompletedRate = (completeDinSum / newPlan.TotalDyne) * 100; + } + else + { + newPlan.TotalCompletedRate = 0; + } BLL.ProductionSchedulingPlanService.AddProductionSchedulingPlan(newPlan); } } @@ -299,22 +320,43 @@ namespace FineUIPro.Web.HJGL.PreDesign BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanByUnitWork(this.CurrUser.LoginProjectId, this.tvControlItem.SelectedNode.Text); for (int i = 0; i < tb.Rows.Count; i++) { - var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, tb.Rows[i]["FlowingSection"].ToString(), tb.Rows[i]["UnitWorkId"].ToString(), tb.Rows[i]["Material"].ToString(), tb.Rows[i]["Caliber"].ToString()); + string unitWorkId = tb.Rows[i]["UnitWorkId"].ToString();//单位工程 + string flowingSection = tb.Rows[i]["FlowingSection"].ToString();//流水号 + string steelType = tb.Rows[i]["SteelType"].ToString();//材质Value + string material = tb.Rows[i]["Material"].ToString();//材质Text + string caliber = tb.Rows[i]["Caliber"].ToString();//寸径 + var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, flowingSection, unitWorkId, material, caliber); if (plan == null) { Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan(); newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan)); newPlan.ProjectId = this.CurrUser.LoginProjectId; - newPlan.PipelineId = tb.Rows[i]["UnitWorkId"].ToString();//装置ID - newPlan.FlowNum = tb.Rows[i]["FlowingSection"].ToString(); + newPlan.PipelineId = unitWorkId; + newPlan.FlowNum = flowingSection; newPlan.MainItemName = tb.Rows[i]["UnitWorkName"].ToString(); - newPlan.Material = tb.Rows[i]["Material"].ToString(); - newPlan.Caliber = tb.Rows[i]["Caliber"].ToString(); - newPlan.Dain = Funs.GetNewDecimalOrZero(tb.Rows[i]["Dia"].ToString()); - newPlan.TotalDyne = Funs.GetNewDecimalOrZero(tb.Rows[i]["TotalDia"].ToString()); - newPlan.CompletedCount = Funs.GetNewIntOrZero(tb.Rows[i]["cTotalCount"].ToString()); - newPlan.CompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["rate"].ToString()); - newPlan.TotalCompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["Srate"].ToString()); + newPlan.Material = material; + newPlan.Caliber = caliber; + newPlan.Dain = BLL.WeldJointService.GetSizeSum(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, steelType, caliber, "1"); + newPlan.TotalDyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, "1"); + newPlan.CompletedCount = BLL.WeldJointService.GetSizeSum(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, steelType, caliber, "2"); + if (newPlan.Dain > 0) + { + newPlan.CompletedRate = (newPlan.CompletedCount / newPlan.Dain) * 100; + } + else + { + newPlan.CompletedRate = 0; + } + if (newPlan.TotalDyne > 0) + { + decimal? completeDinSum = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, "2"); + newPlan.TotalCompletedRate = (completeDinSum / newPlan.TotalDyne) * 100; + } + else + { + newPlan.TotalCompletedRate = 0; + } + BLL.ProductionSchedulingPlanService.AddProductionSchedulingPlan(newPlan); } } @@ -393,7 +435,9 @@ namespace FineUIPro.Web.HJGL.PreDesign w.ProjectType, p.CompletedCount, p.CompletedRate, - p.TotalCompletedRate + p.TotalCompletedRate, + p.OnDayCompleteDyne, + p.NextDayCompleteDyne FROM HJGL_ProductionSchedulingPlan p left join WBS_UnitWork w on w.UnitWorkId=p.PipelineId WHERE 1=1 "; @@ -518,6 +562,11 @@ namespace FineUIPro.Web.HJGL.PreDesign newPlan.PlanEndDate = Funs.GetNewDateTime(values.Value("PlanEndDate")); newPlan.Days = Funs.GetNewInt(values.Value("Days")); newPlan.AvgDailyWorkload = Funs.GetNewDecimal(values.Value("AvgDailyWorkload")); + newPlan.OnDayCompleteDyne = Funs.GetNewDecimal(values.Value("OnDayCompleteDyne")); + newPlan.NextDayCompleteDyne = Funs.GetNewDecimal(values.Value("NextDayCompleteDyne")); + newPlan.CompletedCount = Funs.GetNewInt(values.Value("CompletedCount")); + newPlan.CompletedRate = Funs.GetNewDecimal(values.Value("CompletedRate")); + newPlan.TotalCompletedRate = Funs.GetNewDecimal(values.Value("TotalCompletedRate")); BLL.ProductionSchedulingPlanService.UpdateProductionSchedulingPlan(newPlan); } } @@ -546,9 +595,9 @@ namespace FineUIPro.Web.HJGL.PreDesign } else if (tvControlItem.SelectedNode.CommandName == "流水段") { - lists = lists.Where(x => x.FlowNum == this.tvControlItem.SelectedNode.Text); + lists = lists.Where(x => x.MainItemName == this.tvControlItem.SelectedNode.ParentNode.Text && x.FlowNum == this.tvControlItem.SelectedNode.Text); } - + lists = lists.OrderBy(x => x.Caliber).OrderBy(x => x.Material).OrderBy(x => x.FlowNum).OrderBy(x => x.MainItemName); if (lists != null) { newUrl = uploadfilepath.Replace("排产计划导出模板", "排产计划-" + this.tvControlItem.SelectedNode.Text + "-" + DateTime.Now.ToString("yyyyMMdd")); @@ -636,13 +685,21 @@ namespace FineUIPro.Web.HJGL.PreDesign cell = row.CreateCell(12); cell.CellStyle = cellStyle; - cell.SetCellValue(item.CompletedCount.HasValue ? item.CompletedCount.ToString() : "");//已完成量 - + cell.SetCellValue(item.OnDayCompleteDyne.HasValue ? item.OnDayCompleteDyne.ToString() : "");//当日已完成量 + cell = row.CreateCell(13); cell.CellStyle = cellStyle; + cell.SetCellValue(item.NextDayCompleteDyne.HasValue ? item.NextDayCompleteDyne.ToString() : "");//次日应完成量 + + cell = row.CreateCell(14); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.CompletedCount.HasValue ? item.CompletedCount.ToString() : "");//累计已完成量 + + cell = row.CreateCell(15); + cell.CellStyle = cellStyle; cell.SetCellValue(item.CompletedRate.HasValue ? item.CompletedRate.ToString() : "");//已完成百分比 - cell = row.CreateCell(14); + cell = row.CreateCell(16); cell.CellStyle = cellStyle; cell.SetCellValue(item.TotalCompletedRate.HasValue ? item.TotalCompletedRate.ToString() : "");//已完成百分比汇总 diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.designer.cs index b90feb56..47f27654 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.designer.cs @@ -7,13 +7,11 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HJGL.PreDesign -{ - - - public partial class ProductionSchedulingPlan - { - +namespace FineUIPro.Web.HJGL.PreDesign { + + + public partial class ProductionSchedulingPlan { + /// /// form1 控件。 /// @@ -22,7 +20,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -31,7 +29,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -40,7 +38,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// panelLeftRegion 控件。 /// @@ -49,7 +47,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelLeftRegion; - + /// /// txtSize 控件。 /// @@ -58,7 +56,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.NumberBox txtSize; - + /// /// btnStatics 控件。 /// @@ -67,7 +65,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnStatics; - + /// /// hdUnitWorkId 控件。 /// @@ -76,7 +74,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.HiddenField hdUnitWorkId; - + /// /// tvControlItem 控件。 /// @@ -85,7 +83,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Tree tvControlItem; - + /// /// panelCenterRegion 控件。 /// @@ -94,7 +92,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelCenterRegion; - + /// /// Toolbar3 控件。 /// @@ -103,7 +101,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar3; - + /// /// ToolbarFill1 控件。 /// @@ -112,7 +110,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnSave 控件。 /// @@ -121,7 +119,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnSave; - + /// /// btnOut 控件。 /// @@ -130,7 +128,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnOut; - + /// /// Grid1 控件。 /// @@ -139,7 +137,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// txtTotalPriority 控件。 /// @@ -148,7 +146,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtTotalPriority; - + /// /// txtPriorityTotalDyne 控件。 /// @@ -157,7 +155,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.NumberBox txtPriorityTotalDyne; - + /// /// txtPlanStartDate 控件。 /// @@ -166,7 +164,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtPlanStartDate; - + /// /// txtPlanEndDate 控件。 /// @@ -175,16 +173,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtPlanEndDate; - - /// - /// txtDays 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.NumberBox txtDays; - + /// /// txtAvgDailyWorkload 控件。 /// @@ -193,7 +182,25 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.NumberBox txtAvgDailyWorkload; - + + /// + /// NumberBox1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox NumberBox1; + + /// + /// NumberBox2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox NumberBox2; + /// /// ToolbarSeparator1 控件。 /// @@ -202,7 +209,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -211,7 +218,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -220,7 +227,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// Menu1 控件。 /// @@ -229,7 +236,7 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuDelete 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/ItemEndCheck.aspx.cs b/SGGL/FineUIPro.Web/HJGL/TestPackage/ItemEndCheck.aspx.cs index f6bb4697..96214260 100644 --- a/SGGL/FineUIPro.Web/HJGL/TestPackage/ItemEndCheck.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/ItemEndCheck.aspx.cs @@ -364,7 +364,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { if (this.tvControlItem.SelectedNode.CommandName == "TestPackage") { - if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.AItemEndCheckMenuId, Const.BtnAdd)) + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.AItemEndCheckMenuId, Const.BtnSave)) { string url = "ItemEndCheckEdit.aspx?PTP_ID={0}"; PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format(url, tvControlItem.SelectedNodeID, "操作 - "))); diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageAudit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageAudit.aspx.cs index f9d01d85..e8f6470f 100644 --- a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageAudit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageAudit.aspx.cs @@ -332,7 +332,11 @@ namespace FineUIPro.Web.HJGL.TestPackage var pipeline = db.HJGL_Pipeline.FirstOrDefault(x => x.PipelineId == pipelineItem.PipelineId); var totalJoint = from x in db.HJGL_WeldJoint join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId - where y.UnitWorkId == pipeline.UnitWorkId && y.DetectionRateId == pipeline.DetectionRateId && y.DetectionType.Contains(pipeline.DetectionType) + join z in db.PTP_PipelineList on y.PipelineId equals z.PipelineId + //where y.UnitWorkId == pipeline.UnitWorkId + where z.PTP_ID == this.PTP_ID + && y.DetectionRateId == pipeline.DetectionRateId + && y.DetectionType.Contains(pipeline.DetectionType) select x; string rateStr = string.Empty; var rate = Funs.DB.Base_DetectionRate.FirstOrDefault(x => x.DetectionRateId == pipeline.DetectionRateId); @@ -340,7 +344,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { rateStr = rate.DetectionRateValue + "%"; } - this.lab12.Label = "本单位工程检测比例为" + rateStr + "的管线未焊接焊口数"; + this.lab12.Label = "本试压包检测比例为" + rateStr + "的管线未焊接焊口数"; int totalJointNum = totalJoint.Count(); //总焊口 int totalWeldingJointNum = totalJoint.Count(x => x.WeldingDailyId != null); //已焊总焊口 int notCloseBatch = (from x in db.HJGL_Batch_PointBatch @@ -534,9 +538,9 @@ namespace FineUIPro.Web.HJGL.TestPackage string isnoHot = BLL.TestPackageEditService.IsExistNoHotHardItem(this.PTP_ID); if (string.IsNullOrEmpty(isnoHot)) { - string inspectionIsoRate = BLL.TestPackageEditService.InspectionIsoRate(this.PTP_ID); - if (string.IsNullOrEmpty(inspectionIsoRate)) - { + //string inspectionIsoRate = BLL.TestPackageEditService.InspectionIsoRate(this.PTP_ID); + //if (string.IsNullOrEmpty(inspectionIsoRate)) + //{ updateTestPackage.Check1 = drpInstallationSpecification.SelectedValue; updateTestPackage.Check2 = drpPressureTest.SelectedValue; updateTestPackage.Check3 = drpWorkRecord.SelectedValue; @@ -555,12 +559,12 @@ namespace FineUIPro.Web.HJGL.TestPackage this.InitTreeMenu(); this.BindGrid(); ShowNotify("保存成功!", MessageBoxIcon.Success); - } - else - { - Alert.ShowInTop(inspectionIsoRate, MessageBoxIcon.Warning); - return; - } + //} + //else + //{ + // Alert.ShowInTop(inspectionIsoRate, MessageBoxIcon.Warning); + // return; + //} } else { diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 75a77660..41090e46 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -34075,8 +34075,6 @@ namespace Model private EntitySet _ProjectSupervision_CheckTeam; - private EntitySet _PTP_TestPackage; - private EntitySet _QualityAudit_EquipmentQuality; private EntitySet _QualityAudit_GeneralEquipmentQuality; @@ -34283,7 +34281,6 @@ namespace Model this._ProjectData_TeamGroup = new EntitySet(new Action(this.attach_ProjectData_TeamGroup), new Action(this.detach_ProjectData_TeamGroup)); this._ProjectSupervision_CheckNotice = new EntitySet(new Action(this.attach_ProjectSupervision_CheckNotice), new Action(this.detach_ProjectSupervision_CheckNotice)); this._ProjectSupervision_CheckTeam = new EntitySet(new Action(this.attach_ProjectSupervision_CheckTeam), new Action(this.detach_ProjectSupervision_CheckTeam)); - this._PTP_TestPackage = new EntitySet(new Action(this.attach_PTP_TestPackage), new Action(this.detach_PTP_TestPackage)); this._QualityAudit_EquipmentQuality = new EntitySet(new Action(this.attach_QualityAudit_EquipmentQuality), new Action(this.detach_QualityAudit_EquipmentQuality)); this._QualityAudit_GeneralEquipmentQuality = new EntitySet(new Action(this.attach_QualityAudit_GeneralEquipmentQuality), new Action(this.detach_QualityAudit_GeneralEquipmentQuality)); this._QualityAudit_SubUnitQuality = new EntitySet(new Action(this.attach_QualityAudit_SubUnitQuality), new Action(this.detach_QualityAudit_SubUnitQuality)); @@ -36142,19 +36139,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_PTP_TestPackage_Base_Unit", Storage="_PTP_TestPackage", ThisKey="UnitId", OtherKey="UnitId", DeleteRule="NO ACTION")] - public EntitySet PTP_TestPackage - { - get - { - return this._PTP_TestPackage; - } - set - { - this._PTP_TestPackage.Assign(value); - } - } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_QualityAudit_EquipmentQuality_Base_Unit", Storage="_QualityAudit_EquipmentQuality", ThisKey="UnitId", OtherKey="UnitId", DeleteRule="NO ACTION")] public EntitySet QualityAudit_EquipmentQuality { @@ -37722,18 +37706,6 @@ namespace Model entity.Base_Unit = null; } - private void attach_PTP_TestPackage(PTP_TestPackage entity) - { - this.SendPropertyChanging(); - entity.Base_Unit = this; - } - - private void detach_PTP_TestPackage(PTP_TestPackage entity) - { - this.SendPropertyChanging(); - entity.Base_Unit = null; - } - private void attach_QualityAudit_EquipmentQuality(QualityAudit_EquipmentQuality entity) { this.SendPropertyChanging(); @@ -102375,12 +102347,16 @@ namespace Model private System.Nullable _AvgDailyWorkload; - private System.Nullable _CompletedCount; + private System.Nullable _CompletedCount; private System.Nullable _CompletedRate; private System.Nullable _TotalCompletedRate; + private System.Nullable _OnDayCompleteDyne; + + private System.Nullable _NextDayCompleteDyne; + private EntityRef _Base_Project; private EntityRef _WBS_UnitWork; @@ -102419,12 +102395,16 @@ namespace Model partial void OnDaysChanged(); partial void OnAvgDailyWorkloadChanging(System.Nullable value); partial void OnAvgDailyWorkloadChanged(); - partial void OnCompletedCountChanging(System.Nullable value); + partial void OnCompletedCountChanging(System.Nullable value); partial void OnCompletedCountChanged(); partial void OnCompletedRateChanging(System.Nullable value); partial void OnCompletedRateChanged(); partial void OnTotalCompletedRateChanging(System.Nullable value); partial void OnTotalCompletedRateChanged(); + partial void OnOnDayCompleteDyneChanging(System.Nullable value); + partial void OnOnDayCompleteDyneChanged(); + partial void OnNextDayCompleteDyneChanging(System.Nullable value); + partial void OnNextDayCompleteDyneChanged(); #endregion public HJGL_ProductionSchedulingPlan() @@ -102742,8 +102722,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompletedCount", DbType="Int")] - public System.Nullable CompletedCount + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompletedCount", DbType="Decimal(18,2)")] + public System.Nullable CompletedCount { get { @@ -102802,6 +102782,46 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OnDayCompleteDyne", DbType="Decimal(18,2)")] + public System.Nullable OnDayCompleteDyne + { + get + { + return this._OnDayCompleteDyne; + } + set + { + if ((this._OnDayCompleteDyne != value)) + { + this.OnOnDayCompleteDyneChanging(value); + this.SendPropertyChanging(); + this._OnDayCompleteDyne = value; + this.SendPropertyChanged("OnDayCompleteDyne"); + this.OnOnDayCompleteDyneChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NextDayCompleteDyne", DbType="Decimal(18,2)")] + public System.Nullable NextDayCompleteDyne + { + get + { + return this._NextDayCompleteDyne; + } + set + { + if ((this._NextDayCompleteDyne != value)) + { + this.OnNextDayCompleteDyneChanging(value); + this.SendPropertyChanging(); + this._NextDayCompleteDyne = value; + this.SendPropertyChanged("NextDayCompleteDyne"); + this.OnNextDayCompleteDyneChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HJGL_ProductionSchedulingPlan_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -218363,8 +218383,6 @@ namespace Model private EntityRef _Base_Project; - private EntityRef _Base_Unit; - private EntityRef _WBS_UnitWork; #region 可扩展性方法定义 @@ -218444,7 +218462,6 @@ namespace Model this._PTP_ItemEndCheckList = new EntitySet(new Action(this.attach_PTP_ItemEndCheckList), new Action(this.detach_PTP_ItemEndCheckList)); this._PTP_PipelineList = new EntitySet(new Action(this.attach_PTP_PipelineList), new Action(this.detach_PTP_PipelineList)); this._Base_Project = default(EntityRef); - this._Base_Unit = default(EntityRef); this._WBS_UnitWork = default(EntityRef); OnCreated(); } @@ -218469,7 +218486,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(500)")] public string UnitId { get @@ -218480,10 +218497,6 @@ namespace Model { if ((this._UnitId != value)) { - if (this._Base_Unit.HasLoadedOrAssignedValue) - { - throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); - } this.OnUnitIdChanging(value); this.SendPropertyChanging(); this._UnitId = value; @@ -219181,40 +219194,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_PTP_TestPackage_Base_Unit", Storage="_Base_Unit", ThisKey="UnitId", OtherKey="UnitId", IsForeignKey=true)] - public Base_Unit Base_Unit - { - get - { - return this._Base_Unit.Entity; - } - set - { - Base_Unit previousValue = this._Base_Unit.Entity; - if (((previousValue != value) - || (this._Base_Unit.HasLoadedOrAssignedValue == false))) - { - this.SendPropertyChanging(); - if ((previousValue != null)) - { - this._Base_Unit.Entity = null; - previousValue.PTP_TestPackage.Remove(this); - } - this._Base_Unit.Entity = value; - if ((value != null)) - { - value.PTP_TestPackage.Add(this); - this._UnitId = value.UnitId; - } - else - { - this._UnitId = default(string); - } - this.SendPropertyChanged("Base_Unit"); - } - } - } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_PTP_TestPackage_WBS_UnitWork", Storage="_WBS_UnitWork", ThisKey="UnitWorkId", OtherKey="UnitWorkId", IsForeignKey=true)] public WBS_UnitWork WBS_UnitWork {