diff --git a/DataBase/版本日志/SGGLDB_WH_2025-06-26.sql b/DataBase/版本日志/SGGLDB_WH_2025-06-26.sql new file mode 100644 index 00000000..9bd7ae51 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2025-06-26.sql @@ -0,0 +1,12 @@ + + + + + +update HSSE_Hazard_HazardRegister set Risk_Level='һ¹' +where Risk_Level='һ' +update HSSE_Hazard_HazardRegister set Risk_Level='ش¹' +where Risk_Level='ش' +GO + + diff --git a/DataBase/版本日志/SGGLDB_WH_2025-06-27.sql b/DataBase/版本日志/SGGLDB_WH_2025-06-27.sql new file mode 100644 index 00000000..bc9c57c6 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2025-06-27.sql @@ -0,0 +1,40 @@ + + + +--Σ󹤳̲䷽ơҵ + +alter table dbo.Comprehensive_MajorPlanApproval add OperativesNum int +go + + +exec sp_addextendedproperty 'MS_Description', N'ҵԱ', 'SCHEMA', 'dbo', 'TABLE', 'Comprehensive_MajorPlanApproval', + 'COLUMN', 'OperativesNum' +go + +exec sp_addextendedproperty 'MS_Description', N'', 'SCHEMA', 'dbo', 'TABLE', 'Solution_LargerHazard', + 'COLUMN', 'HazardName' +go + + + +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value1 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value2 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value3 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value4 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value5 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value6 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value7 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value8 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value9 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value10 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value11 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value12 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value13 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value14 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value15 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value16 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value17 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value18 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value19 NVARCHAR(1000); +ALTER TABLE Sys_CQMS_DataInTemp ALTER COLUMN Value20 NVARCHAR(1000); + diff --git a/DataBase/版本日志/SGGLDB_WH_2025-07-01.sql b/DataBase/版本日志/SGGLDB_WH_2025-07-01.sql new file mode 100644 index 00000000..f8e0d64d --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2025-07-01.sql @@ -0,0 +1,11 @@ + + +--1ҵܲԱ +IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Person_CompanyBranchPerson' AND COLUMN_NAME = 'SortIndex') +BEGIN + ALTER TABLE Person_CompanyBranchPerson ADD SortIndex int; +END +GO + + + diff --git a/DataBase/版本日志/SGGLDB_WH_2025-07-04.sql b/DataBase/版本日志/SGGLDB_WH_2025-07-04.sql new file mode 100644 index 00000000..0bc09c72 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2025-07-04.sql @@ -0,0 +1,3 @@ + + +ALTER TABLE License_EquipmentSafetyList DROP CONSTRAINT [FK_License_EquipmentSafetyList_ProjectData_WorkArea]; \ No newline at end of file diff --git a/SGGL/BLL/CQMS/Comprehensive/MajorPlanApprovalService.cs b/SGGL/BLL/CQMS/Comprehensive/MajorPlanApprovalService.cs index 26396609..e821fcfa 100644 --- a/SGGL/BLL/CQMS/Comprehensive/MajorPlanApprovalService.cs +++ b/SGGL/BLL/CQMS/Comprehensive/MajorPlanApprovalService.cs @@ -126,6 +126,7 @@ namespace BLL newMajorPlanApproval.HazardType = majorPlanApproval.HazardType; newMajorPlanApproval.ExpectedTime = majorPlanApproval.ExpectedTime; newMajorPlanApproval.TrainPersonNum = majorPlanApproval.TrainPersonNum; + newMajorPlanApproval.OperativesNum = majorPlanApproval.OperativesNum; newMajorPlanApproval.States = majorPlanApproval.States; db.Comprehensive_MajorPlanApproval.InsertOnSubmit(newMajorPlanApproval); db.SubmitChanges(); @@ -169,6 +170,7 @@ namespace BLL newMajorPlanApproval.HazardType = majorPlanApproval.HazardType; newMajorPlanApproval.ExpectedTime = majorPlanApproval.ExpectedTime; newMajorPlanApproval.TrainPersonNum = majorPlanApproval.TrainPersonNum; + newMajorPlanApproval.OperativesNum = majorPlanApproval.OperativesNum; newMajorPlanApproval.States = majorPlanApproval.States; newMajorPlanApproval.IsReview = majorPlanApproval.IsReview; db.SubmitChanges(); @@ -212,6 +214,7 @@ namespace BLL { HazardId = majorPlanApproval.MajorPlanApprovalId, HazardCode = majorPlanApproval.PlanCode, + HazardName = majorPlanApproval.PlanName, HazardType = majorPlanApproval.HazardType, ProjectId = majorPlanApproval.ProjectId, Address = majorPlanApproval.UnitWorkId, @@ -221,6 +224,7 @@ namespace BLL RecardMan = majorPlanApproval.CompileMan, States = majorPlanApproval.States, TrainPersonNum = majorPlanApproval.TrainPersonNum, + OperativesNum = majorPlanApproval.OperativesNum, IsSuperLargerHazard = majorPlanApproval.SchemeType == "超危大工程" ? true : false, }; @@ -238,6 +242,7 @@ namespace BLL if (newLargerHazard != null) { newLargerHazard.HazardCode = majorPlanApproval.PlanCode; + newLargerHazard.HazardName = majorPlanApproval.PlanName; newLargerHazard.HazardType = majorPlanApproval.HazardType; newLargerHazard.ProjectId = majorPlanApproval.ProjectId; newLargerHazard.Address = majorPlanApproval.UnitWorkId; @@ -246,6 +251,7 @@ namespace BLL newLargerHazard.RecordTime = majorPlanApproval.ApprovalDate; newLargerHazard.States = majorPlanApproval.States; newLargerHazard.TrainPersonNum = majorPlanApproval.TrainPersonNum; + newLargerHazard.OperativesNum = majorPlanApproval.OperativesNum; newLargerHazard.IsSuperLargerHazard = majorPlanApproval.SchemeType == "超危大工程" ? true : false; db.SubmitChanges(); } diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 2b816bc6..b30e620e 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -527,7 +527,9 @@ namespace BLL /// /// 项目安全总监岗位Id /// - public static string WorkPost_ProjectHSSEDirector = "5e6e259e-ea0a-4a63-8f52-df4a19a6c9fa"; + public static string WorkPost_ProjectHSSEDirector = "8A7C2CDF-AFB5-4826-9951-343253342DAC"; + //public static string WorkPost_ProjectHSSEDirector = "5e6e259e-ea0a-4a63-8f52-df4a19a6c9fa"; + /// /// HSE经理岗位Id /// diff --git a/SGGL/BLL/HSSE/Solution/LargerHazardService.cs b/SGGL/BLL/HSSE/Solution/LargerHazardService.cs index 9a5b5118..d305c919 100644 --- a/SGGL/BLL/HSSE/Solution/LargerHazardService.cs +++ b/SGGL/BLL/HSSE/Solution/LargerHazardService.cs @@ -132,6 +132,7 @@ namespace BLL Model.Comprehensive_MajorPlanApproval newMajorPlanApproval = new Model.Comprehensive_MajorPlanApproval(); newMajorPlanApproval.MajorPlanApprovalId = largerHazard.HazardId; newMajorPlanApproval.PlanCode = largerHazard.HazardCode; + newMajorPlanApproval.PlanName = largerHazard.HazardName; newMajorPlanApproval.HazardType = largerHazard.HazardType; newMajorPlanApproval.ProjectId = largerHazard.ProjectId; newMajorPlanApproval.UnitWorkId = largerHazard.Address; @@ -141,6 +142,7 @@ namespace BLL newMajorPlanApproval.CompileMan = largerHazard.RecardMan; newMajorPlanApproval.States = largerHazard.States; newMajorPlanApproval.TrainPersonNum = largerHazard.TrainPersonNum; + newMajorPlanApproval.OperativesNum = largerHazard.OperativesNum; newMajorPlanApproval.SchemeType = largerHazard.IsSuperLargerHazard.HasValue ? "超危大工程" : "危大工程"; db.Comprehensive_MajorPlanApproval.InsertOnSubmit(newMajorPlanApproval); db.SubmitChanges(); @@ -155,6 +157,7 @@ namespace BLL { newMajorPlanApproval.MajorPlanApprovalId = largerHazard.HazardId; newMajorPlanApproval.PlanCode = largerHazard.HazardCode; + newMajorPlanApproval.PlanName = largerHazard.HazardName; newMajorPlanApproval.HazardType = largerHazard.HazardType; newMajorPlanApproval.ProjectId = largerHazard.ProjectId; newMajorPlanApproval.UnitWorkId = largerHazard.Address; @@ -163,6 +166,7 @@ namespace BLL newMajorPlanApproval.ApprovalDate = largerHazard.RecordTime; newMajorPlanApproval.States = largerHazard.States; newMajorPlanApproval.TrainPersonNum = largerHazard.TrainPersonNum; + newMajorPlanApproval.OperativesNum = largerHazard.OperativesNum; newMajorPlanApproval.SchemeType = largerHazard.IsSuperLargerHazard.HasValue ? "超危大工程" : "危大工程"; db.SubmitChanges(); } diff --git a/SGGL/BLL/WebService/CNCECHSSEWebService.cs b/SGGL/BLL/WebService/CNCECHSSEWebService.cs index 51c64369..28f662f9 100644 --- a/SGGL/BLL/WebService/CNCECHSSEWebService.cs +++ b/SGGL/BLL/WebService/CNCECHSSEWebService.cs @@ -3274,6 +3274,7 @@ RectifyName = item.RectifyName, SupRectifyId = item.SupRectifyId, IsEndLever = item.IsEndLever, + RectifyType = "0",//安全 IsBuild = true }; newLists.Add(newList); diff --git a/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs b/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs index 4104abfb..01169709 100644 --- a/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs +++ b/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs @@ -688,7 +688,7 @@ namespace BLL EquipmentInspectionNum = inspectionEquipmentList.Count(), EquipmentInspectionQualifiedNum = inspectionEquipmentList.Where(x => x.SamplingResult == "1").Count(), PersonInspectionNum = inspectionPersonList.Count(), - PersonInspectionQualifiedNum = inspectionPersonList.Where(x => x.IsOnSite.HasValue && x.IsOnSite == true).Count(), + PersonInspectionQualifiedNum = inspectionPersonList.Where(x => x.ValidityDate == null || (x.ValidityDate.HasValue && x.ValidityDate >= DateTime.Now)).Count(), MachineInspectionNum = inspectionMachineList.Count(), MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckOK.HasValue && x.IsCheckOK == true).Count(), InspectionMachineNum = inspectionMachineEquipmentList.Count(), @@ -761,7 +761,7 @@ namespace BLL EquipmentInspectionNum = inspectionEquipmentList.Count(x => x.ProjectId == projectid), EquipmentInspectionQualifiedNum = inspectionEquipmentList.Where(x => x.SamplingResult == "1" && x.ProjectId == projectid).Count(), PersonInspectionNum = inspectionPersonList.Count(x => x.ProjectId == projectid), - PersonInspectionQualifiedNum = inspectionPersonList.Where(x => x.IsOnSite.HasValue && x.IsOnSite == true && x.ProjectId == projectid).Count(), + PersonInspectionQualifiedNum = inspectionPersonList.Where(x => (x.ValidityDate == null || (x.ValidityDate.HasValue && x.ValidityDate >= DateTime.Now)) && x.ProjectId == projectid).Count(), MachineInspectionNum = inspectionMachineList.Count(x => x.ProjectId == projectid), MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckOK.HasValue && x.IsCheckOK == true && x.ProjectId == projectid).Count(), MaterialInspectionNum = inspectionEquipmentList.Count(x => x.ProjectId == projectid), @@ -1167,13 +1167,13 @@ namespace BLL } /// - /// 获取人员报验 + /// 获取人员报验(总数取在场人员) /// /// public static List GetComprehensive_InspectionPerson() { var result = (from x in Funs.DB.Comprehensive_InspectionPerson - where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime + where BeUnderConstructionList.Contains(x.ProjectId) && x.IsOnSite.HasValue && x.IsOnSite == true && x.CompileDate > Const.DtmarkTime select x).ToList(); return result; } diff --git a/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs b/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs index a20f8b5c..53a4253f 100644 --- a/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs +++ b/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs @@ -1,6 +1,9 @@ -using FineUIPro; +using Aspose.Words.Lists; +using EmitMapper; +using FineUIPro; using Model; using Newtonsoft.Json; +using NPOI.SS.Formula.Functions; using System; using System.Collections; using System.Collections.Generic; @@ -249,6 +252,67 @@ namespace BLL return responeData; } + + public static HJGLData StatisticalData() + { + var data = new HJGLData(); + var thisUnitId = string.Empty; + var thisUnit = CommonService.GetIsThisUnit(); + if (thisUnit != null) thisUnitId = thisUnit.UnitId; + var baseUnit = UnitService.GetUnitByUnitId(thisUnitId); + var ProjectData = (from x in Funs.DB.Project_HJGLData_HJGL + where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date + select x).ToList(); + Project_HJGLData_HJGLService.StatisticalAllProjectData(); + Project_HJGLData_DefectService.StatisticalAllProjectData(); + + var table = new HJGLData_HJGL + { + UnitId = thisUnitId, + CollCropCode = baseUnit.CollCropCode, + UnitName = baseUnit.UnitName, + ReportDate = DateTime.Now.Date, + WelderNum = ProjectData.Sum(x => x.WelderNum), + TotalDineNum = ProjectData.Sum(x => x.TotalDineNum), + CompleteDineNum = ProjectData.Sum(x => x.CompleteDineNum), + TotalFilmNum = ProjectData.Sum(x => x.TotalFilmNum), + OKFilmNum = ProjectData.Sum(x => x.OKFilmNum), + CreateMan = Const.sysglyId, + CreateDate = DateTime.Now + }; + if (IsReportByToday()) + { + table.Id = GetTodayData().Id; + table.State = Const.CNCEC_State_1; + UpdateHJGLData_HJGL(table); + } + else + { + table.Id = SQLHelper.GetNewID(); + table.State = Const.CNCEC_State_0; + + AddHJGLData_HJGL(table); + } + + var item = new HJGLDataItem(); + item.CollCropCode = table.CollCropCode; + item.CompleteDineNum = table.CompleteDineNum; + item.Id = table.Id; + item.OKFilmNum = table.OKFilmNum; + item.ReportDate = table.ReportDate.Value.ToShortDateString(); + item.TotalDineNum = table.TotalDineNum; + item.TotalFilmNum = table.TotalFilmNum; + item.UnitId = table.UnitId; + item.WelderNum = table.WelderNum; + item.HJGLDataDefectItems = Project_HJGLData_DefectService.getTodayProject_HJGLData_Defect(); + var hJGLDataItems = new List(); + hJGLDataItems.Add(item); + + data.HJGLDataItems = hJGLDataItems; + return data; + } + + public static async Task StatisticalDataAsync() { var data = new HJGLData(); @@ -256,8 +320,10 @@ namespace BLL var thisUnit = CommonService.GetIsThisUnit(); if (thisUnit != null) thisUnitId = thisUnit.UnitId; var baseUnit = UnitService.GetUnitByUnitId(thisUnitId); + Project_HJGLData_DefectService.StatisticalAllProjectData(); - // 并行执行异步方法 + + //// 并行执行异步方法 var welderNumTask = HJGLData_HJGLService.GetWelderNumAsync(); //获取焊工总数 var dineInfoListTask = HJGLData_HJGLService.GetDineInfoAsync(); //获达因数信息 var chCheckItemListTask = HJGLData_HJGLService.GetCHCheckItemAsync(); //获取焊接检查信息 @@ -289,7 +355,6 @@ namespace BLL CreateMan = Const.sysglyId, CreateDate = DateTime.Now }; - Project_HJGLData_HJGLService.DeleteProject_HJGLData_HJGLByDate(DateTime.Now.Date); // 预先对 dineInfoList 和 chCheckItemList 按 ProjectId 进行分组 var dineInfoDict = dineInfoList @@ -344,6 +409,154 @@ namespace BLL } + if (IsReportByToday()) + { + table.Id = GetTodayData().Id; + table.State = Const.CNCEC_State_1; + UpdateHJGLData_HJGL(table); + } + else + { + table.Id = SQLHelper.GetNewID(); + table.State = Const.CNCEC_State_0; + + AddHJGLData_HJGL(table); + } + var mapper = ObjectMapperManager.DefaultInstance.GetMapper(); + var item = mapper.Map(table); + // 手动处理特殊字段 + item.ReportDate = table.ReportDate.Value.ToShortDateString(); + item.HJGLDataDefectItems = Project_HJGLData_DefectService.getTodayProject_HJGLData_Defect(); + var hJGLDataItems = new List(); + hJGLDataItems.Add(item); + + data.HJGLDataItems = hJGLDataItems; + return data; + + //var item = new HJGLDataItem(); + //item.CollCropCode = table.CollCropCode; + //item.CompleteDineNum = table.CompleteDineNum; + //item.Id = table.Id; + //item.OKFilmNum = table.OKFilmNum; + //item.ReportDate = table.ReportDate.Value.ToShortDateString(); + //item.TotalDineNum = table.TotalDineNum; + //item.TotalFilmNum = table.TotalFilmNum; + //item.UnitId = table.UnitId; + //item.WelderNum = table.WelderNum; + //item.HJGLDataDefectItems = Project_HJGLData_DefectService.getTodayProject_HJGLData_Defect(); + //var hJGLDataItems = new List(); + //hJGLDataItems.Add(item); + + //data.HJGLDataItems = hJGLDataItems; + //return data; + } + + public static async Task StatisticalDataAsyncold() + { + var data = new HJGLData(); + var thisUnitId = string.Empty; + var thisUnit = CommonService.GetIsThisUnit(); + if (thisUnit != null) thisUnitId = thisUnit.UnitId; + var baseUnit = UnitService.GetUnitByUnitId(thisUnitId); + + Project_HJGLData_HJGLService.StatisticalAllProjectData(); + Project_HJGLData_DefectService.StatisticalAllProjectData(); + // 并行执行异步方法 + var projectHJGLDataListTask = HJGLData_HJGLService.GetProjectHJGLDataAsync(); //获取焊接检查信息 + + //// 并行执行异步方法 + //var welderNumTask = HJGLData_HJGLService.GetWelderNumAsync(); //获取焊工总数 + //var dineInfoListTask = HJGLData_HJGLService.GetDineInfoAsync(); //获达因数信息 + var chCheckItemListTask = HJGLData_HJGLService.GetCHCheckItemAsync(); //获取焊接检查信息 + + // 等待所有异步方法执行完成 + await Task.WhenAll( + projectHJGLDataListTask, + //welderNumTask, + //dineInfoListTask, + chCheckItemListTask + ); + + // 统一获取异步方法的返回值 + var projectHJGLDataList = await projectHJGLDataListTask; + //var welderNum = await welderNumTask; + //var dineInfoList = await dineInfoListTask; + var chCheckItemList = await chCheckItemListTask; + + + var table = new HJGLData_HJGL + { + UnitId = thisUnitId, + CollCropCode = baseUnit.CollCropCode, + UnitName = baseUnit.UnitName, + ReportDate = DateTime.Now.Date, + WelderNum = projectHJGLDataList.Sum(x => x.WelderNum), + TotalDineNum = projectHJGLDataList.Sum(x => x.TotalDineNum), + CompleteDineNum = projectHJGLDataList.Sum(x => x.CompleteDineNum), + //TotalFilmNum = projectHJGLDataList.Sum(x => x.TotalFilmNum), + //OKFilmNum = projectHJGLDataList.Sum(x => x.OKFilmNum), + //WelderNum = welderNum.Count(), + //TotalDineNum = Convert.ToInt32(dineInfoList.Sum(x => x.Size)), + //CompleteDineNum = Convert.ToInt32(dineInfoList.Sum(x => x.DoneDin)), + TotalFilmNum = Convert.ToInt32(chCheckItemList.Sum(x => x.CHT_TotalFilm)), + OKFilmNum = Convert.ToInt32(chCheckItemList.Sum(x => x.CHT_PassFilm)), + CreateMan = Const.sysglyId, + CreateDate = DateTime.Now + }; + //Project_HJGLData_HJGLService.DeleteProject_HJGLData_HJGLByDate(DateTime.Now.Date); + //// 预先对 dineInfoList 和 chCheckItemList 按 ProjectId 进行分组 + //var dineInfoDict = dineInfoList + // .Where(x => BeUnderConstructionList.Contains(x.ProjectId)) + // .GroupBy(x => x.ProjectId) + // .ToDictionary(g => g.Key, g => new + // { + // TotalDineNum = g.Sum(x => x.Size), + // CompleteDineNum = g.Sum(x => x.DoneDin) + // }); + + //var chCheckItemDict = chCheckItemList + // .Where(x => BeUnderConstructionList.Contains(x.ProjectId)) + // .GroupBy(x => x.ProjectId) + // .ToDictionary(g => g.Key, g => new + // { + // TotalFilmNum = g.Sum(x => x.CHT_TotalFilm), + // OKFilmNum = g.Sum(x => x.CHT_PassFilm) + // }); + + //foreach (var projectid in BeUnderConstructionList) + //{ + // // 获取焊工数量 + // int welderCount = welderNum.Count(x => x.ProjectId == projectid); + + // // 获取达因信息 + // var dineInfo = dineInfoDict.TryGetValue(projectid, out var dineData) + // ? dineData + // : new { TotalDineNum = (double?)0, CompleteDineNum = (double?)0 }; + + // // 获取拍片信息 + // var chCheckItem = chCheckItemDict.TryGetValue(projectid, out var checkData) + // ? checkData + // : new { TotalFilmNum = (int?)0, OKFilmNum = (int?)0 }; + + // var projectCqmsData = new Project_HJGLData_HJGL() + // { + // Id = SQLHelper.GetNewID(), + // ProjectId = projectid, + // UnitId = thisUnitId, + // CollCropCode = baseUnit.CollCropCode, + // UnitName = baseUnit.UnitName, + // ReportDate = DateTime.Now.Date, + // WelderNum = welderCount, + // TotalDineNum = Convert.ToInt32(dineInfo.TotalDineNum), + // CompleteDineNum = Convert.ToInt32(dineInfo.CompleteDineNum), + // TotalFilmNum = chCheckItem.TotalFilmNum, + // OKFilmNum = chCheckItem.OKFilmNum, + // }; + + // Project_HJGLData_HJGLService.AddProject_HJGLData_HJGL(projectCqmsData); + //} + + if (IsReportByToday()) { table.Id = GetTodayData().Id; @@ -416,9 +629,13 @@ namespace BLL ProjectId = x.ProjectId, UnitId = x.WED_Unit, WEDCode = x.WED_Code, + WEDWorkCode = x.WED_WorkCode, WEDName = x.WED_Name //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), - }).ToList(); + }) + .GroupBy(p => p.WEDWorkCode) + .Select(g => g.First()) + .ToList(); return result; } /// @@ -434,42 +651,106 @@ namespace BLL /// 获取总达因数和完成达因数 /// /// - public static IEnumerable GetDineInfo() + public static List GetDineInfo() { - var result = (from x in Funs.DB.HJGL_FL_TotalQuantity - where BeUnderConstructionList.Contains(x.ProjectId) - group x by x.ProjectId into g - select new Model.WeldDineOutput() - { - ProjectId = g.Key, - Size = g.Sum(x => Convert.ToDouble(x.TotalWeldQuantity)), - DoneDin = g.Sum(x => Convert.ToDouble(x.TotalCompleted)) - }); + var result = new List(); + var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity + where BeUnderConstructionList.Contains(x.ProjectId) + select x; + var projectIds = getD1.Select(x => x.ProjectId).Distinct(); + foreach (var pro in projectIds) + { + double pTotalWeldQuantity = 0; + double pTotalCompleted = 0; + var proD1 = getD1.Where(x => x.ProjectId == pro); + foreach (var item in getD1) + { + var dAll = !string.IsNullOrWhiteSpace(item.TotalWeldQuantity) ? Convert.ToDouble(item.TotalWeldQuantity) : 0; + var dCompleted = !string.IsNullOrWhiteSpace(item.TotalCompleted) ? Convert.ToDouble(item.TotalCompleted) : 0; + pTotalWeldQuantity += dAll; + pTotalCompleted += dCompleted; + } + result.Add(new WeldDineOutput + { + ProjectId = pro, + Size = pTotalWeldQuantity, + DoneDin = pTotalCompleted + }); + } + + var differenceProjectIds = BeUnderConstructionList.Except(projectIds).ToList(); + foreach (var pro in differenceProjectIds) + { + double pTotalWeldQuantity = 0; + double pTotalCompleted = 0; + + var getD2 = (from x in Funs.DB.HJGL_FL_Data + where x.ProjectId == pro + orderby x.CompileDate descending + select x).FirstOrDefault(); + if (getD2 != null) + { + pTotalWeldQuantity = !string.IsNullOrWhiteSpace(getD2.TotalWeldQuantity) ? Convert.ToDouble(getD2.TotalWeldQuantity) : 0; + pTotalCompleted = !string.IsNullOrWhiteSpace(getD2.TotalCompleted) ? Convert.ToDouble(getD2.TotalCompleted) : 0; + } + + result.Add(new WeldDineOutput + { + ProjectId = pro, + Size = pTotalWeldQuantity, + DoneDin = pTotalCompleted + }); + } + return result; } - public static async Task> GetDineInfoAsync() + + /// + /// 获取总达因数和完成达因数 + /// + /// + public static async Task> GetDineInfoAsync() { return await Task.Run(GetDineInfo); } + /// /// 获取焊接检查信息 /// /// public static List GetCHCheckItem() { - var result = (from x in Funs.DB.CH_CheckItem - join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID - where BeUnderConstructionList.Contains(y.ProjectId) - select new Model.CHCheckItemOutput() - { - Id = x.CHT_CheckItemID, - ProjectId = y.ProjectId, - UnitId = y.UnitId, - CHT_TotalFilm = x.CHT_TotalFilm, - CHT_PassFilm = x.CHT_PassFilm - //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), - }).ToList(); - return result; + List list = new List(); + var ndtLists = (from x in Funs.DB.ProcessControl_NondestructiveTest_New where BeUnderConstructionList.Contains(x.ProjectId) select x).ToList(); + + if (ndtLists.Count() > 0) + { + //取每个项目、单位、专业最新的一条数据 + var datalist = ndtLists.GroupBy(r => new { r.ProjectId, r.UnitId, r.ProfessionalName }).Select(g => g.OrderByDescending(r => r.CreateDate).First()).ToList(); + foreach (var project in BeUnderConstructionList) + { + decimal a = 0, b = 0; + var projectDataList = datalist.Where(x => x.ProjectId == project); + foreach (var item in projectDataList) + { + if (item.TotalQuantity.HasValue) + { + a += Math.Floor(item.TotalQuantity.Value * Funs.GetNewDecimalOrZero(item.TotalRate) / 100); + b += item.TotalQuantity.Value; + } + } + list.Add(new CHCheckItemOutput + { + Id = project, + ProjectId = project, + //UnitId = y.UnitId, + CHT_TotalFilm = (int)Math.Round(b), + CHT_PassFilm = (int)Math.Round(a) + }); + } + } + + return list; } /// /// 获取焊接检查信息(异步) @@ -479,5 +760,25 @@ namespace BLL { return await Task.Run(GetCHCheckItem); } + + /// + /// 获取项目焊接信息 + /// + /// + public static List GetProjectHJGLData() + { + var result = (from x in Funs.DB.Project_HJGLData_HJGL + where BeUnderConstructionList.Contains(x.ProjectId) && x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date + select x).ToList(); + return result; + } + /// + /// 获取项目焊接信息(异步) + /// + /// + public static async Task> GetProjectHJGLDataAsync() + { + return await Task.Run(GetProjectHJGLData); + } } } \ No newline at end of file diff --git a/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs b/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs index 4fe70e10..6c631021 100644 --- a/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs +++ b/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs @@ -544,116 +544,6 @@ namespace BLL return result; } - public static HSSEData StatisticalData() - { - var thisUnitId = string.Empty; - var thisUnit = CommonService.GetIsThisUnit(); - if (thisUnit != null) thisUnitId = thisUnit.UnitId; - var baseUnit = UnitService.GetUnitByUnitId(thisUnitId); - Project_HSSEData_HiddenDangerDetailService.StatisticalAllProjectData(); - - var totalEnergyConsumption = ChemicalReportItemService.GetLatstTimeTotalEnergyConsumption(); - var incomeComprehensiveEnergyConsumption = - ChemicalReportItemService.GetLatstTimeIncomeComprehensiveEnergyConsumption(); - var newWaterConsumption = ChemicalReportItemService.GetLatstTimeNewWaterConsumption(); - - var table = new HSSEData_HSSE - { - UnitId = thisUnitId, - CollCropCode = baseUnit.CollCropCode, - UnitName = baseUnit.UnitName, - ReportDate = DateTime.Now.Date, - BeUnderConstructionNum = GetBeUnderConstruction().Count, - ShutdownNum = GetShutdown().Count, - JoinConstructionPersonNum = GetJoinConstructionPerson().Count, - MajorProjectsUnderConstructionNum = GetMajorProjectsUnderConstruction().Count, - TotalWorkingHour = GetTotalWorkingHour(), - LostWorkingHour = GetLostWorkingHour(), - SafeWorkingHour = GetSafeWorkingHour(), - SafeTrainNum = GetSafeTrain().Sum(x => x.TrainPersonNum) + GetBoShengSafeTrain().Sum(x => x.TrainPersonNum), - SpecialTrainNum = GetSpecialTrain().Sum(x => x.TrainPersonNum), - SpecialOperationTrainNum = GetSpecialOperationTrain().Sum(x => x.TrainPersonNum), - EnvironmentalTrainNum = 0, - TotalEnergyConsumption = totalEnergyConsumption, - IncomeComprehensiveEnergyConsumption = incomeComprehensiveEnergyConsumption, - NewWaterConsumption = newWaterConsumption, - HeadOfficeInspectorGeneralNum = GetHeadOfficeInspectorGeneral().Count, - HeadOfficeFullTimeNum = GetHeadOfficeFullTime().Count, - BranchInspectorGeneralNum = GetBranchInspectorGeneral().Count, - BranchFullTimeNum = GetBranchFullTime().Count, - ProjectInspectorGeneralNum = GetProjectInspectorGeneral().Count, - ProjectFullTimeNum = GetProjectFullTime().Count, - ProjectSafetyMonitorNum = GetProjectSafetyMonitor().Count, - SafetyInjectionEngineer = GetSafetyInjectionEngineer().Count, - CertificateANum = GetCertificateA().Count, - CertificateBNum = GetCertificateB().Count, - CertificateCNum = GetCertificateC().Count, - SafetyCommitteeMeetingNum = GetSafetyCommitteeMeeting().Count, - EnterpriseTopicsMeetingNum = GetEnterpriseTopicsMeeting().Count, - ProjectSafetyLeadingGroupMeetingNum = GetProjectSafetyLeadingGroupMeeting().Count, - ProjectSafetyMeetingNum = GetProjectSafetyMeeting().Count, - CompanyLeadShiftCheckNum = GetCompanyLeadShiftCheck().Count, - CompanyComprehensiveCheckNum = GetCompanyComprehensiveCheck().Count, - CompanySpecialCheckNum = GetCompanySpecialCheck().Count, - ProjectLeadShiftCheckNum = GetProjectLeadShiftCheck().Count, - ProjectSpecialCheckNum = GetProjectSpecialCheck().Count, - ProjectMajorCheckNum = GetProjectMajorCheck().Count, - NearMissNum = GetNearMiss().Count, - RecordableEventNum = GetRecordableEvent().Count, - GeneralAccidentNum = GetGeneralAccident().Count, - MajorAccidentNum = GetMajorAccident().Count, - SeriousAccidentNum = GetSeriousAccident().Count, - SpecialSeriousAccidentNum = GetSpecialSeriousAccident().Count, - CompanyComprehensivePlanNum = GetCompanyComprehensivePlan().Count, - CompanySpecialPlanNum = GetCompanySpecialPlan().Count, - CompanyOnSiteDisposalPlan = GetCompanyOnSiteDisposalPlan().Count, - CompanyDrillNum = GetCompanyDrill().Count, - ProjectComprehensivePlanNum = GetProjectComprehensivePlan().Count, - ProjectSpecialPlanNum = GetProjectSpecialPlan().Count, - ProjectOnSiteDisposalPlan = GetProjectOnSiteDisposalPlan().Count, - ProjectDrillNum = GetProjectDrill().Count, - CostExtract = Convert.ToInt32(GetCostExtract().Sum(x => x.SUMCost)), - CostUse = Convert.ToInt32(GetCostUse().Sum(x => x.SUMCost)), - UseEquipmentNum = GetUseEquipment().Count, - SpecialEquipmentNum = GetSpecialEquipment().Count, - LicensesNum = GetLicenses().Count, - LicensesCloseNum = GetLicensesClose().Count, - GeneralClosedNum = GetGeneralHiddenRectificationOutputs().Sum(x => x.RecNum), - GeneralNotClosedNum = GetGeneralHiddenRectificationOutputs().Sum(x => x.NoRecNum), - MajorClosedNum = GetMajorHiddenRectificationOutputs().Sum(x => x.RecNum), - MajorNotClosedNum = GetMajorHiddenRectificationOutputs().Sum(x => x.NoRecNum), - GeneralRiskNum = GetSecurityRiskOutputs().Sum(x => x.GeneralRiskNum), - LowRiskNum = GetSecurityRiskOutputs().Sum(x => x.LowRiskNum), - MediumRiskNum = GetSecurityRiskOutputs().Sum(x => x.MediumRiskNum), - HighRiskNum = GetSecurityRiskOutputs().Sum(x => x.HighRiskNum), - CompletedNum = GetLargeEngineeringOutputs().Sum(x => x.CompletedNum), - TrainPersonNum = GetLargeEngineeringOutputs().Sum(x => x.TrainPersonNum), - ConstructionNum = GetLargeEngineeringOutputs().Sum(x => x.ConstructionNum), - FinishedNum = GetLargeEngineeringOutputs().Sum(x => x.FinishedNum), - SuperCompletedNum = GetLargeEngineeringOutputs().Sum(x => x.SuperCompletedNum), - SuperTrainPersonNum = GetLargeEngineeringOutputs().Sum(x => x.SuperTrainPersonNum), - SuperConstructionNum = GetLargeEngineeringOutputs().Sum(x => x.SuperConstructionNum), - SuperFinishedNum = GetLargeEngineeringOutputs().Sum(x => x.SuperFinishedNum), - CreateMan = Const.sysglyId, - CreateDate = DateTime.Now - }; - if (IsReportByToday()) - { - table.Id = GetTodayData().Id; - table.State = Const.CNCEC_State_1; - UpdateHSSEData_HSSE(table); - } - else - { - table.Id = SQLHelper.GetNewID(); - table.State = Const.CNCEC_State_0; - AddHSSEData_HSSE(table); - } - - var data = GetItemByHSSEData_HSSE(table, Project_HSSEData_HiddenDangerDetailService.GetTodayModel()); - return data; - } - /// /// 统计数据(异步) /// @@ -687,6 +577,7 @@ namespace BLL var lostWorkingHourTask = HSSEData_HSSEService.GetLostWorkingHourAsync(); var safeWorkingHourTask = HSSEData_HSSEService.GetSafeWorkingHourAsync(); var safeTrainTask = HSSEData_HSSEService.GetSafeTrainAsync(); + var safeTrainBoShengTask = HSSEData_HSSEService.GetBoShengSafeTrainAsync(); var specialTrainTask = HSSEData_HSSEService.GetSpecialTrainAsync(); var specialOperationTrainTask = HSSEData_HSSEService.GetSpecialOperationTrainAsync(); var hseTechnicalTask = HSSEData_HSSEService.GetHseTechnicalAsync(); @@ -754,6 +645,7 @@ namespace BLL lostWorkingHourTask, safeWorkingHourTask, safeTrainTask, + safeTrainBoShengTask, specialTrainTask, specialOperationTrainTask, hseTechnicalTask, headOfficeInspectorGeneralTask, @@ -821,6 +713,7 @@ namespace BLL var lostWorkingHour = await lostWorkingHourTask; var safeWorkingHour = await safeWorkingHourTask; var safeTrainList = await safeTrainTask; + var safeTrainBoShengList = await safeTrainBoShengTask; var specialTrainList = await specialTrainTask; var specialOperationTrainList = await specialOperationTrainTask; var hseTechnicalList = await hseTechnicalTask; @@ -890,7 +783,7 @@ namespace BLL TotalWorkingHour = totalWorkingHour, LostWorkingHour = lostWorkingHour, SafeWorkingHour = safeWorkingHour, - SafeTrainNum = safeTrainList.Sum(x => x.TrainPersonNum), + SafeTrainNum = safeTrainList.Sum(x => x.TrainPersonNum) + safeTrainBoShengList.Sum(x => x.TrainPersonNum), SpecialTrainNum = specialTrainList.Sum(x => x.TrainPersonNum), SpecialOperationTrainNum = specialOperationTrainList.Sum(x => x.TrainPersonNum), HseTechnicalNum = hseTechnicalList.Count(), @@ -1037,7 +930,7 @@ namespace BLL TotalWorkingHour = 0,//工时数据取自集团报表,项目无法提取 LostWorkingHour = 0, SafeWorkingHour = 0, - SafeTrainNum = safeTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum), + SafeTrainNum = safeTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum) + safeTrainBoShengList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum), SpecialTrainNum = specialTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum), SpecialOperationTrainNum = specialOperationTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum), HseTechnicalNum = hseTechnicalList.Count(x => x.ProjectId == projectid), @@ -1799,17 +1692,22 @@ namespace BLL /// public static List GetQualityPersonNum() { - var result = (from x in Funs.DB.QualityAudit_PersonQuality - join p in Funs.DB.SitePerson_Person on x.PersonId equals p.PersonId into pGroup - from p in pGroup.DefaultIfEmpty() + var result = (from p in Funs.DB.SitePerson_Person join bp in Funs.DB.Base_Project on p.ProjectId equals bp.ProjectId into bpGroup from bp in bpGroup.DefaultIfEmpty() join u in Funs.DB.Base_Unit on p.UnitId equals u.UnitId into uGroup from u in uGroup.DefaultIfEmpty() - join y in Funs.DB.QualityAudit_PersonQuality on x.PersonId equals y.PersonId + join q in Funs.DB.QualityAudit_PersonQuality on p.PersonId equals q.PersonId into qGroup + from q in qGroup.DefaultIfEmpty() join m in Funs.DB.Base_WorkPost on p.WorkPostId equals m.WorkPostId into mGroup from m in mGroup.DefaultIfEmpty() - where BeUnderConstructionList.Contains(p.ProjectId) && p.IsUsed == true && m.PostType == Const.PostType_2 && (x.LimitDate == null || x.LimitDate < DateTime.Now) + join su in Funs.DB.Sys_User on q.CompileMan equals su.UserId into suGroup + from su in suGroup.DefaultIfEmpty() + join bc in Funs.DB.Base_Certificate on q.CertificateId equals bc.CertificateId into bcGroup + from bc in bcGroup.DefaultIfEmpty() + join su1 in Funs.DB.Sys_User on q.AuditorId equals su1.UserId into su1Group + from su1 in su1Group.DefaultIfEmpty() + where BeUnderConstructionList.Contains(p.ProjectId) && m.PostType == Const.PostType_2 && p.IsUsed == true select new Model.OfSafetySupervisorsOutput { ProjectId = p.ProjectId, @@ -1824,6 +1722,7 @@ namespace BLL }).ToList(); return result; } + /// /// 获取在岗特种作业人员数量(异步) /// @@ -3213,7 +3112,7 @@ namespace BLL var result = (from x in Funs.DB.Bo_Sheng_Train join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup from p in pGroup.DefaultIfEmpty() - where BeUnderConstructionList.Contains(p.ProjectId) && (x.TrainType == "入场(厂)培训" || x.TrainType == "入厂(场)级培训") + where BeUnderConstructionList.Contains(p.ProjectId) && (x.TrainType.Contains("入场") || x.TrainType.Contains("入厂")) && (x.DeleteTag == "False" || x.DeleteTag == null) && x.TrainStartDate > Const.DtmarkTime select new Model.EduTrainOutput() { @@ -3703,6 +3602,61 @@ namespace BLL /// public static List GetUseEquipment() { + var query = (from item in Funs.DB.QualityAudit_EquipmentQuality + //join eq in Funs.DB.InApproveManager_EquipmentIn on item.EquipmentInId equals eq.EquipmentInId into eqGroup + //from eq in eqGroup.DefaultIfEmpty() + //join spe in Funs.DB.Base_SpecialEquipment on item.SpecialEquipmentId equals spe.SpecialEquipmentId into speGroup + //from spe in speGroup.DefaultIfEmpty() + join p in Funs.DB.Base_Project on item.ProjectId equals p.ProjectId into pGroup + from p in pGroup.DefaultIfEmpty() + join unit in Funs.DB.Base_Unit on item.UnitId equals unit.UnitId into unitGroup + from unit in unitGroup.DefaultIfEmpty() + where BeUnderConstructionList.Contains(item.ProjectId) + select new ConstructionEquipmentOutput + { + Id = item.EquipmentQualityId, + ProjectId = item.ProjectId, + //ProjectCode = p.ProjectCode, + ProjectName = p.ProjectName, + //UnitId = item.UnitId, + UnitName = unit.UnitName, + SpecialEquipmentName = item.EquipmentQualityName, + //SizeModel = item.SizeModel, + CertificateNum = item.CertificateCode, + CompileDate = item.CompileDate, + EQType = "特种设备" + }) + .Union( + from item in Funs.DB.QualityAudit_GeneralEquipmentQuality + join eq in Funs.DB.Base_SpecialEquipment on item.GeneralEquipmentQualityId equals eq.SpecialEquipmentId into eqGroup + from eq in eqGroup.DefaultIfEmpty() + //join spe in Funs.DB.Base_SpecialEquipment on item.SpecialEquipmentId equals spe.SpecialEquipmentId into speGroup + //from spe in speGroup.DefaultIfEmpty() + join p in Funs.DB.Base_Project on item.ProjectId equals p.ProjectId into pGroup + from p in pGroup.DefaultIfEmpty() + join unit in Funs.DB.Base_Unit on item.UnitId equals unit.UnitId into unitGroup + from unit in unitGroup.DefaultIfEmpty() + where BeUnderConstructionList.Contains(item.ProjectId) + select new ConstructionEquipmentOutput + { + Id = item.GeneralEquipmentQualityId, + ProjectId = item.ProjectId, + // ProjectCode = p.ProjectCode, + ProjectName = p.ProjectName, + // UnitId = item.UnitId, + UnitName = unit.UnitName, + // SpecialEquipmentId = item.SpecialEquipmentId, + SpecialEquipmentName = eq.SpecialEquipmentName, + //SizeModel = eq.SizeModel, + //OwnerCheck = item.OwnerCheck, + CertificateNum = item.GeneralEquipmentQualityCode, + //IsUsed = item.IsUsed, + CompileDate = item.CompileDate, + EQType = "一般设备" + } + ); + + /* 通用版业务逻辑【弃用】 var query = (from item in Funs.DB.InApproveManager_EquipmentInItem join eq in Funs.DB.InApproveManager_EquipmentIn on item.EquipmentInId equals eq.EquipmentInId into eqGroup from eq in eqGroup.DefaultIfEmpty() @@ -3759,6 +3713,7 @@ namespace BLL EQType = "一般设备" } ); + */ return query.ToList(); } @@ -3775,6 +3730,31 @@ namespace BLL /// public static List GetSpecialEquipment() { + var query = (from item in Funs.DB.QualityAudit_EquipmentQuality + //join eq in Funs.DB.InApproveManager_EquipmentIn on item.EquipmentInId equals eq.EquipmentInId into eqGroup + //from eq in eqGroup.DefaultIfEmpty() + //join spe in Funs.DB.Base_SpecialEquipment on item.SpecialEquipmentId equals spe.SpecialEquipmentId into speGroup + //from spe in speGroup.DefaultIfEmpty() + join p in Funs.DB.Base_Project on item.ProjectId equals p.ProjectId into pGroup + from p in pGroup.DefaultIfEmpty() + join unit in Funs.DB.Base_Unit on item.UnitId equals unit.UnitId into unitGroup + from unit in unitGroup.DefaultIfEmpty() + where BeUnderConstructionList.Contains(item.ProjectId) + select new ConstructionEquipmentOutput + { + Id = item.EquipmentQualityId, + ProjectId = item.ProjectId, + //ProjectCode = p.ProjectCode, + ProjectName = p.ProjectName, + //UnitId = item.UnitId, + UnitName = unit.UnitName, + SpecialEquipmentName = item.EquipmentQualityName, + SizeModel = item.SizeModel, + CertificateNum = item.CertificateCode, + CompileDate = item.CompileDate, + EQType = "特种设备" + }); + /* 通用版业务逻辑【弃用】 var query = (from item in Funs.DB.InApproveManager_EquipmentInItem join eq in Funs.DB.InApproveManager_EquipmentIn on item.EquipmentInId equals eq.EquipmentInId into eqGroup @@ -3804,6 +3784,7 @@ namespace BLL CompileDate = eq.CompileDate, EQType = "特种设备" }); + */ return query.ToList(); } public static async Task> GetSpecialEquipmentAsync() @@ -3895,7 +3876,7 @@ namespace BLL var query = (from x in Funs.DB.Base_Project join y in Funs.DB.HSSE_Hazard_HazardRegister on x.ProjectId equals y.ProjectId into yGroup from y in yGroup.DefaultIfEmpty() - where BeUnderConstructionList.Contains(x.ProjectId) && y.ProblemTypes == "1" && y.Risk_Level == "一般" && y.CheckTime > Const.DtmarkTime + where BeUnderConstructionList.Contains(x.ProjectId) && y.ProblemTypes == "1" && y.Risk_Level == "一般事故隐患" && y.CheckTime > Const.DtmarkTime group y by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg select new HiddenRectificationOutput { @@ -3930,7 +3911,7 @@ namespace BLL var query = (from x in Funs.DB.Base_Project join y in Funs.DB.HSSE_Hazard_HazardRegister on x.ProjectId equals y.ProjectId into yGroup from y in yGroup.DefaultIfEmpty() - where BeUnderConstructionList.Contains(x.ProjectId) && y.ProblemTypes == "1" && y.Risk_Level == "重大" && y.CheckTime > Const.DtmarkTime + where BeUnderConstructionList.Contains(x.ProjectId) && y.ProblemTypes == "1" && y.Risk_Level == "重大事故隐患" && y.CheckTime > Const.DtmarkTime group y by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg select new HiddenRectificationOutput { diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs index b856553a..bd4e7ba4 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs @@ -86,30 +86,29 @@ namespace BLL { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { + var table = new Project_HJGLData_Defect + { + Id = newtable.Id, + ProjectId = newtable.ProjectId, + UnitId = newtable.UnitId, + CollCropCode = newtable.CollCropCode, + UnitName = newtable.UnitName, + ReportDate = newtable.ReportDate, + DefectName = newtable.DefectName, + DefectNum = newtable.DefectNum + }; + db.Project_HJGLData_Defect.InsertOnSubmit(table); + db.SubmitChanges(); } - - var table = new Project_HJGLData_Defect - { - Id = newtable.Id, - ProjectId = newtable.ProjectId, - UnitId = newtable.UnitId, - CollCropCode = newtable.CollCropCode, - UnitName = newtable.UnitName, - ReportDate = newtable.ReportDate, - DefectName = newtable.DefectName, - DefectNum = newtable.DefectNum - }; - db.Project_HJGLData_Defect.InsertOnSubmit(table); - db.SubmitChanges(); } public static void AddBulkProject_HJGLData_Defect(List newtables) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { + db.Project_HJGLData_Defect.InsertAllOnSubmit(newtables); + db.SubmitChanges(); } - db.Project_HJGLData_Defect.InsertAllOnSubmit(newtables); - db.SubmitChanges(); } public static void UpdateProject_HJGLData_Defect(Project_HJGLData_Defect newtable) @@ -260,7 +259,8 @@ namespace BLL { var db = Funs.DB; - var projectids = ProjectService.GetProjectWorkList().Select(x => x.ProjectId).ToList(); + var projectids = HJGLData_HJGLService.BeUnderConstructionList; + //var projectids = ProjectService.GetProjectWorkList().Select(x => x.ProjectId).ToList(); var thisUnitId = string.Empty; var thisUnit = CommonService.GetIsThisUnit(); if (thisUnit != null) thisUnitId = thisUnit.UnitId; diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs index cebc18d3..8dd8f688 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs @@ -281,10 +281,11 @@ namespace BLL } if (hJGLDateType == HJGLDateType.NumberOfFilms || hJGLDateType == HJGLDateType.All) { - table.TotalFilmNum = GetTotalFilmNum(projectid); - table.OKFilmNum = GetOKFilmNum(projectid); - - + //table.TotalFilmNum = GetTotalFilmNum(projectid); + //table.OKFilmNum = GetOKFilmNum(projectid); + var filmObj = GetFilm(projectid); + table.TotalFilmNum = filmObj.CHT_TotalFilm; + table.OKFilmNum = filmObj.CHT_PassFilm; } if (hJGLDateType == HJGLDateType.DefectAnalysis || hJGLDateType == HJGLDateType.All) { @@ -310,7 +311,10 @@ namespace BLL { int result = (from x in Funs.DB.BS_Welder where x.ProjectId == projectid && x.WED_IfOnGuard == true - select x).Count(); + select x) + .GroupBy(p => p.WED_WorkCode) + .Select(g => g.First()) + .Count(); return result; } /// @@ -320,6 +324,27 @@ namespace BLL public static int GetTotalDineNum(string projectid) { int result = 0; + var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity + where x.ProjectId == projectid + select x; + if (getD1.Count() > 0) + { + foreach (var item in getD1) + { + result += Funs.GetNewIntOrZero(item.TotalWeldQuantity.Split('.')[0]); + } + } + else + { + var getD2 = (from x in Funs.DB.HJGL_FL_Data + where x.ProjectId == projectid + orderby x.CompileDate descending + select x).FirstOrDefault(); + if (getD2 != null) + { + result = Funs.GetNewIntOrZero(getD2.TotalWeldQuantity.Split('.')[0]); + } + } return result; } /// @@ -329,18 +354,71 @@ namespace BLL public static int GetCompleteDineNum(string projectid) { int result = 0; + var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity + where x.ProjectId == projectid + select x; + if (getD1.Count() > 0) + { + foreach (var item in getD1) + { + result += Funs.GetNewIntOrZero(item.TotalCompleted.Split('.')[0]); + } + } + else + { + var getD2 = (from x in Funs.DB.HJGL_FL_Data + where x.ProjectId == projectid + orderby x.CompileDate descending + select x).FirstOrDefault(); + if (getD2 != null) + { + result = Funs.GetNewIntOrZero(getD2.TotalCompleted.Split('.')[0]); + } + } return result; } + + /// + /// 获取焊接总片数信息数据 + /// + /// + /// + public static CHCheckItemOutput GetFilm(string projectid) + { + var result = new CHCheckItemOutput(); + var ndtLists = (from x in Funs.DB.ProcessControl_NondestructiveTest_New where x.ProjectId == projectid select x).ToList(); + + if (ndtLists.Count() > 0) + { + //取每个项目、单位、专业最新的一条数据 + var datalist = ndtLists.GroupBy(r => new { r.UnitId, r.ProfessionalName }).Select(g => g.OrderByDescending(r => r.CreateDate).First()).ToList(); + decimal a = 0, b = 0; + foreach (var item in datalist) + { + if (item.TotalQuantity.HasValue) + { + a += Math.Floor(item.TotalQuantity.Value * Funs.GetNewDecimalOrZero(item.TotalRate) / 100); + b += item.TotalQuantity.Value; + } + } + result.CHT_TotalFilm = (int)Math.Round(b); + result.CHT_PassFilm = (int)Math.Round(a); + } + + return result; + } + /// /// 获取总片数 /// /// public static int GetTotalFilmNum(string projectid) { - int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem - join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID - where y.ProjectId == projectid - select x.CHT_TotalFilm).ToList().Sum()); + int result = Convert.ToInt32((from x in Funs.DB.ProcessControl_NondestructiveTest_New + where x.ProjectId == projectid && x.ProfessionalName == "工艺管道" + orderby x.CreateDate descending + select x.TotalQuantity + ).FirstOrDefault()); return result; } /// @@ -349,10 +427,15 @@ namespace BLL /// public static int GetOKFilmNum(string projectid) { - int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem - join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID - where y.ProjectId == projectid - select x.CHT_PassFilm).ToList().Sum()); + int result = 0; + var ndt = (from x in db.ProcessControl_NondestructiveTest_New where x.ProjectId == projectid && x.ProfessionalName == "工艺管道" orderby x.CreateDate descending select x).FirstOrDefault(); + if (ndt != null) + { + if (ndt.TotalQuantity.HasValue) + { + result = Convert.ToInt32(ndt.TotalQuantity.Value * Funs.GetNewDecimalOrZero(ndt.TotalRate) / 100); + } + } return result; } diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs index 84f231d3..4be6d4c5 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HSSEService.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using FineUIPro; +using Microsoft.SqlServer.Dts.Runtime; using Model; using Newtonsoft.Json; @@ -455,7 +456,7 @@ namespace BLL if (hSseDateType == HSSEDateType.EducationAndTraining || hSseDateType == HSSEDateType.All) { - table.SafeTrainNum = GetSafeTrainNum(projectid); + table.SafeTrainNum = GetSafeTrainNum(projectid) + GetBoShengSafeTrain(projectid); table.SpecialTrainNum = GetSpecialTrainNum(projectid); table.SpecialOperationTrainNum = GetSpecialOperationTrainNum(projectid); } @@ -748,6 +749,21 @@ namespace BLL return result; } + /// + /// 获取三级安全教育培训数——博晟培训 + /// + /// + public static int GetBoShengSafeTrain(string projectid) + { + var result = (from x in Funs.DB.Bo_Sheng_Train + join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup + from p in pGroup.DefaultIfEmpty() + where x.ProjectId == projectid && (x.TrainType.Contains("入场") || x.TrainType.Contains("入厂")) + && (x.DeleteTag == "False" || x.DeleteTag == null) && x.TrainStartDate > Const.DtmarkTime + select x.PersonCount ?? 0).ToList().Sum(); + return result; + } + /// /// 获取专项培训数 /// @@ -945,7 +961,7 @@ namespace BLL var result = (from x in Funs.DB.SitePerson_Person join y in Funs.DB.QualityAudit_PersonQuality on x.PersonId equals y.PersonId join m in Funs.DB.Base_WorkPost on x.WorkPostId equals m.WorkPostId - where x.ProjectId == projectid && m.PostType == Const.PostType_2 && x.IsUsed == true && (y.LimitDate == null || y.LimitDate < DateTime.Now) + where x.ProjectId == projectid && m.PostType == Const.PostType_2 && x.IsUsed == true select x).Count(); return result; } @@ -1318,15 +1334,21 @@ namespace BLL /// public static int GetUseEquipmentNum(string projectid) { - var result = (from x in Funs.DB.InApproveManager_EquipmentInItem - join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId - where y.ProjectId == projectid && x.IsUsed == true + var result = (from x in Funs.DB.QualityAudit_EquipmentQuality + where x.ProjectId == projectid select x).Count() + - (from x in Funs.DB.InApproveManager_GeneralEquipmentInItem - join y in Funs.DB.InApproveManager_GeneralEquipmentIn on x.GeneralEquipmentInId equals y - .GeneralEquipmentInId - where y.ProjectId == projectid && x.IsUsed == true + (from x in Funs.DB.QualityAudit_GeneralEquipmentQuality + where x.ProjectId == projectid select x).Count(); + //var result = (from x in Funs.DB.InApproveManager_EquipmentInItem + // join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId + // where y.ProjectId == projectid && x.IsUsed == true + // select x).Count() + + // (from x in Funs.DB.InApproveManager_GeneralEquipmentInItem + // join y in Funs.DB.InApproveManager_GeneralEquipmentIn on x.GeneralEquipmentInId equals y + // .GeneralEquipmentInId + // where y.ProjectId == projectid && x.IsUsed == true + // select x).Count(); return result; } @@ -1336,10 +1358,13 @@ namespace BLL /// public static int GetSpecialEquipmentNum(string projectid) { - var result = (from x in Funs.DB.InApproveManager_EquipmentInItem - join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId - where y.ProjectId == projectid && x.IsUsed == true + var result = (from x in Funs.DB.QualityAudit_EquipmentQuality + where x.ProjectId == projectid select x).Count(); + //var result = (from x in Funs.DB.InApproveManager_EquipmentInItem + // join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId + // where y.ProjectId == projectid && x.IsUsed == true + // select x).Count(); return result; } @@ -1375,7 +1400,7 @@ namespace BLL public static int GetGeneralClosedNum(string projectid) { var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister - where x.ProjectId == projectid && x.Risk_Level == "一般" && x.States == "3" && + where x.ProjectId == projectid && x.Risk_Level == "一般事故隐患" && x.States == "3" && x.CheckTime > Const.DtmarkTime select x).Count(); return result; @@ -1388,7 +1413,7 @@ namespace BLL public static int GetGeneralNotClosedNum(string projectid) { var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister - where x.ProjectId == projectid && x.Risk_Level == "一般" && x.States != "3" && x.States != "-1" && + where x.ProjectId == projectid && x.Risk_Level == "一般事故隐患" && x.States != "3" && x.States != "-1" && x.CheckTime > Const.DtmarkTime select x).Count(); return result; @@ -1401,7 +1426,7 @@ namespace BLL public static int GetMajorClosedNum(string projectid) { var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister - where x.ProjectId == projectid && x.Risk_Level == "重大" && x.States == "3" && + where x.ProjectId == projectid && x.Risk_Level == "重大事故隐患" && x.States == "3" && x.CheckTime > Const.DtmarkTime select x).Count(); return result; @@ -1414,7 +1439,7 @@ namespace BLL public static int GetMajorNotClosedNum(string projectid) { var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister - where x.ProjectId == projectid && x.Risk_Level == "重大" && x.States != "3" && x.States != "-1" && + where x.ProjectId == projectid && x.Risk_Level == "重大事故隐患" && x.States != "3" && x.States != "-1" && x.CheckTime > Const.DtmarkTime select x).Count(); return result; @@ -1504,7 +1529,7 @@ namespace BLL { var result = (from x in Funs.DB.Solution_LargerHazard where x.ProjectId == projectid && x.IsSuperLargerHazard == false && x.RecordTime > Const.DtmarkTime - select x.OperativesNum).ToList().Sum(x => x.Value); + select x).ToList().Sum(x => x.OperativesNum ?? 0); return result; } @@ -1567,7 +1592,7 @@ namespace BLL { var result = (from x in Funs.DB.Solution_LargerHazard - where x.ProjectId == projectid && x.IsSuperLargerHazard == true && x.RecordTime > Const.DtmarkTime + where x.ProjectId == projectid && x.IsSuperLargerHazard == true && x.OperativesNum != null && x.RecordTime > Const.DtmarkTime select x.OperativesNum).ToList().Sum(x => x.Value); return result; } @@ -2091,6 +2116,7 @@ namespace BLL Address = x.Address, Descriptions = x.Descriptions, TrainPersonNum = x.TrainPersonNum, + OperativesNum = x.OperativesNum, RecordTime = x.RecordTime, ExpectedTime = x.ExpectedTime, States = x.States, diff --git a/SGGL/BLL/ZHGL/Person/CompanyBranchPersonService.cs b/SGGL/BLL/ZHGL/Person/CompanyBranchPersonService.cs index 06b326b2..04e7f1a4 100644 --- a/SGGL/BLL/ZHGL/Person/CompanyBranchPersonService.cs +++ b/SGGL/BLL/ZHGL/Person/CompanyBranchPersonService.cs @@ -53,6 +53,7 @@ namespace BLL Address = CompanyBranchPerson.Address, IsOnJob = CompanyBranchPerson.IsOnJob, Remark = CompanyBranchPerson.Remark, + SortIndex = CompanyBranchPerson.SortIndex, }; db.Person_CompanyBranchPerson.InsertOnSubmit(newCompanyBranchPerson); db.SubmitChanges(); @@ -77,6 +78,7 @@ namespace BLL newCompanyBranchPerson.Address = CompanyBranchPerson.Address; newCompanyBranchPerson.IsOnJob = CompanyBranchPerson.IsOnJob; newCompanyBranchPerson.Remark = CompanyBranchPerson.Remark; + newCompanyBranchPerson.SortIndex = CompanyBranchPerson.SortIndex; db.SubmitChanges(); } } diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx index c492cb0b..f93100e1 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx @@ -94,7 +94,7 @@ - diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx index 495d92cd..8e87b6a8 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx @@ -10,13 +10,16 @@ .f-grid-row.Red { background-color: red; } + .f-grid-row.Yellow { background-color: yellow; } + .LabelColor { color: Red; font-size: small; } + .f-grid-row.Gray { background-color: gray; } @@ -32,7 +35,7 @@ runat="server" BoxFlex="1" DataKeyNames="InspectionPersonId" AllowCellEditing="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="InspectionPersonId" AllowSorting="true" SortField="RemarkCode" SortDirection="ASC" OnSort="Grid1_Sort" OnRowCommand="Grid1_RowCommand" - AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" OnRowDataBound="Grid1_RowDataBound" + AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" OnRowDataBound="Grid1_RowDataBound" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true" OnPreRowDataBound="Grid1_PreRowDataBound"> @@ -41,6 +44,12 @@ + + + + + @@ -81,6 +90,9 @@ + + @@ -96,17 +108,17 @@ - <%-- + <%-- --%> - <%----%> - + <%----%> + + Text='<%# BLL.AttachFileService.GetBtnFileUrl(Eval("InspectionPersonId")) %>' ToolTip="附件查看"> - diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx.cs index 9beab73e..e0f3d1fd 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx.cs @@ -35,7 +35,7 @@ namespace FineUIPro.Web.Comprehensive string strSql = @"select InspectionPersonId, InspectionPersonCode, PersonName, Status, CertificateNumber, QualifiedProjectCode, ValidityDate, ApprovalTime, DepartureTime, AttachUrl,CompileMan, CompileDate, - IsOnSite, UnitWorkId,U.UnitName,CN.ProfessionalName ,P.PostName,C.RemarkCode + IsOnSite, (case C.IsOnSite when '1' then '是' else '否' end) as IsOnSiteStr,UnitWorkId,U.UnitName,CN.ProfessionalName ,P.PostName,C.RemarkCode from Comprehensive_InspectionPerson C left join Base_Unit U on C.UnitId=U.UnitId left join Base_CNProfessional CN on C.CNProfessionalId=CN.CNProfessionalId @@ -58,6 +58,13 @@ namespace FineUIPro.Web.Comprehensive strSql += " AND PersonName like @PersonName"; listStr.Add(new SqlParameter("@PersonName", "%" + this.stxtPersonName.Text.Trim() + "%")); } + int OnSite = int.Parse(this.rblOnSite.SelectedValue); + if (OnSite > -1) + { + strSql += " AND C.IsOnSite=@IsOnSite"; + listStr.Add(new SqlParameter("@IsOnSite", OnSite)); + } + SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); Grid1.RecordCount = tb.Rows.Count; @@ -113,6 +120,15 @@ namespace FineUIPro.Web.Comprehensive { BindGrid(); } + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } #endregion #region 关闭弹出窗口 @@ -423,7 +439,7 @@ namespace FineUIPro.Web.Comprehensive var font = workbook.CreateFont(); font.FontHeightInPoints = 11; cellStyle.SetFont(font); - + // 第二步:创建新数据行 NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0); NPOI.SS.UserModel.IRow row = sheet.GetRow(0); diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx.designer.cs index 5afd6594..d8461e14 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPerson.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.Comprehensive { - - - public partial class InspectionPerson { - +namespace FineUIPro.Web.Comprehensive +{ + + + public partial class InspectionPerson + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// ToolSearch 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar ToolSearch; - + /// /// sdrpUnitId 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList sdrpUnitId; - + /// /// sdrpPost 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList sdrpPost; - + /// /// stxtPersonName 控件。 /// @@ -83,7 +85,16 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox stxtPersonName; - + + /// + /// rblOnSite 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rblOnSite; + /// /// btnSearch 控件。 /// @@ -92,7 +103,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnSearch; - + /// /// btnNew 控件。 /// @@ -101,7 +112,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnNew; - + /// /// btnImport 控件。 /// @@ -110,7 +121,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnImport; - + /// /// btnOut 控件。 /// @@ -119,7 +130,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnOut; - + /// /// lblPageIndex 控件。 /// @@ -128,7 +139,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lblPageIndex; - + /// /// Label2 控件。 /// @@ -137,7 +148,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label2; - + /// /// lbtnFileUrl 控件。 /// @@ -146,7 +157,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.LinkButton lbtnFileUrl; - + /// /// ToolbarText1 控件。 /// @@ -155,7 +166,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -164,7 +175,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// Window1 控件。 /// @@ -173,7 +184,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// Window2 控件。 /// @@ -182,7 +193,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window2; - + /// /// Window3 控件。 /// @@ -191,7 +202,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window3; - + /// /// WindowAtt 控件。 /// @@ -200,7 +211,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowAtt; - + /// /// Menu1 控件。 /// @@ -209,7 +220,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuModify 控件。 /// @@ -218,7 +229,7 @@ namespace FineUIPro.Web.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuModify; - + /// /// btnMenuDel 控件。 /// diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonDataInNew.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonDataInNew.aspx.cs index 1297a1f5..4286e5d1 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonDataInNew.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonDataInNew.aspx.cs @@ -578,20 +578,40 @@ namespace FineUIPro.Web.CQMS.Comprehensive if (tempData.Value6.Trim() == "焊工") { - Model.BS_Welder welder = new Model.BS_Welder(); - welder.WED_Unit = Ins.UnitId; - welder.WED_Name = Ins.PersonName; - welder.WED_Code = tempData.Value2.Trim(); - welder.LimitDate = Ins.ValidityDate; - welder.LeaveDate = Ins.DepartureTime; // Convert.ToDateTime(this.txtDepartureTime.Text.ToString()); - welder.PostDate = Ins.ApprovalTime;// Convert.ToDateTime(this.txtApprovalTime.Text.ToString()); - welder.WED_WorkCode = Ins.CertificateNumber;// this.txtCertificateNumber.Text.Trim(); - welder.WED_Class = Ins.QualifiedProjectCode;// this.txtQualifiedProjectCode.Text.Trim(); - welder.WED_IfOnGuard = Ins.IsOnSite; - welder.WED_Remark = Ins.Remark; - welder.ProjectId = this.CurrUser.LoginProjectId; - // 焊工部分 - BLL.PersonManageService.AddBSWelder(welder); + var welder = PersonManageService.GetBSWelderByProjectIdUnitIdAndWED_Code(this.CurrUser.LoginProjectId, Ins.UnitId, tempData.Value2.Trim()); + if (welder == null) + { + welder = new Model.BS_Welder(); + welder.WED_Unit = Ins.UnitId; + welder.WED_Name = Ins.PersonName; + welder.WED_Code = tempData.Value2.Trim(); + welder.LimitDate = Ins.ValidityDate; + welder.LeaveDate = Ins.DepartureTime; // Convert.ToDateTime(this.txtDepartureTime.Text.ToString()); + welder.PostDate = Ins.ApprovalTime;// Convert.ToDateTime(this.txtApprovalTime.Text.ToString()); + welder.WED_WorkCode = Ins.CertificateNumber;// this.txtCertificateNumber.Text.Trim(); + welder.WED_Class = Ins.QualifiedProjectCode;// this.txtQualifiedProjectCode.Text.Trim(); + welder.WED_IfOnGuard = Ins.IsOnSite; + welder.WED_Remark = Ins.Remark; + welder.ProjectId = this.CurrUser.LoginProjectId; + // 焊工部分 + BLL.PersonManageService.AddBSWelder(welder); + } + else + { + welder.WED_Unit = Ins.UnitId; + welder.WED_Name = Ins.PersonName; + welder.WED_Code = tempData.Value2.Trim(); + welder.LimitDate = Ins.ValidityDate; + welder.LeaveDate = Ins.DepartureTime; // Convert.ToDateTime(this.txtDepartureTime.Text.ToString()); + welder.PostDate = Ins.ApprovalTime;// Convert.ToDateTime(this.txtApprovalTime.Text.ToString()); + welder.WED_WorkCode = Ins.CertificateNumber;// this.txtCertificateNumber.Text.Trim(); + welder.WED_Class = Ins.QualifiedProjectCode;// this.txtQualifiedProjectCode.Text.Trim(); + welder.WED_IfOnGuard = Ins.IsOnSite; + welder.WED_Remark = Ins.Remark; + welder.ProjectId = this.CurrUser.LoginProjectId; + // 焊工部分 + BLL.PersonManageService.UpdateBSWelder(welder); + } } } BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByDataInTempID(tempData.TempId); diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalEdit.aspx index ed5db21e..291c146b 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalEdit.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalEdit.aspx @@ -81,6 +81,7 @@ + diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalEdit.aspx.cs index 1b81ff77..c2b1d52a 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalEdit.aspx.cs @@ -89,6 +89,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive this.AttachUrl6.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../../", getUrl(this.MajorPlanApprovalId + "_6")); this.txtTrainPersonNum.Text = majorPlanApproval.TrainPersonNum.HasValue ? majorPlanApproval.TrainPersonNum.ToString() : ""; + this.txtOperativesNum.Text = majorPlanApproval.OperativesNum.HasValue ? majorPlanApproval.OperativesNum.ToString() : ""; this.txtAuditMan.Text = majorPlanApproval.AuditMan; this.txtApprovalMan.Text = majorPlanApproval.ApprovalMan; //this.txtImplementationDeviation.Text = majorPlanApproval.ImplementationDeviation; @@ -155,7 +156,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive majorPlanApproval.States = this.drpStates.SelectedValue; } majorPlanApproval.TrainPersonNum = Funs.GetNewInt(this.txtTrainPersonNum.Text.Trim()); - + majorPlanApproval.OperativesNum = Funs.GetNewInt(this.txtOperativesNum.Text.Trim()); if (this.drpSchemeType.SelectedValue == "超危大工程" && this.drpStates.SelectedValue != "1") { diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalEdit.aspx.designer.cs index 6b5fd5f8..b25bd795 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalEdit.aspx.designer.cs @@ -194,6 +194,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// protected global::FineUIPro.DropDownList drpStates; + /// + /// txtOperativesNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOperativesNum; + /// /// Panel2 控件。 /// diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx index e23e30eb..b00434d0 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx @@ -13,7 +13,7 @@ - diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPointFile.aspx b/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPointFile.aspx index a2e6d87d..51a61a1e 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPointFile.aspx +++ b/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPointFile.aspx @@ -4,7 +4,7 @@ - + 现场控制点裁剪