diff --git a/SGGL/BLL/HSSE/Environmental/EnvironmentalCheckService.cs b/SGGL/BLL/HSSE/Environmental/EnvironmentalCheckService.cs index 77107202..fee9c321 100644 --- a/SGGL/BLL/HSSE/Environmental/EnvironmentalCheckService.cs +++ b/SGGL/BLL/HSSE/Environmental/EnvironmentalCheckService.cs @@ -12,6 +12,7 @@ namespace BLL /// public static class EnvironmentalCheckService { + #region 推送环境监测数据 /// @@ -20,8 +21,8 @@ namespace BLL /// public static ReturnData PushEnvironmentalCheckData() { - var db1 = Funs.DB; - var items = (from x in db1.EnvironmentalCheck where x.IsPushed == false select x).ToList(); + var db = Funs.DB; + var items = (from x in db.EnvironmentalCheck where x.IsPushed == false select x).ToList(); Model.ReturnData responeData = new Model.ReturnData(); if (items.Count() > 0) { @@ -34,11 +35,11 @@ namespace BLL {//推送成功后,修改数据状态 foreach (var item in items) { - Model.EnvironmentalCheck envModel = db1.EnvironmentalCheck.FirstOrDefault(e => e.Id == item.Id); + Model.EnvironmentalCheck envModel = db.EnvironmentalCheck.FirstOrDefault(e => e.Id == item.Id); if (envModel != null) { envModel.IsPushed = true; - db1.SubmitChanges(); + db.SubmitChanges(); } } } diff --git a/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs b/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs index 2d552a87..aeecb654 100644 --- a/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs +++ b/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs @@ -1,4 +1,6 @@ -using FineUIPro; +using BLL; +using FineUIPro; +using Model; using Model; using Newtonsoft.Json; using NPOI.POIFS.Crypt.Dsig; @@ -6,12 +8,15 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; +using System.Web.UI.WebControls; namespace BLL { public static class CQMSDataService { public static SGGLDB db = Funs.DB; + public static List BeUnderConstructionList = ProjectService.GetProjectWorkList().Select(x => x.ProjectId).ToList(); #region 获取列表 @@ -49,50 +54,52 @@ namespace BLL // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); return from x in q - select new - { - x.Id, - x.UnitId, - x.CollCropCode, - x.UnitName, - x.ReportDate, - x.TrainPersonNum, - x.TechnicalDisclosePersonNum, - x.UseNum, - x.OKNum, - x.CompanyPersonNum, - x.BranchPersonNum, - x.ProjectPersonNum, - x.ProblemNum, - x.ProblemCompletedNum, - x.ProblemNotCompletedNum, - x.SNum, - x.ANum, - x.BNum, - x.CNum, - x.KeyProcessNum, - x.KeyProcessOKNum, - x.SpecialProcessNum, - x.SpecialProcessOKNum, - x.ConcealedWorksNum, - x.ConcealedWorksOKNum, - x.UnitProjectOnesNum, - x.UnitProjectOnesOKNum, - x.MaterialInRecheckNum, - x.MaterialInRecheckOKNum, - x.SingleProjectNum, - x.UnitProjectNum, - x.SubProjectNum, - x.SubdivisionalWorksNum, - x.InspectionLotNum, - x.State, - x.CreateDate, - x.CreateMan - }; + select new + { + x.Id, + x.UnitId, + x.CollCropCode, + x.UnitName, + x.ReportDate, + x.TrainPersonNum, + x.TechnicalDisclosePersonNum, + x.UseNum, + x.OKNum, + x.CompanyPersonNum, + x.BranchPersonNum, + x.ProjectPersonNum, + x.ProblemNum, + x.ProblemCompletedNum, + x.ProblemNotCompletedNum, + x.SNum, + x.ANum, + x.BNum, + x.CNum, + x.KeyProcessNum, + x.KeyProcessOKNum, + x.SpecialProcessNum, + x.SpecialProcessOKNum, + x.ConcealedWorksNum, + x.ConcealedWorksOKNum, + x.UnitProjectOnesNum, + x.UnitProjectOnesOKNum, + x.MaterialInRecheckNum, + x.MaterialInRecheckOKNum, + x.SingleProjectNum, + x.UnitProjectNum, + x.SubProjectNum, + x.SubdivisionalWorksNum, + x.InspectionLotNum, + x.State, + x.CreateDate, + x.CreateMan + }; } #endregion 获取列表 + #region 新增、编辑、删除 + public static void AddCQMSData_CQMS(CQMSData_CQMS newtable) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) @@ -133,6 +140,25 @@ namespace BLL SubProjectNum = newtable.SubProjectNum, SubdivisionalWorksNum = newtable.SubdivisionalWorksNum, InspectionLotNum = newtable.InspectionLotNum, + EquipmentInspectionNum = newtable.EquipmentInspectionNum, + EquipmentInspectionQualifiedNum = newtable.EquipmentInspectionQualifiedNum, + MachineInspectionNum = newtable.MachineInspectionNum, + MachineInspectionQualifiedNum = newtable.MachineInspectionQualifiedNum, + PersonInspectionNum = newtable.PersonInspectionNum, + PersonInspectionQualifiedNum = newtable.PersonInspectionQualifiedNum, + MaterialInspectionNum = newtable.MaterialInspectionNum, + MaterialInspectionQualifiedNum = newtable.MaterialInspectionQualifiedNum, + ConstructSolutionNum = newtable.ConstructSolutionNum, + ConstructSolutionProjectApproveNum = newtable.ConstructSolutionProjectApproveNum, + ConstructSolutionUnitApproveNum = newtable.ConstructSolutionUnitApproveNum, + SpecialEquipmentQualityAssuranceSystemNum = newtable.SpecialEquipmentQualityAssuranceSystemNum, + DesignDetailsNum = newtable.DesignDetailsNum, + UnitProjectAcceptNum = newtable.UnitProjectAcceptNum, + UnitProjectAcceptOKNum = newtable.UnitProjectAcceptOKNum, + SubProjectAcceptNum = newtable.SubProjectAcceptNum, + SubProjectAcceptOKNum = newtable.SubProjectAcceptOKNum, + SubdivisionalWorksAcceptNum = newtable.SubdivisionalWorksAcceptNum, + SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum, State = newtable.State, CreateDate = newtable.CreateDate, CreateMan = newtable.CreateMan @@ -141,6 +167,7 @@ namespace BLL db.SubmitChanges(); } } + public static void UpdateCQMSData_CQMS(CQMSData_CQMS newtable) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) @@ -182,6 +209,25 @@ namespace BLL table.SubProjectNum = newtable.SubProjectNum; table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum; table.InspectionLotNum = newtable.InspectionLotNum; + table.EquipmentInspectionNum = newtable.EquipmentInspectionNum; + table.EquipmentInspectionQualifiedNum = newtable.EquipmentInspectionQualifiedNum; + table.MachineInspectionNum = newtable.MachineInspectionNum; + table.MachineInspectionQualifiedNum = newtable.MachineInspectionQualifiedNum; + table.PersonInspectionNum = newtable.PersonInspectionNum; + table.PersonInspectionQualifiedNum = newtable.PersonInspectionQualifiedNum; + table.MaterialInspectionNum = newtable.MaterialInspectionNum; + table.MaterialInspectionQualifiedNum = newtable.MaterialInspectionQualifiedNum; + table.ConstructSolutionNum = newtable.ConstructSolutionNum; + table.ConstructSolutionProjectApproveNum = newtable.ConstructSolutionProjectApproveNum; + table.ConstructSolutionUnitApproveNum = newtable.ConstructSolutionUnitApproveNum; + table.SpecialEquipmentQualityAssuranceSystemNum = newtable.SpecialEquipmentQualityAssuranceSystemNum; + table.DesignDetailsNum = newtable.DesignDetailsNum; + table.UnitProjectAcceptNum = newtable.UnitProjectAcceptNum; + table.UnitProjectAcceptOKNum = newtable.UnitProjectAcceptOKNum; + table.SubProjectAcceptNum = newtable.SubProjectAcceptNum; + table.SubProjectAcceptOKNum = newtable.SubProjectAcceptOKNum; + table.SubdivisionalWorksAcceptNum = newtable.SubdivisionalWorksAcceptNum; + table.SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum; table.State = newtable.State; table.CreateMan = newtable.CreateMan; table.CreateDate = newtable.CreateDate; @@ -203,6 +249,8 @@ namespace BLL } } + #endregion + public static CQMSData_CQMS GetCQMSData_CQMSById(string id) { var db = Funs.DB; @@ -255,6 +303,25 @@ namespace BLL item.SubProjectNum = model.SubProjectNum; item.SubdivisionalWorksNum = model.SubdivisionalWorksNum; item.InspectionLotNum = model.InspectionLotNum; + item.EquipmentInspectionNum = model.EquipmentInspectionNum; + item.EquipmentInspectionQualifiedNum = model.EquipmentInspectionQualifiedNum; + item.MachineInspectionNum = model.MachineInspectionNum; + item.MachineInspectionQualifiedNum = model.MachineInspectionQualifiedNum; + item.PersonInspectionNum = model.PersonInspectionNum; + item.PersonInspectionQualifiedNum = model.PersonInspectionQualifiedNum; + item.MaterialInspectionNum = model.MaterialInspectionNum; + item.MaterialInspectionQualifiedNum = model.MaterialInspectionQualifiedNum; + item.ConstructSolutionNum = model.ConstructSolutionNum; + item.ConstructSolutionProjectApproveNum = model.ConstructSolutionProjectApproveNum; + item.ConstructSolutionUnitApproveNum = model.ConstructSolutionUnitApproveNum; + item.SpecialEquipmentQualityAssuranceSystemNum = model.SpecialEquipmentQualityAssuranceSystemNum; + item.DesignDetailsNum = model.DesignDetailsNum; + item.UnitProjectAcceptNum = model.UnitProjectAcceptNum; + item.UnitProjectAcceptOKNum = model.UnitProjectAcceptOKNum; + item.SubProjectAcceptNum = model.SubProjectAcceptNum; + item.SubProjectAcceptOKNum = model.SubProjectAcceptOKNum; + item.SubdivisionalWorksAcceptNum = model.SubdivisionalWorksAcceptNum; + item.SubdivisionalWorksAcceptOKNum = model.SubdivisionalWorksAcceptOKNum; } var cqmsDataItems = new List(); @@ -263,34 +330,29 @@ namespace BLL return data; } - public static CQMSData GetTodayCQMSData_CQMS() + public static async Task GetTodayCQMSData_CQMS() { - // var q = GetTodayData(); - var data = new CQMSData(); - data = StatisticalData(); + // var data = new CQMSData(); + // data = StatisticalData(); - //if (q != null && q.State == Const.CNCEC_State_S) - //{ - // // data = GetDataByCQMSData_CQMS(q); - // data = StatisticalData(); - //} - //else - //{ - // data = StatisticalData(); - //} + // return data; + + var modelTask = StatisitcalDataAsync(); + var model = await modelTask; + CQMSData data = model; return data; } public static CQMSData_CQMS GetTodayData() { var q = (from x in Funs.DB.CQMSData_CQMS - where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date - select x).FirstOrDefault(); + where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date + select x).FirstOrDefault(); return q; } public static CQMSData_CQMS GetSubUnitCqmsDataByDate(string Unitid, DateTime? reportdate) { - + var result = new Model.CQMSData_CQMS(); if (reportdate == null) { @@ -300,7 +362,7 @@ namespace BLL var base_Unit = UnitService.GetUnitByUnitId(Unitid); var ProjectData = (from x in Funs.DB.Project_CQMSData_CQMS where x.ReportDate == reportdate && projectlist.Select(e => e.ProjectId).Contains(x.ProjectId) - select x).ToList(); + select x).ToList(); result = new CQMSData_CQMS { UnitId = Unitid, @@ -355,8 +417,8 @@ namespace BLL { var result = false; var q = (from x in Funs.DB.CQMSData_CQMS - where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date - select x).ToList(); + where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date + select x).ToList(); if (q.Count > 0) result = true; return result; } @@ -369,8 +431,8 @@ namespace BLL { var result = false; var q = (from x in Funs.DB.CQMSData_CQMS - where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date - select x).ToList(); + where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date + select x).ToList(); if (q.Count > 0) result = true; return result; } @@ -393,8 +455,8 @@ namespace BLL Project_CQMSDataService.StatisticalAllProjectData(); var ProjectData = (from x in Funs.DB.Project_CQMSData_CQMS - where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date - select x).ToList(); + where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date + select x).ToList(); var table = new CQMSData_CQMS { UnitId = thisUnitId, @@ -430,6 +492,25 @@ namespace BLL SubProjectNum = ProjectData.Sum(x => x.SubProjectNum), SubdivisionalWorksNum = ProjectData.Sum(x => x.SubdivisionalWorksNum), InspectionLotNum = ProjectData.Sum(x => x.InspectionLotNum), + EquipmentInspectionNum = ProjectData.Sum(x => x.EquipmentInspectionNum), + EquipmentInspectionQualifiedNum = ProjectData.Sum(x => x.EquipmentInspectionQualifiedNum), + MachineInspectionNum = ProjectData.Sum(x => x.MachineInspectionNum), + MachineInspectionQualifiedNum = ProjectData.Sum(x => x.MachineInspectionQualifiedNum), + PersonInspectionNum = ProjectData.Sum(x => x.PersonInspectionNum), + PersonInspectionQualifiedNum = ProjectData.Sum(x => x.PersonInspectionQualifiedNum), + MaterialInspectionNum = ProjectData.Sum(x => x.MaterialInspectionNum), + MaterialInspectionQualifiedNum = ProjectData.Sum(x => x.MaterialInspectionQualifiedNum), + ConstructSolutionNum = ProjectData.Sum(x => x.ConstructSolutionNum), + ConstructSolutionProjectApproveNum = ProjectData.Sum(x => x.ConstructSolutionProjectApproveNum), + ConstructSolutionUnitApproveNum = ProjectData.Sum(x => x.ConstructSolutionUnitApproveNum), + SpecialEquipmentQualityAssuranceSystemNum = ProjectData.Sum(x => x.SpecialEquipmentQualityAssuranceSystemNum), + DesignDetailsNum = ProjectData.Sum(x => x.DesignDetailsNum), + UnitProjectAcceptNum = ProjectData.Sum(x => x.UnitProjectAcceptNum), + UnitProjectAcceptOKNum = ProjectData.Sum(x => x.UnitProjectAcceptOKNum), + SubProjectAcceptNum = ProjectData.Sum(x => x.SubProjectAcceptNum), + SubProjectAcceptOKNum = ProjectData.Sum(x => x.SubProjectAcceptOKNum), + SubdivisionalWorksAcceptNum = ProjectData.Sum(x => x.SubdivisionalWorksAcceptNum), + SubdivisionalWorksAcceptOKNum = ProjectData.Sum(x => x.SubdivisionalWorksAcceptOKNum), CreateMan = Const.sysglyId, CreateDate = DateTime.Now }; @@ -451,6 +532,241 @@ namespace BLL return data; } + /// + /// 获取质量统计数据 + /// + public static async Task StatisitcalDataAsync() + { + var thisUnitId = string.Empty; + var thisUnit = CommonService.GetIsThisUnit(); + if (thisUnit != null) thisUnitId = thisUnit.UnitId; + var baseUnit = UnitService.GetUnitByUnitId(thisUnitId); + + // 并行执行异步方法 + var companyPersonNumTask = CQMSDataService.GetCompanyPersonNumAsync(); //获取企业总部人数 + var branchPersonNumTask = CQMSDataService.GetBranchPersonNumAsync(); //获取分支机构人数 + var projectPersonNumTask = CQMSDataService.GetProjectPersonNumAsync(); //获取项目专职人数 + var trainPersonNumTask = CQMSDataService.GetTrainPersonNumAsync(); //获取质量培训人次数 + var technicalDisclosePersonTask = CQMSDataService.GetTechnicalDisclosePersonNumAsync(); //获取技术交底人次数 + + var inspectionEquipmentTask = CQMSDataService.GetComprehensive_InspectionEquipmentAsync(); //获取设备报验 + var inspectionPersonTask = CQMSDataService.GetComprehensive_InspectionPersonAsync(); //获取人员报验 + var inspectionMachineTask = CQMSDataService.GetComprehensive_InspectionMachineAsync(); //获取机具报验 + var useNumTask = CQMSDataService.GetUseNumAsync(); //获取在用计量器具数 + var okNumTask = CQMSDataService.GetOkNumAsync(); //获取校准合格数 + + var singleProjectNumTask = CQMSDataService.GetSingleProjectNumAsync(); //获取单项工程个数 + var unitProjectNumTask = CQMSDataService.GetUnitProjectNumAsync(); //获取单位工程个数 + var subProjectNuTask = CQMSDataService.GetSubProjectNumAsync(); //获取分部工程个数 + var subdivisionalWorksNuTask = CQMSDataService.GetSubdivisionalWorksNumAsync(); //获取分项工程个数 + var inspectionLotNumTask = CQMSDataService.GetInspectionLotNumAsync(); //获取检验批个数 + var constructSolutionTask = CQMSDataService.GetConstructSolutionAsync(); //施工方案数量 + var cqmsProblemTask = CQMSDataService.GetCQMSProblemAsync(); //获取企业级、项目级质量问题 + + //质量验收数据 + var keyProcessNumTask = CQMSDataService.GetKeyProcessNumAsync(); //获取关键工序验收数 + var keyProcessOKNumTask = CQMSDataService.GetKeyProcessOkNumAsync(); //获取关键工序验收合格数 + var specialProcessNumTask = CQMSDataService.GetSpecialProcessNumAsync(); //获取特殊过程验收数 + var specialProcessOKNumTask = CQMSDataService.GetSpecialProcessOkNumAsync(); //获取特殊过程验收合格数 + var concealedWorksNumTask = CQMSDataService.GetConcealedWorksNumAsync(); //获取隐蔽工程验收数 + var concealedWorksOKNumTask = CQMSDataService.GetConcealedWorksOkNumAsync(); //获取隐蔽工程验收合格数 + + var unitProjectAcceptNumTask = CQMSDataService.GetUnitProjectAcceptNumAsync(); //获取单位工程验收数 + var unitProjectAcceptOKNumTask = CQMSDataService.GetUnitProjectAcceptOKNumAsync(); //获取单位工程验收合格数 + var subProjectAcceptNumTask = CQMSDataService.GetSubProjectAcceptNumAsync(); //获取分部工程验收数 + var subProjectAcceptOKNumTask = CQMSDataService.GetSubProjectAcceptOKNumAsync(); //获取分部工程验收合格数 + var subdivisionalWorksAcceptNumTask = CQMSDataService.GetSubdivisionalWorksAcceptNumAsync(); //获取分项工程验收数 + var subdivisionalWorksAcceptOKNumTask = CQMSDataService.GetSubdivisionalWorksAcceptOKNumAsync(); //获取分项工程验收合格数 + var materialInRecheckNumTask = CQMSDataService.GetMaterialInRecheckNumAsync(); //获取复核材料数 + var materialInRecheckOKNumTask = CQMSDataService.GetMaterialInRecheckOKNumAsync(); //获取复核材料合格数 + + // 等待所有异步方法执行完成 + await Task.WhenAll( + companyPersonNumTask, branchPersonNumTask, projectPersonNumTask, + trainPersonNumTask, technicalDisclosePersonTask, + inspectionEquipmentTask, inspectionPersonTask, inspectionMachineTask, + useNumTask, okNumTask, + singleProjectNumTask, unitProjectNumTask, subProjectNuTask, subdivisionalWorksNuTask, inspectionLotNumTask, + constructSolutionTask, + cqmsProblemTask, + keyProcessNumTask, keyProcessOKNumTask, specialProcessNumTask, specialProcessOKNumTask, concealedWorksNumTask, concealedWorksOKNumTask, + unitProjectAcceptNumTask, unitProjectAcceptOKNumTask, subProjectAcceptNumTask, subProjectAcceptOKNumTask, subdivisionalWorksAcceptNumTask, subdivisionalWorksAcceptOKNumTask, + materialInRecheckNumTask, materialInRecheckOKNumTask + ); + + // 统一获取异步方法的返回值 + var companyPersonNum = await companyPersonNumTask; + var branchPersonNum = await branchPersonNumTask; + var projectPersonNumList = await projectPersonNumTask; + var trainPersonNumList = await trainPersonNumTask; + var technicalDisclosePersonList = await technicalDisclosePersonTask; + + var inspectionEquipmentList = await inspectionEquipmentTask; + var inspectionPersonList = await inspectionPersonTask; + var inspectionMachineList = await inspectionMachineTask; + var useNum = await useNumTask; + var okNum = await okNumTask; + var singleProjectNum = await singleProjectNumTask; + var unitProjectNum = await unitProjectNumTask; + var subProjectNum = await subProjectNuTask; + var subdivisionalWorksNum = await subdivisionalWorksNuTask; + var inspectionLotNum = await inspectionLotNumTask; + + var constructSolutionList = await constructSolutionTask; + var cqmsProblemList = await cqmsProblemTask; + + var keyProcessNum = await keyProcessNumTask; + var keyProcessOKNum = await keyProcessOKNumTask; + var specialProcessNum = await specialProcessNumTask; + var specialProcessOKNum = await specialProcessOKNumTask; + var concealedWorksNum = await concealedWorksNumTask; + var concealedWorksOKNum = await concealedWorksOKNumTask; + + var unitProjectAcceptNum = await unitProjectAcceptNumTask; + var unitProjectAcceptOKNum = await unitProjectAcceptOKNumTask; + var subProjectAcceptNum = await subProjectAcceptNumTask; + var subProjectAcceptOKNum = await subProjectAcceptOKNumTask; + var subdivisionalWorksAcceptNum = await subdivisionalWorksAcceptNumTask; + var subdivisionalWorksAcceptOKNum = await subdivisionalWorksAcceptOKNumTask; + var materialInRecheckNum = await materialInRecheckNumTask; + var materialInRecheckOKNum = await materialInRecheckOKNumTask; + + // 构造结果对象 + var table = new CQMSData_CQMS + { + UnitId = thisUnitId, + CollCropCode = baseUnit.CollCropCode, + UnitName = baseUnit.UnitName, + ReportDate = DateTime.Now.Date, + CompanyPersonNum = companyPersonNum,// + BranchPersonNum = branchPersonNum,// + ProjectPersonNum = projectPersonNumList.Count(), + TrainPersonNum = trainPersonNumList.Count(), + TechnicalDisclosePersonNum = technicalDisclosePersonList.Sum(x => x.TrainPersonNum), + EquipmentInspectionNum = inspectionEquipmentList.Count(), + EquipmentInspectionQualifiedNum = inspectionEquipmentList.Where(x => x.IsCheckCertificate == true).Count(), + PersonInspectionNum = inspectionPersonList.Count(), + PersonInspectionQualifiedNum = inspectionPersonList.Where(x => x.IsOnSite.HasValue && x.IsOnSite == true).Count(), + MachineInspectionNum = inspectionMachineList.Count(), + MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckOK.HasValue && x.IsCheckOK == true).Count(), + MaterialInspectionNum = 0, + MaterialInspectionQualifiedNum = 0, + UseNum = useNum.Count(), + OKNum = okNum.Count(), + SingleProjectNum = singleProjectNum.Count(), + UnitProjectNum = unitProjectNum.Count(), + SubProjectNum = subProjectNum.Count(), + SubdivisionalWorksNum = subdivisionalWorksNum.Count(), + InspectionLotNum = inspectionLotNum.Sum(x => x.Sum), + + ConstructSolutionNum = constructSolutionList.Count(), + ConstructSolutionProjectApproveNum = constructSolutionList.Where(x => x.State == "1").Count(), + ConstructSolutionUnitApproveNum = 0,// + SpecialEquipmentQualityAssuranceSystemNum = 0,// + DesignDetailsNum = technicalDisclosePersonList.Sum(x => x.TrainPersonNum), + + ProblemNum = cqmsProblemList.Count(), + ProblemCompletedNum = cqmsProblemList.Where(x => x.State == "7").Count(), + ProblemNotCompletedNum = cqmsProblemList.Where(x => x.State != "7").Count(), + + KeyProcessNum = keyProcessNum.Count(), + KeyProcessOKNum = keyProcessOKNum.Count(), + SpecialProcessNum = specialProcessNum.Count(), + SpecialProcessOKNum = specialProcessOKNum.Count(), + ConcealedWorksNum = concealedWorksNum.Count(), + ConcealedWorksOKNum = concealedWorksOKNum.Count(), + UnitProjectAcceptNum = unitProjectAcceptNum.Count(), + UnitProjectAcceptOKNum = unitProjectAcceptOKNum.Count(), + SubProjectAcceptNum = subProjectAcceptNum.Count(), + SubProjectAcceptOKNum = subProjectAcceptOKNum.Count(), + SubdivisionalWorksAcceptNum = subdivisionalWorksAcceptNum.Count(), + SubdivisionalWorksAcceptOKNum = subdivisionalWorksAcceptOKNum.Count(), + MaterialInRecheckNum = materialInRecheckNum.Count(), + MaterialInRecheckOKNum = materialInRecheckOKNum.Count() + }; + #region 添加项目统计数据 + + Project_CQMSDataService.DeleteProject_CQMSData_CQMByDate(DateTime.Now.Date); + foreach (var projectid in BeUnderConstructionList) + { + var projectCqmsData = new Project_CQMSData_CQMS + { + Id = SQLHelper.GetNewID(), + ProjectId = projectid, + UnitId = thisUnitId, + CollCropCode = baseUnit.CollCropCode, + UnitName = baseUnit.UnitName, + ReportDate = DateTime.Now.Date, + CompanyPersonNum = companyPersonNum,// + BranchPersonNum = branchPersonNum,// + ProjectPersonNum = projectPersonNumList.Count(x => x.ProjectId == projectid), + TrainPersonNum = trainPersonNumList.Count(x => x.ProjectId == projectid), + TechnicalDisclosePersonNum = technicalDisclosePersonList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum), + EquipmentInspectionNum = inspectionEquipmentList.Count(x => x.ProjectId == projectid), + EquipmentInspectionQualifiedNum = inspectionEquipmentList.Where(x => x.IsCheckCertificate == true && 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(), + MachineInspectionNum = inspectionMachineList.Count(x => x.ProjectId == projectid), + MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckOK.HasValue && x.IsCheckOK == true && x.ProjectId == projectid).Count(), + MaterialInspectionNum = 0, + MaterialInspectionQualifiedNum = 0, + UseNum = useNum.Count(x => x.ProjectId == projectid), + OKNum = okNum.Count(x => x.ProjectId == projectid), + SingleProjectNum = singleProjectNum.Count(x => x.ProjectId == projectid), + UnitProjectNum = unitProjectNum.Count(x => x.ProjectId == projectid), + SubProjectNum = subProjectNum.Count(x => x.ProjectId == projectid), + SubdivisionalWorksNum = subdivisionalWorksNum.Count(x => x.ProjectId == projectid), + InspectionLotNum = inspectionLotNum.Where(x => x.ProjectId == projectid).Sum(x => x.Sum), + + ConstructSolutionNum = constructSolutionList.Count(x => x.ProjectId == projectid), + ConstructSolutionProjectApproveNum = constructSolutionList.Where(x => x.State == "1" && x.ProjectId == projectid).Count(), + ConstructSolutionUnitApproveNum = 0,// + SpecialEquipmentQualityAssuranceSystemNum = 0,// + DesignDetailsNum = technicalDisclosePersonList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum), + + ProblemNum = cqmsProblemList.Count(x => x.ProjectId == projectid), + ProblemCompletedNum = cqmsProblemList.Where(x => x.State == "7" && x.ProjectId == projectid).Count(), + ProblemNotCompletedNum = cqmsProblemList.Where(x => x.State != "7" && x.ProjectId == projectid).Count(), + + KeyProcessNum = keyProcessNum.Count(x => x.ProjectId == projectid), + KeyProcessOKNum = keyProcessOKNum.Count(x => x.ProjectId == projectid), + SpecialProcessNum = specialProcessNum.Count(x => x.ProjectId == projectid), + SpecialProcessOKNum = specialProcessOKNum.Count(x => x.ProjectId == projectid), + ConcealedWorksNum = concealedWorksNum.Count(x => x.ProjectId == projectid), + ConcealedWorksOKNum = concealedWorksOKNum.Count(x => x.ProjectId == projectid), + UnitProjectAcceptNum = unitProjectAcceptNum.Count(x => x.ProjectId == projectid), + UnitProjectAcceptOKNum = unitProjectAcceptOKNum.Count(x => x.ProjectId == projectid), + SubProjectAcceptNum = subProjectAcceptNum.Count(x => x.ProjectId == projectid), + SubProjectAcceptOKNum = subProjectAcceptOKNum.Count(x => x.ProjectId == projectid), + SubdivisionalWorksAcceptNum = subdivisionalWorksAcceptNum.Count(x => x.ProjectId == projectid), + SubdivisionalWorksAcceptOKNum = subdivisionalWorksAcceptOKNum.Count(x => x.ProjectId == projectid), + MaterialInRecheckNum = materialInRecheckNum.Count(x => x.ProjectId == projectid), + MaterialInRecheckOKNum = materialInRecheckOKNum.Count(x => x.ProjectId == projectid) + }; + Project_CQMSDataService.AddProject_CQMSData_CQMS(projectCqmsData); + } + + #endregion + + + if (IsReportByToday()) + { + table.Id = GetTodayData().Id; + table.State = Const.CNCEC_State_1; + UpdateCQMSData_CQMS(table); + } + else + { + table.Id = SQLHelper.GetNewID(); + table.State = Const.CNCEC_State_0; + AddCQMSData_CQMS(table); + } + var data = new CQMSData(); + data = GetDataByCQMSData_CQMS(table); + return data; + + } + public static CQMSData GetDataByCQMSData_CQMS(CQMSData_CQMS table) { var data = new CQMSData(); @@ -494,13 +810,31 @@ namespace BLL item.SubProjectNum = table.SubProjectNum; item.SubdivisionalWorksNum = table.SubdivisionalWorksNum; item.InspectionLotNum = table.InspectionLotNum; + item.EquipmentInspectionNum = table.EquipmentInspectionNum; + item.EquipmentInspectionQualifiedNum = table.EquipmentInspectionQualifiedNum; + item.MachineInspectionNum = table.MachineInspectionNum; + item.MachineInspectionQualifiedNum = table.MachineInspectionQualifiedNum; + item.PersonInspectionNum = table.PersonInspectionNum; + item.PersonInspectionQualifiedNum = table.PersonInspectionQualifiedNum; + item.MaterialInspectionNum = table.MaterialInspectionNum; + item.MaterialInspectionQualifiedNum = table.MaterialInspectionQualifiedNum; + item.ConstructSolutionNum = table.ConstructSolutionNum; + item.ConstructSolutionProjectApproveNum = table.ConstructSolutionProjectApproveNum; + item.ConstructSolutionUnitApproveNum = table.ConstructSolutionUnitApproveNum; + item.SpecialEquipmentQualityAssuranceSystemNum = table.SpecialEquipmentQualityAssuranceSystemNum; + item.DesignDetailsNum = table.DesignDetailsNum; + item.UnitProjectAcceptNum = table.UnitProjectAcceptNum; + item.UnitProjectAcceptOKNum = table.UnitProjectAcceptOKNum; + item.SubProjectAcceptNum = table.SubProjectAcceptNum; + item.SubProjectAcceptOKNum = table.SubProjectAcceptOKNum; + item.SubdivisionalWorksAcceptNum = table.SubdivisionalWorksAcceptNum; + item.SubdivisionalWorksAcceptOKNum = table.SubdivisionalWorksAcceptOKNum; var cqmsDataItems = new List(); cqmsDataItems.Add(item); data.CQMSDataItems = cqmsDataItems; return data; } - /// /// 获取企业总部人数 /// @@ -511,12 +845,21 @@ namespace BLL var thisUnit = CommonService.GetIsThisUnit(); if (thisUnit != null) unitId = thisUnit.UnitId; var result = (from x in Funs.DB.Person_Persons - join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId - where x.IsPost == true && y.IsCQMS == true && x.UnitId == unitId - select x).Count(); + join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId + where x.IsPost == true && y.IsCQMS == true && x.UnitId == unitId + select x).Count(); return result; } + /// + /// 获取企业总部人数(异步) + /// + /// + public static async Task GetCompanyPersonNumAsync() + { + return await Task.Run(GetCompanyPersonNum); + } + /// /// 获取分支机构人数 /// @@ -528,9 +871,865 @@ namespace BLL if (thisUnit != null) unitId = thisUnit.UnitId; var result = (from x in Funs.DB.Person_Persons join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId - where x.IsPost == true && y.IsCQMS == true && x.UnitId != unitId - select x).Count(); + where x.IsPost == true && y.IsCQMS == true && x.UnitId != unitId + select x).Count(); return result; } + + /// + /// 获取分支机构人数(异步) + /// + /// + public static async Task GetBranchPersonNumAsync() + { + return await Task.Run(GetBranchPersonNum); + } + + /// + /// 获取项目专职人数 + /// + /// + public static IEnumerable GetProjectPersonNum() + { + var result = (from x in Funs.DB.SitePerson_Person + join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId + join z in Funs.DB.Person_Persons on x.PersonId equals z.PersonId + join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup + from p in pGroup.DefaultIfEmpty() + join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup + from u in uGroup.DefaultIfEmpty() + where BeUnderConstructionList.Contains(p.ProjectId) && y.IsCQMS == true + select new Model.OfSafetySupervisorsOutput + { + ProjectId = x.ProjectId, + ProjectName = p.ProjectName, + UnitId = u.UnitId, + UnitName = u.UnitName, + Name = x.PersonName, + Sex = z.Sex == null ? "" : (z.Sex == "1" ? "男" : "女"), + IdentityCard = x.IdentityCard, + WorkPostName = y.WorkPostName == null ? "" : y.WorkPostName, + Phone = z.Telephone + }).ToList(); + result = result + .GroupBy(x => x.IdentityCard) + .Select(g => g.FirstOrDefault()) + .ToList(); + return result; + } + /// + /// 获取项目专职人数(异步) + /// + /// + public static async Task> GetProjectPersonNumAsync() + { + return await Task.Run(GetProjectPersonNum); + } + + /// + /// 获取质量培训人次数 + /// + /// + public static List GetTrainPersonNum() + { + var result = (from x in Funs.DB.Comprehensive_InspectionPerson + join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup + from p in pGroup.DefaultIfEmpty() + join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup + from u in uGroup.DefaultIfEmpty() + join y in Funs.DB.Person_Persons on x.InspectionPersonId equals y.PersonId into yGroup + from y in yGroup.DefaultIfEmpty() + join m in Funs.DB.Base_WorkPost on y.WorkPostId equals m.WorkPostId into mGroup + from m in mGroup.DefaultIfEmpty() + where BeUnderConstructionList.Contains(p.ProjectId) && x.IsTrain == true && x.CompileDate > Const.DtmarkTime + select new Model.OfSafetySupervisorsOutput + { + ProjectId = x.ProjectId, + ProjectName = p.ProjectName, + UnitId = u.UnitId, + UnitName = u.UnitName, + Name = x.PersonName, + Sex = y.Sex == null ? "" : (y.Sex == "1" ? "男" : "女"), + IdentityCard = y.IdentityCard, + WorkPostName = m.WorkPostName == null ? "" : m.WorkPostName, + Phone = y.Telephone + }).ToList(); + return result; + } + /// + /// 获取质量培训人次数(异步) + /// + /// + public static async Task> GetTrainPersonNumAsync() + { + return await Task.Run(GetTrainPersonNum); + } + + /// + /// 获取技术交底人次数 + /// + /// + public static int GetTechnicalDisclosePersonNum() + { + var result = (from x in Funs.DB.Comprehensive_DesignDetails + where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime + select x.JoinPersonNum).ToList().Sum(x => x.Value); + return result; + } + + /// + /// 获取技术交底人次数 + /// + /// + public static List GetTechnicalDisclosePerson() + { + var result = (from x in Funs.DB.Comprehensive_DesignDetails + 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.CompileDate > Const.DtmarkTime + select new Model.EduTrainOutput() + { + ProjectId = x.ProjectId, + ProjectName = p.ProjectName, + UnitName = "", + Id = x.DesignDetailsId, + TrainTitle = "", + TrainStartDate = null, + TrainEndDate = null, + TrainPersonNum = x.JoinPersonNum ?? 0, + }).ToList(); + return result; + } + + /// + /// 获取技术交底人次数(异步) + /// + /// + public static async Task> GetTechnicalDisclosePersonNumAsync() + { + return await Task.Run(GetTechnicalDisclosePerson); + } + + /// + /// 获取设备报验 + /// + /// + public static List GetComprehensive_InspectionEquipment() + { + var result = (from x in Funs.DB.Check_CheckEquipment + where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime + select x).ToList(); + return result; + } + + /// + /// 获取设备报验(异步) + /// + /// + public static async Task> GetComprehensive_InspectionEquipmentAsync() + { + return await Task.Run(GetComprehensive_InspectionEquipment); + } + + /// + /// 获取人员报验 + /// + /// + public static List GetComprehensive_InspectionPerson() + { + var result = (from x in Funs.DB.Comprehensive_InspectionPerson + where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime + select x).ToList(); + return result; + } + + /// + /// 获取人员报验(异步) + /// + /// + public static async Task> GetComprehensive_InspectionPersonAsync() + { + return await Task.Run(GetComprehensive_InspectionPerson); + } + + /// + /// 获取机具报验 + /// + /// + public static List GetComprehensive_InspectionMachine() + { + var result = (from x in Funs.DB.Comprehensive_InspectionMachine + where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime + select x).ToList(); + return result; + } + + /// + /// 获取机具报验(异步) + /// + /// + public static async Task> GetComprehensive_InspectionMachineAsync() + { + return await Task.Run(GetComprehensive_InspectionMachine); + } + + /// + /// 获取在用计量器具数 + /// + /// + public static List GetUseNum() + { + var result = (from x in Funs.DB.Comprehensive_InspectionMachine + where BeUnderConstructionList.Contains(x.ProjectId) && x.IsOnSite == true && x.InspectionType.Contains("计量") && x.CompileDate > Const.DtmarkTime + select x).ToList(); + return result; + } + + /// + /// 获取在用计量器具数(异步) + /// + /// + public static async Task> GetUseNumAsync() + { + return await Task.Run(GetUseNum); + } + + /// + /// 获取校准合格数 + /// + /// + public static List GetOkNum() + { + var result = (from x in Funs.DB.Comprehensive_InspectionMachine + where BeUnderConstructionList.Contains(x.ProjectId) && x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true + && x.CompileDate > Const.DtmarkTime + select x).ToList(); + return result; + } + + /// + /// 获取校准合格数(异步) + /// + /// + public static async Task> GetOkNumAsync() + { + return await Task.Run(GetOkNum); + } + + /// + /// 获取单项工程个数 + /// + /// + public static List GetSingleProjectNum() + { + var result = (from x in Funs.DB.ProjectData_MainItem + where BeUnderConstructionList.Contains(x.ProjectId) + select x).ToList(); + return result; + } + + /// + /// 获取单项工程个数(异步) + /// + /// + public static async Task> GetSingleProjectNumAsync() + { + return await Task.Run(GetSingleProjectNum); + } + + /// + /// 获取单位工程个数 + /// + /// + public static List GetUnitProjectNum() + { + var result = (from x in Funs.DB.WBS_UnitWork + where BeUnderConstructionList.Contains(x.ProjectId) + select x).ToList(); + return result; + } + + /// + /// 获取单位工程个数(异步) + /// + /// + public static async Task> GetUnitProjectNumAsync() + { + return await Task.Run(GetUnitProjectNum); + } + + /// + /// 获取分部工程个数 + /// + /// + public static List GetSubProjectNum() + { + var result = (from x in Funs.DB.WBS_DivisionProject + where BeUnderConstructionList.Contains(x.ProjectId) && x.SubItemType == "1" && x.IsSelected == true + select x).ToList(); + return result; + } + + /// + /// 获取分部工程个数(异步) + /// + /// + public static async Task> GetSubProjectNumAsync() + { + return await Task.Run(GetSubProjectNum); + } + + /// + /// 获取分项工程个数 + /// + /// + public static List GetSubdivisionalWorksNum() + { + var result = (from x in Funs.DB.WBS_DivisionProject + where BeUnderConstructionList.Contains(x.ProjectId) && x.SubItemType == "3" && x.IsSelected == true + select x).ToList(); + return result; + } + + /// + /// 获取分项工程个数(异步) + /// + /// + public static async Task> GetSubdivisionalWorksNumAsync() + { + return await Task.Run(GetSubdivisionalWorksNum); + } + + /// + /// 获取检验批个数 + /// + /// + public static List GetInspectionLotNum() + { + var result = (from x in Funs.DB.WBS_BreakdownProject + where BeUnderConstructionList.Contains(x.ProjectId) && x.IsSelected == true + group x by x.ProjectId into g + select new Model.WBSBreakdownProjectOutput() + { + ProjectId = g.Key, + Sum = g.Count(), + }).ToList() ; + return result; + } + + /// + /// 获取检验批个数(异步) + /// + /// + public static async Task> GetInspectionLotNumAsync() + { + return await Task.Run(GetInspectionLotNum); + } + + + /// + /// 施工方案数量 + /// + /// + public static List GetConstructSolution() + { + var result = (from x in Funs.DB.Solution_CQMSConstructSolution + where BeUnderConstructionList.Contains(x.ProjectId) + select x).ToList(); + return result; + } + + /// + /// 施工方案数量(异步) + /// + /// + public static async Task> GetConstructSolutionAsync() + { + return await Task.Run(GetConstructSolution); + } + + /// + /// 获取质量问题 + /// + /// + public static List GetCQMSProblem() + { + var result = (from x in Funs.DB.Check_CheckControl + where BeUnderConstructionList.Contains(x.ProjectId) && x.CheckDate > Const.DtmarkTime + select x).ToList(); + return result; + } + + /// + /// 获取质量问题(异步) + /// + /// + public static async Task> GetCQMSProblemAsync() + { + return await Task.Run(GetCQMSProblem); + } + + + /// + /// 获取分支机构巡检质量问题 + /// + /// + public static List GetBranchCQMSProblem() + { + var result = (from x in Funs.DB.View_DCGL_CheckRectifyListFromSUB + where BeUnderConstructionList.Contains(x.ProjectId) && x.ProblemTypes == "1" && x.CheckDate > Const.DtmarkTime + select x).ToList(); + return result; + } + + /// + /// 获取分支机构巡检质量问题(异步) + /// + /// + public static async Task> GetBranchCQMSProblemAsync() + { + return await Task.Run(GetBranchCQMSProblem); + } + + #region 质量验收数据 + + /// + /// 获取关键工序验收数 + /// + /// + public static List GetKeyProcessNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "1" && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取关键工序验收数(异步) + /// + /// + public static async Task> GetKeyProcessNumAsync() + { + return await Task.Run(GetKeyProcessNum); + } + + /// + /// 获取关键工序验收合格数 + /// + /// + public static List GetKeyProcessOkNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "1" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取关键工序验收合格数(异步) + /// + /// + public static async Task> GetKeyProcessOkNumAsync() + { + return await Task.Run(GetKeyProcessOkNum); + } + + /// + /// 获取特殊过程验收数 + /// + /// + public static List GetSpecialProcessNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "2" && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取特殊过程验收数(异步) + /// + /// + public static async Task> GetSpecialProcessNumAsync() + { + return await Task.Run(GetSpecialProcessNum); + } + /// + /// 获取特殊过程验收合格数 + /// + /// + public static List GetSpecialProcessOkNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "2" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取特殊过程验收合格数(异步) + /// + /// + public static async Task> GetSpecialProcessOkNumAsync() + { + return await Task.Run(GetSpecialProcessOkNum); + } + /// + /// 获取隐蔽工程验收数 + /// + /// + public static List GetConcealedWorksNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "3" && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取隐蔽工程验收数(异步) + /// + /// + public static async Task> GetConcealedWorksNumAsync() + { + return await Task.Run(GetConcealedWorksNum); + } + /// + /// 获取隐蔽工程验收合格数 + /// + /// + public static List GetConcealedWorksOkNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "3" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取隐蔽工程验收合格数(异步) + /// + /// + public static async Task> GetConcealedWorksOkNumAsync() + { + return await Task.Run(GetConcealedWorksOkNum); + } + + /// + /// 获取单位工程验收数 + /// + /// + public static List GetUnitProjectAcceptNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "4" && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取单位工程验收数(异步) + /// + /// + public static async Task> GetUnitProjectAcceptNumAsync() + { + return await Task.Run(GetUnitProjectAcceptNum); + } + /// + /// 获取单位工程验收合格数 + /// + /// + public static List GetUnitProjectAcceptOKNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "4" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取单位工程验收合格数(异步) + /// + /// + public static async Task> GetUnitProjectAcceptOKNumAsync() + { + return await Task.Run(GetUnitProjectAcceptOKNum); + } + + + /// 获取材料进场复验数 + /// + /// + public static List GetMaterialInRecheckNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "5" && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取材料进场复验数(异步) + /// + /// + public static async Task> GetMaterialInRecheckNumAsync() + { + return await Task.Run(GetMaterialInRecheckNum); + } + /// + /// 获取材料进场复验数合格数 + /// + /// + public static List GetMaterialInRecheckOKNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "5" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取材料进场复验数合格数(异步) + /// + /// + public static async Task> GetMaterialInRecheckOKNumAsync() + { + return await Task.Run(GetMaterialInRecheckOKNum); + } + + /// + /// 获取分部工程验收数 + /// + /// + public static List GetSubProjectAcceptNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "5" && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取分部工程验收数(异步) + /// + /// + public static async Task> GetSubProjectAcceptNumAsync() + { + return await Task.Run(GetSubProjectAcceptNum); + } + /// + /// 获取分部工程验收合格数 + /// + /// + public static List GetSubProjectAcceptOKNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "5" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取分部工程验收合格数(异步) + /// + /// + public static async Task> GetSubProjectAcceptOKNumAsync() + { + return await Task.Run(GetSubProjectAcceptOKNum); + } + /// + /// 获取分项工程验收数 + /// + /// + public static List GetSubdivisionalWorksAcceptNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "6" && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取分项工程验收数(异步) + /// + /// + public static async Task> GetSubdivisionalWorksAcceptNumAsync() + { + return await Task.Run(GetSubdivisionalWorksAcceptNum); + } + /// + /// 获取分项工程验收合格数 + /// + /// + public static List GetSubdivisionalWorksAcceptOKNum() + { + var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId + where BeUnderConstructionList.Contains(y.ProjectId) && y.CheckAcceptType == "6" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime + select new Model.InspectionManagementOutput() + { + ProjectId = y.ProjectId, + //ProjectName = p.ProjectName, + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + Id = x.InspectionDetailId, + BreakdownCode = y.BreakdownCode, + BreakdownName = y.BreakdownName, + Basis = y.Basis, + CheckPoints = y.CheckPoints, + }).ToList(); + return result; + } + /// + /// 获取分项工程验收合格数(异步) + /// + /// + public static async Task> GetSubdivisionalWorksAcceptOKNumAsync() + { + return await Task.Run(GetSubdivisionalWorksAcceptOKNum); + } + #endregion + } } \ No newline at end of file diff --git a/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs b/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs index f164cb3f..fa18ff60 100644 --- a/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs +++ b/SGGL/BLL/ZHGL/DataSync/HJGLData_HJGLService.cs @@ -1,4 +1,4 @@ -using FineUIPro; +using FineUIPro; using Model; using Newtonsoft.Json; using System; @@ -6,13 +6,16 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json.Linq; +using Model; using System.Net.PeerToPeer; +using System.Threading.Tasks; namespace BLL { public static class HJGLData_HJGLService { public static SGGLDB db = Funs.DB; + public static List BeUnderConstructionList = ProjectService.GetProjectWorkList().Select(x => x.ProjectId).ToList(); #region 获取列表 @@ -49,22 +52,22 @@ namespace BLL if (count == 0) return null; // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); return from x in q - select new - { - x.Id, - x.UnitId, - x.CollCropCode, - x.UnitName, - x.ReportDate, - x.WelderNum, - x.TotalDineNum, - x.CompleteDineNum, - x.TotalFilmNum, - x.OKFilmNum, - x.State, - x.CreateDate, - x.CreateMan - }; + select new + { + x.Id, + x.UnitId, + x.CollCropCode, + x.UnitName, + x.ReportDate, + x.WelderNum, + x.TotalDineNum, + x.CompleteDineNum, + x.TotalFilmNum, + x.OKFilmNum, + x.State, + x.CreateDate, + x.CreateMan + }; } #endregion 获取列表 @@ -91,8 +94,8 @@ namespace BLL }; db.HJGLData_HJGL.InsertOnSubmit(table); db.SubmitChanges(); - } - + } + } public static void DeleteHJGLData_HJGLById(string Id) @@ -106,7 +109,7 @@ namespace BLL db.SubmitChanges(); } } - + } public static HJGLData_HJGL GetHJGLData_HJGLById(string Id) @@ -155,23 +158,27 @@ namespace BLL return data; } - public static HJGLData GetTodayHJGLData_HJGL() + public static async Task GetTodayHJGLData_HJGLAsync() { var data = new HJGLData(); - if (CommonService.GetIsThisUnit().CollCropCode== "91410200170644116B") + if (CommonService.GetIsThisUnit().CollCropCode == "91410200170644116B") { - return GetELECLTodayHJGLData_HJGL(); + return GetELECLTodayHJGLData_HJGL(); } - if (CommonService.GetIsThisUnit().CollCropCode == "914200001775697881") + if (CommonService.GetIsThisUnit().CollCropCode == "914200001775697881") { return GetCNCEC_16TodayHJGLData_HJGL(); } - var q = GetTodayData(); + /* var q = GetTodayData(); if (q != null && q.State == Const.CNCEC_State_S) data = StatisticalData(); else - data = StatisticalData(); + data = StatisticalData();*/ + + var modelTask = StatisticalDataAsync(); + var model = await modelTask; + data = model; return data; } /// @@ -185,11 +192,11 @@ namespace BLL string token = Const.sysglyId; string response = Funs.RequestPost(baseurl, token, ""); var json = JsonConvert.DeserializeObject(response) as JObject; - if (json != null && json["code"]?.ToString()=="1") + if (json != null && json["code"]?.ToString() == "1") { var str = json["data"]?.ToString(); - if (str != null) data = JsonConvert.DeserializeObject(str); - } + if (str != null) data = JsonConvert.DeserializeObject(str); + } return data; } @@ -212,10 +219,10 @@ namespace BLL } catch (Exception e) { - APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, e.ToString()); - + APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, e.ToString(), "Request|Post"); + } - + } var json = JsonConvert.DeserializeObject(response) as JObject; if (json != null && json["code"]?.ToString() == "1") @@ -223,14 +230,14 @@ namespace BLL var str = json["data"]?.ToString(); if (str != null) data = JsonConvert.DeserializeObject(str); } - APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, response); + APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, response, "Request|Post"); return data; } public static HJGLData_HJGL GetTodayData() { var q = (from x in Funs.DB.HJGLData_HJGL - where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date - select x).FirstOrDefault(); + where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date + select x).FirstOrDefault(); return q; } public static HJGLData_HJGL GetSubUnitHjglDataByDate(string Unitid, DateTime? reportdate) @@ -244,7 +251,7 @@ namespace BLL var baseUnit = UnitService.GetUnitByUnitId(Unitid); var ProjectData = (from x in Funs.DB.Project_HJGLData_HJGL where x.ReportDate == reportdate && projectlist.Select(e => e.ProjectId).Contains(x.ProjectId) - select x).ToList(); + select x).ToList(); result = new HJGLData_HJGL { UnitId = Unitid, @@ -259,7 +266,7 @@ namespace BLL CreateMan = Const.sysglyId, CreateDate = DateTime.Now }; - return result; + return result; } public static void UpdateTodyData_State() { @@ -275,8 +282,8 @@ namespace BLL { var result = false; var q = (from x in Funs.DB.HJGLData_HJGL - where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date - select x).ToList(); + where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date + select x).ToList(); if (q != null && q.Count > 0) result = true; return result; } @@ -289,8 +296,8 @@ namespace BLL { var result = false; var q = (from x in Funs.DB.HJGLData_HJGL - where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date - select x).ToList(); + where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date + select x).ToList(); if (q.Count > 0) result = true; return result; } @@ -304,33 +311,101 @@ namespace BLL return responeData; } - public static HJGLData StatisticalData() + public static async Task StatisticalDataAsync() { 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 welderNumTask = HJGLData_HJGLService.GetWelderNumAsync(); //获取焊工总数 + var dineInfoListTask = HJGLData_HJGLService.GetDineInfoAsync(); //获达因数信息 + var chCheckItemListTask = HJGLData_HJGLService.GetCHCheckItemAsync(); //获取焊接检查信息 + // 等待所有异步方法执行完成 + await Task.WhenAll( + welderNumTask, + dineInfoListTask, + chCheckItemListTask + ); + + // 统一获取异步方法的返回值 + 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 = 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), + 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 = (decimal ?)0, CompleteDineNum = (decimal?)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; @@ -364,7 +439,7 @@ namespace BLL } public static void UpdateHJGLData_HJGL(HJGLData_HJGL newtable) - { + { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { var table = db.HJGLData_HJGL.FirstOrDefault(x => x.Id == newtable.Id); @@ -385,8 +460,86 @@ namespace BLL table.CreateDate = newtable.CreateDate; db.SubmitChanges(); } - } - + } + + } + + + /// + /// 获取焊工总数 + /// + /// + public static List GetWelderNum() + { + var result = (from x in Funs.DB.SitePerson_Person + where BeUnderConstructionList.Contains(x.ProjectId) && x.WorkPostId == Const.WorkPost_Welder && x.States == "1" + select new Model.WelderOutput() + { + ProjectId = x.ProjectId, + UnitId = x.UnitId, + WEDCode = x.CardNo, + WEDName = x.PersonName + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + }).ToList(); + return result; + } + /// + /// 获取焊工总数(异步) + /// + /// + public static async Task> GetWelderNumAsync() + { + return await Task.Run(GetWelderNum); + } + + /// + /// 获取总达因数和完成达因数 + /// + /// + public static IEnumerable GetDineInfo() + { + var result = (from x in Funs.DB.HJGL_WeldJoint + where BeUnderConstructionList.Contains(x.ProjectId) + group x by x.ProjectId into g + select new Model.WeldDineOutput() + { + ProjectId = g.Key, + Size = g.Sum(x => x.Size), + DoneDin = g.Sum(x => x.Dia) + }); + return result; + } + public static async Task> GetDineInfoAsync() + { + return await Task.Run(GetDineInfo); + } + /// + /// 获取焊接检查信息 + /// + /// + public static List GetCHCheckItem() + { + var result = (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.HJGL_Batch_NDE on x.NDEID equals y.NDEID + where BeUnderConstructionList.Contains(y.ProjectId) + select new Model.CHCheckItemOutput() + { + Id = x.NDEItemID, + ProjectId = y.ProjectId, + UnitId = y.UnitId, + CHT_TotalFilm = x.TotalFilm, + CHT_PassFilm = x.PassFilm + //UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds), + }).ToList(); + return result; + } + /// + /// 获取焊接检查信息(异步) + /// + /// + public static async Task> GetCHCheckItemAsync() + { + return await Task.Run(GetCHCheckItem); } } } \ 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 4d433940..e28db3f5 100644 --- a/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs +++ b/SGGL/BLL/ZHGL/DataSync/HSSEData_HSSEService.cs @@ -40,6 +40,7 @@ namespace BLL SafeTrainNum = newtable.SafeTrainNum, SpecialTrainNum = newtable.SpecialTrainNum, SpecialOperationTrainNum = newtable.SpecialOperationTrainNum, + HseTechnicalNum = newtable.HseTechnicalNum, EnvironmentalTrainNum = newtable.EnvironmentalTrainNum, TotalEnergyConsumption = newtable.TotalEnergyConsumption, IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption, @@ -75,10 +76,12 @@ namespace BLL CompanySpecialPlanNum = newtable.CompanySpecialPlanNum, CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan, CompanyDrillNum = newtable.CompanyDrillNum, + CompanyDrillPersonNum = newtable.CompanyDrillPersonNum, ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum, ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum, ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan, ProjectDrillNum = newtable.ProjectDrillNum, + ProjectDrillPersonNum = newtable.ProjectDrillPersonNum, CostExtract = newtable.CostExtract, CostUse = newtable.CostUse, UseEquipmentNum = newtable.UseEquipmentNum, @@ -97,10 +100,12 @@ namespace BLL TrainPersonNum = newtable.TrainPersonNum, ConstructionNum = newtable.ConstructionNum, FinishedNum = newtable.FinishedNum, + ArgumentNum = newtable.ArgumentNum, SuperCompletedNum = newtable.SuperCompletedNum, SuperTrainPersonNum = newtable.SuperTrainPersonNum, SuperConstructionNum = newtable.SuperConstructionNum, SuperFinishedNum = newtable.SuperFinishedNum, + SuperArgumentNum = newtable.SuperArgumentNum, State = newtable.State, CreateDate = newtable.CreateDate, CreateMan = newtable.CreateMan @@ -108,6 +113,7 @@ namespace BLL db.HSSEData_HSSE.InsertOnSubmit(table); db.SubmitChanges(); } + } public static void DeleteHSSEData_HSSEById(string id) @@ -148,6 +154,7 @@ namespace BLL item.CompanyComprehensiveCheckNum = dataHsse.CompanyComprehensiveCheckNum; item.CompanyComprehensivePlanNum = dataHsse.CompanyComprehensivePlanNum; item.CompanyDrillNum = dataHsse.CompanyDrillNum; + item.CompanyDrillPersonNum = dataHsse.CompanyDrillPersonNum; item.CompanyLeadShiftCheckNum = dataHsse.CompanyLeadShiftCheckNum; item.CompanyOnSiteDisposalPlan = dataHsse.CompanyOnSiteDisposalPlan; item.CompanySpecialCheckNum = dataHsse.CompanySpecialCheckNum; @@ -158,6 +165,7 @@ namespace BLL item.CostUse = dataHsse.CostUse; item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum; item.FinishedNum = dataHsse.FinishedNum; + item.ArgumentNum = dataHsse.ArgumentNum; item.GeneralAccidentNum = dataHsse.GeneralAccidentNum; item.GeneralClosedNum = dataHsse.GeneralClosedNum; item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum; @@ -183,6 +191,7 @@ namespace BLL item.NewWaterConsumption = dataHsse.NewWaterConsumption; item.ProjectComprehensivePlanNum = dataHsse.ProjectComprehensivePlanNum; item.ProjectDrillNum = dataHsse.ProjectDrillNum; + item.ProjectDrillPersonNum = dataHsse.ProjectDrillPersonNum; item.ProjectFullTimeNum = dataHsse.ProjectFullTimeNum; item.ProjectInspectorGeneralNum = dataHsse.ProjectInspectorGeneralNum; item.ProjectLeadShiftCheckNum = dataHsse.ProjectLeadShiftCheckNum; @@ -203,6 +212,7 @@ namespace BLL item.ShutdownNum = dataHsse.ShutdownNum; item.SpecialEquipmentNum = dataHsse.SpecialEquipmentNum; item.SpecialOperationTrainNum = dataHsse.SpecialOperationTrainNum; + item.HseTechnicalNum = dataHsse.HseTechnicalNum; item.EnvironmentalTrainNum = dataHsse.EnvironmentalTrainNum; item.SpecialSeriousAccidentNum = dataHsse.SpecialSeriousAccidentNum; item.SpecialTrainNum = dataHsse.SpecialTrainNum; @@ -210,6 +220,7 @@ namespace BLL item.SuperConstructionNum = dataHsse.SuperConstructionNum; item.SuperFinishedNum = dataHsse.SuperFinishedNum; item.SuperTrainPersonNum = dataHsse.SuperTrainPersonNum; + item.SuperArgumentNum = dataHsse.SuperArgumentNum; item.TotalEnergyConsumption = dataHsse.TotalEnergyConsumption; item.TotalWorkingHour = dataHsse.TotalWorkingHour; item.TrainPersonNum = dataHsse.TrainPersonNum; @@ -234,6 +245,7 @@ namespace BLL var hsseDataItems = new List { item }; data.HSSEDataItems = hsseDataItems; return data; + } public static HSSEData GetItemByHSSEData_HSSE(HSSEData_HSSE dataHsse, @@ -253,6 +265,7 @@ namespace BLL item.CompanyComprehensiveCheckNum = dataHsse.CompanyComprehensiveCheckNum; item.CompanyComprehensivePlanNum = dataHsse.CompanyComprehensivePlanNum; item.CompanyDrillNum = dataHsse.CompanyDrillNum; + item.CompanyDrillPersonNum = dataHsse.CompanyDrillPersonNum; item.CompanyLeadShiftCheckNum = dataHsse.CompanyLeadShiftCheckNum; item.CompanyOnSiteDisposalPlan = dataHsse.CompanyOnSiteDisposalPlan; item.CompanySpecialCheckNum = dataHsse.CompanySpecialCheckNum; @@ -263,6 +276,7 @@ namespace BLL item.CostUse = dataHsse.CostUse; item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum; item.FinishedNum = dataHsse.FinishedNum; + item.ArgumentNum = dataHsse.ArgumentNum; item.GeneralAccidentNum = dataHsse.GeneralAccidentNum; item.GeneralClosedNum = dataHsse.GeneralClosedNum; item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum; @@ -288,6 +302,7 @@ namespace BLL item.NewWaterConsumption = dataHsse.NewWaterConsumption; item.ProjectComprehensivePlanNum = dataHsse.ProjectComprehensivePlanNum; item.ProjectDrillNum = dataHsse.ProjectDrillNum; + item.ProjectDrillPersonNum = dataHsse.ProjectDrillPersonNum; item.ProjectFullTimeNum = dataHsse.ProjectFullTimeNum; item.ProjectInspectorGeneralNum = dataHsse.ProjectInspectorGeneralNum; item.ProjectLeadShiftCheckNum = dataHsse.ProjectLeadShiftCheckNum; @@ -308,12 +323,14 @@ namespace BLL item.ShutdownNum = dataHsse.ShutdownNum; item.SpecialEquipmentNum = dataHsse.SpecialEquipmentNum; item.SpecialOperationTrainNum = dataHsse.SpecialOperationTrainNum; + item.HseTechnicalNum = dataHsse.HseTechnicalNum; item.EnvironmentalTrainNum = dataHsse.EnvironmentalTrainNum; item.SpecialSeriousAccidentNum = dataHsse.SpecialSeriousAccidentNum; item.SpecialTrainNum = dataHsse.SpecialTrainNum; item.SuperCompletedNum = dataHsse.SuperCompletedNum; item.SuperConstructionNum = dataHsse.SuperConstructionNum; item.SuperFinishedNum = dataHsse.SuperFinishedNum; + item.SuperArgumentNum = dataHsse.SuperArgumentNum; item.SuperTrainPersonNum = dataHsse.SuperTrainPersonNum; item.TotalEnergyConsumption = dataHsse.TotalEnergyConsumption; item.TotalWorkingHour = dataHsse.TotalWorkingHour; @@ -338,6 +355,7 @@ namespace BLL var hsseDataItems = new List { item }; data.HSSEDataItems = hsseDataItems; return data; + } public static async Task GetTodayHSSEData_HSSE() @@ -633,6 +651,7 @@ namespace BLL var safeTrainTask = HSSEData_HSSEService.GetSafeTrainAsync(); var specialTrainTask = HSSEData_HSSEService.GetSpecialTrainAsync(); var specialOperationTrainTask = HSSEData_HSSEService.GetSpecialOperationTrainAsync(); + var hseTechnicalNumTask = HSSEData_HSSEService.GetHseTechnicalNumAsync(); var headOfficeInspectorGeneralTask = HSSEData_HSSEService.GetHeadOfficeInspectorGeneralAsync(); var headOfficeFullTimeTask = HSSEData_HSSEService.GetHeadOfficeFullTimeAsync(); var branchInspectorGeneralTask = HSSEData_HSSEService.GetBranchInspectorGeneralAsync(); @@ -690,7 +709,7 @@ namespace BLL safeWorkingHourTask, safeTrainTask, specialTrainTask, - specialOperationTrainTask, + specialOperationTrainTask, hseTechnicalNumTask, headOfficeInspectorGeneralTask, headOfficeFullTimeTask, branchInspectorGeneralTask, @@ -751,6 +770,7 @@ namespace BLL var safeTrainList = await safeTrainTask; var specialTrainList = await specialTrainTask; var specialOperationTrainList = await specialOperationTrainTask; + var hseTechnicalNum = await hseTechnicalNumTask; var headOfficeInspectorGeneralList = await headOfficeInspectorGeneralTask; var headOfficeFullTimeList = await headOfficeFullTimeTask; var branchInspectorGeneralList = await branchInspectorGeneralTask; @@ -812,6 +832,7 @@ namespace BLL SafeTrainNum = safeTrainList.Sum(x => x.TrainPersonNum), SpecialTrainNum = specialTrainList.Sum(x => x.TrainPersonNum), SpecialOperationTrainNum = specialOperationTrainList.Sum(x => x.TrainPersonNum), + HseTechnicalNum = hseTechnicalNum, EnvironmentalTrainNum = 0, TotalEnergyConsumption = totalEnergyConsumption, IncomeComprehensiveEnergyConsumption = incomeComprehensiveEnergyConsumption, @@ -843,10 +864,12 @@ namespace BLL CompanySpecialPlanNum = companySpecialPlanList.Count(), CompanyOnSiteDisposalPlan = companyOnSiteDisposalPlanList.Count(), CompanyDrillNum = companyDrillList.Count(), + CompanyDrillPersonNum = companyDrillList.Sum(x => x.JointPersonNum), ProjectComprehensivePlanNum = projectComprehensivePlanList.Count(), ProjectSpecialPlanNum = projectSpecialPlanList.Count(), ProjectOnSiteDisposalPlan = projectOnSiteDisposalPlanList.Count(), ProjectDrillNum = projectDrillList.Count(), + ProjectDrillPersonNum = projectDrillList.Sum(x => x.JointPersonNum), CostExtract = Convert.ToInt32(costExtract.Sum(x => x.SUMCost)), CostUse = Convert.ToInt32(costUseList.Sum(x => x.SUMCost)), UseEquipmentNum = useEquipmentList.Count(), @@ -865,16 +888,67 @@ namespace BLL TrainPersonNum = largeEngineeringOutputsTask.Result.Sum(x => x.TrainPersonNum), ConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.ConstructionNum), FinishedNum = largeEngineeringOutputsTask.Result.Sum(x => x.FinishedNum), + ArgumentNum = largeEngineeringOutputsTask.Result.Sum(x => x.ArgumentNum), SuperCompletedNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperCompletedNum), SuperTrainPersonNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperTrainPersonNum), - SuperConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperConstructionNum) + SuperConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperConstructionNum), + SuperFinishedNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperFinishedNum), + SuperArgumentNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperArgumentNum) }; #region 添加项目统计数据 Project_HSSEData_HSSEService.DeleteProject_HSSEData_HSSEByDate(DateTime.Now.Date); + + var generalHiddenRectificationOutputsDict = generalHiddenRectificationOutputsList + .GroupBy(x => x.ProjectId) + .ToDictionary( + g => g.Key, + g => new { ClosedNum = g.Sum(x => x.RecNum), NotClosedNum = g.Sum(x => x.NoRecNum) } + ); + var majorHiddenRectificationOutputsDict = majorHiddenRectificationOutputsList + .GroupBy(x => x.ProjectId) + .ToDictionary( + g => g.Key, + g => new { ClosedNum = g.Sum(x => x.RecNum), NotClosedNum = g.Sum(x => x.NoRecNum) } + ); + var securityRiskOutputList = securityRiskOutputListTask.Result; + var securityRiskOutputDict = securityRiskOutputList + .GroupBy(x => x.ProjectId) + .ToDictionary( + g => g.Key, + g => new + { + LowRiskNum = g.Sum(x => x.LowRiskNum), + GeneralRiskNum = g.Sum(x => x.GeneralRiskNum), + MediumRiskNum = g.Sum(x => x.MediumRiskNum), + HighRiskNum = g.Sum(x => x.HighRiskNum) + } + ); + var largeEngineeringOutputList = largeEngineeringOutputsTask.Result; + var largeEngineeringOutputsDict = largeEngineeringOutputList + .GroupBy(x => x.ProjectId) + .ToDictionary( + g => g.Key, + g => new + { + CompletedNum = g.Sum(x => x.CompletedNum), + TrainPersonNum = g.Sum(x => x.TrainPersonNum), + ConstructionNum = g.Sum(x => x.ConstructionNum), + FinishedNum = g.Sum(x => x.FinishedNum), + ArgumentNum = g.Sum(x => x.ArgumentNum), + SuperCompletedNum = g.Sum(x => x.SuperCompletedNum), + SuperTrainPersonNum = g.Sum(x => x.SuperTrainPersonNum), + SuperConstructionNum = g.Sum(x => x.SuperConstructionNum), + SuperArgumentNum = g.Sum(x => x.SuperArgumentNum) + } + ); foreach (var projectid in BeUnderConstructionList) { + generalHiddenRectificationOutputsDict.TryGetValue(projectid, out var generalHiddenRectificationOutputs); + majorHiddenRectificationOutputsDict.TryGetValue(projectid, out var majorHiddenRectificationOutputs); + securityRiskOutputDict.TryGetValue(projectid, out var securityRiskOutputs); + largeEngineeringOutputsDict.TryGetValue(projectid, out var largeEngineeringOutputs); var projectHsseData = new Project_HSSEData_HSSE { Id = SQLHelper.GetNewID(), @@ -891,6 +965,7 @@ namespace BLL SafeTrainNum = safeTrainList.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 = hseTechnicalNum, EnvironmentalTrainNum = 0, TotalEnergyConsumption = 0, IncomeComprehensiveEnergyConsumption = 0, @@ -925,31 +1000,35 @@ namespace BLL CompanySpecialPlanNum = 0, CompanyOnSiteDisposalPlan = 0, CompanyDrillNum = 0, + CompanyDrillPersonNum = 0, ProjectComprehensivePlanNum = projectComprehensivePlanList.Count(x => x.ProjectId == projectid), ProjectSpecialPlanNum = projectSpecialPlanList.Count(x => x.ProjectId == projectid), ProjectOnSiteDisposalPlan = projectOnSiteDisposalPlanList.Count(x => x.ProjectId == projectid), ProjectDrillNum = projectDrillList.Count(x => x.ProjectId == projectid), + ProjectDrillPersonNum = projectDrillList.Where(x => x.ProjectId == projectid).Sum(x => x.JointPersonNum), CostExtract = Convert.ToInt32(costExtract.Where(x => x.ProjectId == projectid).Sum(x => x.SUMCost)), CostUse = Convert.ToInt32(costUseList.Where(x => x.ProjectId == projectid).Sum(x => x.SUMCost)), UseEquipmentNum = useEquipmentList.Count(x => x.ProjectId == projectid), SpecialEquipmentNum = specialEquipmentList.Count(x => x.ProjectId == projectid), LicensesNum = licensesList.Count(x => x.ProjectId == projectid), LicensesCloseNum = licensesCloseList.Count(x => x.ProjectId == projectid), - GeneralClosedNum = generalHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.RecNum), - GeneralNotClosedNum = generalHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.NoRecNum), - MajorClosedNum = majorHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.RecNum), - MajorNotClosedNum = majorHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.NoRecNum), - LowRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.LowRiskNum), - GeneralRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.GeneralRiskNum), - MediumRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.MediumRiskNum), - HighRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.HighRiskNum), - CompletedNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.CompletedNum), - TrainPersonNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum), - ConstructionNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.ConstructionNum), - FinishedNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.FinishedNum), - SuperCompletedNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.SuperCompletedNum), - SuperTrainPersonNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.SuperTrainPersonNum), - SuperConstructionNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.SuperConstructionNum) + GeneralClosedNum = generalHiddenRectificationOutputs?.ClosedNum ?? 0, + GeneralNotClosedNum = generalHiddenRectificationOutputs?.NotClosedNum ?? 0, + MajorClosedNum = majorHiddenRectificationOutputs?.ClosedNum ?? 0, + MajorNotClosedNum = majorHiddenRectificationOutputs?.NotClosedNum ?? 0, + LowRiskNum = securityRiskOutputs?.LowRiskNum ?? 0, + GeneralRiskNum = securityRiskOutputs?.GeneralRiskNum ?? 0, + MediumRiskNum = securityRiskOutputs?.MediumRiskNum ?? 0, + HighRiskNum = securityRiskOutputs?.HighRiskNum ?? 0, + CompletedNum = largeEngineeringOutputs?.CompletedNum ?? 0, + TrainPersonNum = largeEngineeringOutputs?.TrainPersonNum ?? 0, + ConstructionNum = largeEngineeringOutputs?.ConstructionNum ?? 0, + FinishedNum = largeEngineeringOutputs?.FinishedNum ?? 0, + ArgumentNum = largeEngineeringOutputs?.ArgumentNum ?? 0, + SuperCompletedNum = largeEngineeringOutputs?.SuperCompletedNum ?? 0, + SuperTrainPersonNum = largeEngineeringOutputs?.SuperTrainPersonNum ?? 0, + SuperConstructionNum = largeEngineeringOutputs?.SuperConstructionNum ?? 0, + SuperArgumentNum = largeEngineeringOutputs?.SuperArgumentNum ?? 0 }; Project_HSSEData_HSSEService.AddProject_HSSEData_HSSE(projectHsseData); } @@ -971,6 +1050,7 @@ namespace BLL var data = GetItemByHSSEData_HSSE(table, Project_HSSEData_HiddenDangerDetailService.GetTodayModel()); return data; + } //public static HSSEData StatisticalDataOld() @@ -1109,6 +1189,7 @@ namespace BLL table.SafeTrainNum = newtable.SafeTrainNum; table.SpecialTrainNum = newtable.SpecialTrainNum; table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum; + table.HseTechnicalNum = newtable.HseTechnicalNum; table.EnvironmentalTrainNum = newtable.EnvironmentalTrainNum; table.TotalEnergyConsumption = newtable.TotalEnergyConsumption; table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption; @@ -1144,10 +1225,12 @@ namespace BLL table.CompanySpecialPlanNum = newtable.CompanySpecialPlanNum; table.CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan; table.CompanyDrillNum = newtable.CompanyDrillNum; + table.CompanyDrillPersonNum = newtable.CompanyDrillPersonNum; table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum; table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum; table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan; table.ProjectDrillNum = newtable.ProjectDrillNum; + table.ProjectDrillPersonNum = newtable.ProjectDrillPersonNum; table.CostExtract = newtable.CostExtract; table.CostUse = newtable.CostUse; table.UseEquipmentNum = newtable.UseEquipmentNum; @@ -1166,19 +1249,45 @@ namespace BLL table.TrainPersonNum = newtable.TrainPersonNum; table.ConstructionNum = newtable.ConstructionNum; table.FinishedNum = newtable.FinishedNum; + table.ArgumentNum = newtable.ArgumentNum; table.SuperCompletedNum = newtable.SuperCompletedNum; table.SuperTrainPersonNum = newtable.SuperTrainPersonNum; table.SuperConstructionNum = newtable.SuperConstructionNum; table.SuperFinishedNum = newtable.SuperFinishedNum; + table.SuperArgumentNum = newtable.SuperArgumentNum; table.State = newtable.State; table.CreateMan = newtable.CreateMan; table.CreateDate = newtable.CreateDate; db.SubmitChanges(); } } + } + /// + /// 获取安全技术交底数 + /// + /// + public static int GetHseTechnicalNum() + { + var list = (from x in Funs.DB.License_HSETechnical + where BeUnderConstructionList.Contains(x.ProjectId) + select x).Distinct().ToList(); + var result = list.ToList().Count(); + return result; + + } + /// + /// 获取安全技术交底数(异步) + /// + /// + public static async Task GetHseTechnicalNumAsync() + { + return await Task.Run(GetHseTechnicalNum); + + } + #region 安监人员数据 @@ -3513,13 +3622,15 @@ namespace BLL TrainPersonNum = gg.Where(x => x.IsSuperLargerHazard == false).Sum(x => x.TrainPersonNum) ?? 0, ConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == false), FinishedNum = gg.Count(x => x.States == "3" && x.IsSuperLargerHazard == false), + ArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == false), SuperCompletedNum = gg.Count(x => x.States == "1" && x.IsSuperLargerHazard == true), SuperTrainPersonNum = gg.Where(x => x.IsSuperLargerHazard == true).Sum(x => x.TrainPersonNum) ?? 0, SuperConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == true), SuperFinishedNum = gg.Count(x => x.States == "3" && x.IsSuperLargerHazard == true), - + SuperArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == true), }).ToList(); return query; + } public static async Task> GetLargeEngineeringOutputsAsync() { @@ -3690,6 +3801,7 @@ namespace BLL x.SafeTrainNum, x.SpecialTrainNum, x.SpecialOperationTrainNum, + x.HseTechnicalNum, x.EnvironmentalTrainNum, x.TotalEnergyConsumption, x.IncomeComprehensiveEnergyConsumption, @@ -3725,10 +3837,12 @@ namespace BLL x.CompanySpecialPlanNum, x.CompanyOnSiteDisposalPlan, x.CompanyDrillNum, + x.CompanyDrillPersonNum, x.ProjectComprehensivePlanNum, x.ProjectSpecialPlanNum, x.ProjectOnSiteDisposalPlan, x.ProjectDrillNum, + x.ProjectDrillPersonNum, x.CostExtract, x.CostUse, x.UseEquipmentNum, @@ -3747,14 +3861,17 @@ namespace BLL x.TrainPersonNum, x.ConstructionNum, x.FinishedNum, + x.ArgumentNum, x.SuperCompletedNum, x.SuperTrainPersonNum, x.SuperConstructionNum, x.SuperFinishedNum, + x.SuperArgumentNum, x.State, x.CreateDate, x.CreateMan }; + } #endregion 获取列表 diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs index a434a107..c49db370 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs @@ -7,12 +7,14 @@ using System.Linq; using System.Text; using Model; using Newtonsoft.Json; +using Microsoft.SqlServer.Dts.Runtime; namespace BLL { public static class Project_CQMSDataService { + public static Model.SGGLDB db = Funs.DB; /// /// CQMS数据类型 /// @@ -47,6 +49,18 @@ namespace BLL /// ProjectDivision, /// + /// 报验数据 + /// + Inspection, + /// + /// 施工方案数据 + /// + ConstructSolution, + /// + /// 特种设备质保体系和图纸会审/设计交底 + /// + SpecialEquipmentAndDesignDetails, + /// /// 全部数据 /// All @@ -63,7 +77,7 @@ namespace BLL } public static List GetProject_CQMSData_CQMSByModle(Model.Project_CQMSData_CQMS table) { - var q = from x in Funs.DB.Project_CQMSData_CQMS + var q = from x in db.Project_CQMSData_CQMS where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) && @@ -140,11 +154,11 @@ namespace BLL /// public static Model.Project_CQMSData_CQMS GetProject_CQMSData_CQMSById(string Id) { - return Funs.DB.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id); + return db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id); } public static List GetProject_CQMSData_CQMSByprojectid(string projectid) { - var q = (from x in Funs.DB.Project_CQMSData_CQMS + var q = (from x in db.Project_CQMSData_CQMS where x.ProjectId == projectid select x).ToList(); return q; @@ -194,6 +208,25 @@ namespace BLL SubProjectNum = newtable.SubProjectNum, SubdivisionalWorksNum = newtable.SubdivisionalWorksNum, InspectionLotNum = newtable.InspectionLotNum, + EquipmentInspectionNum = newtable.EquipmentInspectionNum, + EquipmentInspectionQualifiedNum = newtable.EquipmentInspectionQualifiedNum, + MachineInspectionNum = newtable.MachineInspectionNum, + MachineInspectionQualifiedNum = newtable.MachineInspectionQualifiedNum, + PersonInspectionNum = newtable.PersonInspectionNum, + PersonInspectionQualifiedNum = newtable.PersonInspectionQualifiedNum, + MaterialInspectionNum = newtable.MaterialInspectionNum, + MaterialInspectionQualifiedNum = newtable.MaterialInspectionQualifiedNum, + ConstructSolutionNum = newtable.ConstructSolutionNum, + ConstructSolutionProjectApproveNum = newtable.ConstructSolutionProjectApproveNum, + ConstructSolutionUnitApproveNum = newtable.ConstructSolutionUnitApproveNum, + SpecialEquipmentQualityAssuranceSystemNum = newtable.SpecialEquipmentQualityAssuranceSystemNum, + DesignDetailsNum = newtable.DesignDetailsNum, + UnitProjectAcceptNum = newtable.UnitProjectAcceptNum, + UnitProjectAcceptOKNum = newtable.UnitProjectAcceptOKNum, + SubProjectAcceptNum = newtable.SubProjectAcceptNum, + SubProjectAcceptOKNum = newtable.SubProjectAcceptOKNum, + SubdivisionalWorksAcceptNum = newtable.SubdivisionalWorksAcceptNum, + SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum }; db.Project_CQMSData_CQMS.InsertOnSubmit(table); db.SubmitChanges(); @@ -246,6 +279,25 @@ namespace BLL table.SubProjectNum = newtable.SubProjectNum; table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum; table.InspectionLotNum = newtable.InspectionLotNum; + table.EquipmentInspectionNum = newtable.EquipmentInspectionNum; + table.EquipmentInspectionQualifiedNum = newtable.EquipmentInspectionQualifiedNum; + table.MachineInspectionNum = newtable.MachineInspectionNum; + table.MachineInspectionQualifiedNum = newtable.MachineInspectionQualifiedNum; + table.PersonInspectionNum = newtable.PersonInspectionNum; + table.PersonInspectionQualifiedNum = newtable.PersonInspectionQualifiedNum; + table.MaterialInspectionNum = newtable.MaterialInspectionNum; + table.MaterialInspectionQualifiedNum = newtable.MaterialInspectionQualifiedNum; + table.ConstructSolutionNum = newtable.ConstructSolutionNum; + table.ConstructSolutionProjectApproveNum = newtable.ConstructSolutionProjectApproveNum; + table.ConstructSolutionUnitApproveNum = newtable.ConstructSolutionUnitApproveNum; + table.SpecialEquipmentQualityAssuranceSystemNum = newtable.SpecialEquipmentQualityAssuranceSystemNum; + table.DesignDetailsNum = newtable.DesignDetailsNum; + table.UnitProjectAcceptNum = newtable.UnitProjectAcceptNum; + table.UnitProjectAcceptOKNum = newtable.UnitProjectAcceptOKNum; + table.SubProjectAcceptNum = newtable.SubProjectAcceptNum; + table.SubProjectAcceptOKNum = newtable.SubProjectAcceptOKNum; + table.SubdivisionalWorksAcceptNum = newtable.SubdivisionalWorksAcceptNum; + table.SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum; db.SubmitChanges(); } } @@ -268,6 +320,20 @@ namespace BLL } } + + + public static void DeleteProject_CQMSData_CQMByDate(DateTime? reportDate) + { + using (var db = new SGGLDB(Funs.ConnString)) + { + var table = db.Project_CQMSData_CQMS.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0); + if (table != null) + { + db.Project_CQMSData_CQMS.DeleteAllOnSubmit(table); + db.SubmitChanges(); + } + } + } /// /// 根据projectid判断当天项目是否已统计数据 /// @@ -321,6 +387,7 @@ namespace BLL StatisticalData(item.ProjectId, CQMSDateType.All); } } + /// /// 统计数据 /// @@ -391,6 +458,13 @@ namespace BLL table.UnitProjectOnesOKNum = GetUnitProjectOnesOKNum(projectid); table.MaterialInRecheckNum = GetMaterialInRecheckNum(projectid); table.MaterialInRecheckOKNum = GetMaterialInRecheckOKNum(projectid); + + table.UnitProjectAcceptNum = GetUnitProjectOnesNum(projectid); + table.UnitProjectAcceptOKNum = GetUnitProjectOnesOKNum(projectid); + table.SubProjectAcceptNum = GetMaterialInRecheckNum(projectid); + table.SubProjectAcceptOKNum = GetMaterialInRecheckOKNum(projectid); + table.SubdivisionalWorksAcceptNum = GetSubdivisionalWorksAcceptNum(projectid); + table.SubdivisionalWorksAcceptOKNum = GetSubdivisionalWorksAcceptOKNum(projectid); } if (cQMSDateType == CQMSDateType.ProjectDivision || cQMSDateType == CQMSDateType.All) { @@ -400,6 +474,28 @@ namespace BLL table.SubdivisionalWorksNum = GetSubdivisionalWorksNum(projectid); table.InspectionLotNum = GetInspectionLotNum(projectid); } + if (cQMSDateType == CQMSDateType.Inspection || cQMSDateType == CQMSDateType.All) + { + table.EquipmentInspectionNum = GetComprehensiveInspectionEquipmentNum(projectid); + table.EquipmentInspectionQualifiedNum = GetComprehensiveInspectionEquipmentOKNum(projectid); + table.MachineInspectionNum = GetComprehensiveInspectionMachineNum(projectid); + table.MachineInspectionQualifiedNum = GetComprehensiveInspectionMachineOKNum(projectid); + table.PersonInspectionNum = GetComprehensiveInspectionPersonNum(projectid); + table.PersonInspectionQualifiedNum = GetComprehensiveInspectionPersonOKNum(projectid); + table.MaterialInspectionNum = GetComprehensiveInspectionMaterialNum(projectid); + table.MaterialInspectionQualifiedNum = GetComprehensiveInspectionMaterialOKNum(projectid); + } + if (cQMSDateType == CQMSDateType.ConstructSolution || cQMSDateType == CQMSDateType.All) + { + table.ConstructSolutionNum = GetConstructSolutionNum(projectid); + table.ConstructSolutionProjectApproveNum = GetConstructSolutionProjectApproveNum(projectid); + table.ConstructSolutionUnitApproveNum = GetConstructSolutionUnitApproveNum(projectid); + } + if (cQMSDateType == CQMSDateType.SpecialEquipmentAndDesignDetails || cQMSDateType == CQMSDateType.All) + { + table.SpecialEquipmentQualityAssuranceSystemNum = GetSpecialEquipmentQualityAssuranceSystemNum(projectid); + table.DesignDetailsNum = GetTechnicalDisclosePersonNum(projectid); + } if (IsReportByToday(projectid)) { @@ -484,7 +580,7 @@ namespace BLL { int result = (from x in Funs.DB.SitePerson_Person join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId - where x.ProjectId == projectid && y.IsCQMS == true && x.States == "1" + where x.ProjectId == projectid && y.IsCQMS == true select x).Count(); return result; } @@ -690,14 +786,40 @@ namespace BLL select x).Count(); return result; } + /// + /// 获取分项工程验收数 + /// + /// + public static int GetSubdivisionalWorksAcceptNum(string projectid) + { + int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + where y.ProjectId == projectid && y.CheckAcceptType == "6" && x.CreateDate > Const.DtmarkTime + select x).Count(); + return result; + } + /// + /// 获取分项工程验收合格数 + /// + /// + public static int GetSubdivisionalWorksAcceptOKNum(string projectid) + { + int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId + join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId + where y.ProjectId == projectid && y.CheckAcceptType == "6" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime + select x).Count(); + return result; + } + /// /// 获取单项工程个数 /// /// public static int GetSingleProjectNum(string projectid) { - int result = (from x in Funs.DB.WBS_UnitWork - where x.ProjectId == projectid + int result = (from x in Funs.DB.ProjectData_MainItem + where x.ProjectId == projectid select x).Count(); return result; } @@ -746,6 +868,148 @@ namespace BLL return result; } + /// + /// 设备报验-报检数 + /// + /// + /// + public static int GetComprehensiveInspectionEquipmentNum(string projectid) + { + int result = (from x in Funs.DB.Check_CheckEquipment + where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime + select x).Count(); + return result; + } + /// + /// 设备报验-报检合格数 + /// + /// + /// + public static int GetComprehensiveInspectionEquipmentOKNum(string projectid) + { + int result = (from x in Funs.DB.Check_CheckEquipment + where x.ProjectId == projectid && x.IsCheckCertificate == true && x.CompileDate > Const.DtmarkTime + select x).Count(); + return result; + } + + /// + /// 获取机具报验-报检数 + /// + /// + /// + public static int GetComprehensiveInspectionMachineNum(string projectid) + { + int result = (from x in Funs.DB.Comprehensive_InspectionMachine + where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime + select x).Count(); + return result; + } + + /// + /// 获取机具报验-报检合格数 + /// + /// + /// + public static int GetComprehensiveInspectionMachineOKNum(string projectid) + { + int result = (from x in Funs.DB.Comprehensive_InspectionMachine + where x.ProjectId == projectid && x.IsCheckOK.HasValue && x.IsCheckOK == true && x.CompileDate > Const.DtmarkTime + select x).Count(); + return result; + } + + /// + /// 获取人员报验-报检数 + /// + /// + public static int GetComprehensiveInspectionPersonNum(string projectid) + { + var result = (from x in Funs.DB.Comprehensive_InspectionPerson + where x.ProjectId == projectid && x.IsOnSite.HasValue && x.CompileDate > Const.DtmarkTime + select x).Count(); + return result; + } + + /// + /// 获取人员报验-报检合格数 + /// + /// + public static int GetComprehensiveInspectionPersonOKNum(string projectid) + { + var result = (from x in Funs.DB.Comprehensive_InspectionPerson + where x.ProjectId == projectid && x.IsOnSite == true && x.CompileDate > Const.DtmarkTime + select x).Count(); + return result; + } + + /// + /// 获取材料报验-报检数 + /// + /// + public static int GetComprehensiveInspectionMaterialNum(string projectid) + { + var result = 0; + return result; + } + + /// + /// 获取材料报验-报检合格数 + /// + /// + public static int GetComprehensiveInspectionMaterialOKNum(string projectid) + { + var result = 0; + return result; + } + + /// + /// 施工方案数量 + /// + /// + /// + public static int GetConstructSolutionNum(string projectid) + { + var result = (from x in Funs.DB.Solution_CQMSConstructSolution + where x.ProjectId == projectid + select x).Count(); + return result; + } + /// + /// 施工方案数量——项目审批数量 + /// + /// + /// + public static int GetConstructSolutionProjectApproveNum(string projectid) + { + var result = (from x in Funs.DB.Solution_CQMSConstructSolution + where x.ProjectId == projectid && x.State == "1" + select x).Count(); + return result; + } + /// + /// 施工方案数量——项目审批数量 + /// + /// + /// + public static int GetConstructSolutionUnitApproveNum(string projectid) + { + var result = 0; + return result; + } + + /// + /// 特种设备质保体系 + /// + /// + /// + public static int GetSpecialEquipmentQualityAssuranceSystemNum(string projectid) + { + var result = 0; + return result; + } + + #region 推送项目质量数据 diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs index de032880..f31d647f 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs @@ -354,11 +354,10 @@ namespace BLL /// public static ReturnData PushProjectHJGLData() { - var db1 = Funs.DB; - var items = (from x in db1.Project_HJGLData_HJGL + var items = (from x in Funs.DB.Project_HJGLData_HJGL where x.ReportDate == DateTime.Now.Date select x).ToList(); - var defectItems = (from x in db1.Project_HJGLData_Defect + var defectItems = (from x in Funs.DB.Project_HJGLData_Defect where x.ReportDate == DateTime.Now.Date select x).ToList(); Model.ReturnData responeData = new Model.ReturnData(); @@ -376,8 +375,22 @@ namespace BLL responeData.message = "当前没有项目焊接数据"; } return responeData; + } #endregion + + public static void DeleteProject_HJGLData_HJGLByDate(DateTime? reportDate) + { + using (var db = new SGGLDB(Funs.ConnString)) + { + var table = db.Project_HJGLData_HJGL.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0); + if (table != null) + { + db.Project_HJGLData_HJGL.DeleteAllOnSubmit(table); + db.SubmitChanges(); + } + } + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 0fbcf266..9165b8d7 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -16583,7 +16583,7 @@ - + diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs index e00d7a24..8eb68518 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs @@ -40,6 +40,7 @@ namespace FineUIPro.Web.ProjectData this.ProjectId = Request.QueryString["ProjectId"]; UnitService.InitBranchUnitDropDownList(this.drpUnit, true, true); + BindGrid(); this.drpUnit.SelectedValue = Const.UnitId_SEDIN; if (!String.IsNullOrEmpty(this.ProjectId)) { diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 2a5f02a6..e69ef43e 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -12155,7 +12155,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ApproveIdea", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ApproveIdea", DbType="NVarChar(2000)")] public string ApproveIdea { get @@ -64106,6 +64106,44 @@ namespace Model private System.Nullable _CreateDate; + private System.Nullable _EquipmentInspectionNum; + + private System.Nullable _EquipmentInspectionQualifiedNum; + + private System.Nullable _MachineInspectionNum; + + private System.Nullable _MachineInspectionQualifiedNum; + + private System.Nullable _PersonInspectionNum; + + private System.Nullable _PersonInspectionQualifiedNum; + + private System.Nullable _MaterialInspectionNum; + + private System.Nullable _MaterialInspectionQualifiedNum; + + private System.Nullable _ConstructSolutionNum; + + private System.Nullable _ConstructSolutionProjectApproveNum; + + private System.Nullable _ConstructSolutionUnitApproveNum; + + private System.Nullable _SpecialEquipmentQualityAssuranceSystemNum; + + private System.Nullable _DesignDetailsNum; + + private System.Nullable _UnitProjectAcceptNum; + + private System.Nullable _UnitProjectAcceptOKNum; + + private System.Nullable _SubProjectAcceptNum; + + private System.Nullable _SubProjectAcceptOKNum; + + private System.Nullable _SubdivisionalWorksAcceptNum; + + private System.Nullable _SubdivisionalWorksAcceptOKNum; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -64184,6 +64222,44 @@ namespace Model partial void OnCreateManChanged(); partial void OnCreateDateChanging(System.Nullable value); partial void OnCreateDateChanged(); + partial void OnEquipmentInspectionNumChanging(System.Nullable value); + partial void OnEquipmentInspectionNumChanged(); + partial void OnEquipmentInspectionQualifiedNumChanging(System.Nullable value); + partial void OnEquipmentInspectionQualifiedNumChanged(); + partial void OnMachineInspectionNumChanging(System.Nullable value); + partial void OnMachineInspectionNumChanged(); + partial void OnMachineInspectionQualifiedNumChanging(System.Nullable value); + partial void OnMachineInspectionQualifiedNumChanged(); + partial void OnPersonInspectionNumChanging(System.Nullable value); + partial void OnPersonInspectionNumChanged(); + partial void OnPersonInspectionQualifiedNumChanging(System.Nullable value); + partial void OnPersonInspectionQualifiedNumChanged(); + partial void OnMaterialInspectionNumChanging(System.Nullable value); + partial void OnMaterialInspectionNumChanged(); + partial void OnMaterialInspectionQualifiedNumChanging(System.Nullable value); + partial void OnMaterialInspectionQualifiedNumChanged(); + partial void OnConstructSolutionNumChanging(System.Nullable value); + partial void OnConstructSolutionNumChanged(); + partial void OnConstructSolutionProjectApproveNumChanging(System.Nullable value); + partial void OnConstructSolutionProjectApproveNumChanged(); + partial void OnConstructSolutionUnitApproveNumChanging(System.Nullable value); + partial void OnConstructSolutionUnitApproveNumChanged(); + partial void OnSpecialEquipmentQualityAssuranceSystemNumChanging(System.Nullable value); + partial void OnSpecialEquipmentQualityAssuranceSystemNumChanged(); + partial void OnDesignDetailsNumChanging(System.Nullable value); + partial void OnDesignDetailsNumChanged(); + partial void OnUnitProjectAcceptNumChanging(System.Nullable value); + partial void OnUnitProjectAcceptNumChanged(); + partial void OnUnitProjectAcceptOKNumChanging(System.Nullable value); + partial void OnUnitProjectAcceptOKNumChanged(); + partial void OnSubProjectAcceptNumChanging(System.Nullable value); + partial void OnSubProjectAcceptNumChanged(); + partial void OnSubProjectAcceptOKNumChanging(System.Nullable value); + partial void OnSubProjectAcceptOKNumChanged(); + partial void OnSubdivisionalWorksAcceptNumChanging(System.Nullable value); + partial void OnSubdivisionalWorksAcceptNumChanged(); + partial void OnSubdivisionalWorksAcceptOKNumChanging(System.Nullable value); + partial void OnSubdivisionalWorksAcceptOKNumChanged(); #endregion public CQMSData_CQMS() @@ -64931,6 +65007,386 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EquipmentInspectionNum", DbType="Int")] + public System.Nullable EquipmentInspectionNum + { + get + { + return this._EquipmentInspectionNum; + } + set + { + if ((this._EquipmentInspectionNum != value)) + { + this.OnEquipmentInspectionNumChanging(value); + this.SendPropertyChanging(); + this._EquipmentInspectionNum = value; + this.SendPropertyChanged("EquipmentInspectionNum"); + this.OnEquipmentInspectionNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EquipmentInspectionQualifiedNum", DbType="Int")] + public System.Nullable EquipmentInspectionQualifiedNum + { + get + { + return this._EquipmentInspectionQualifiedNum; + } + set + { + if ((this._EquipmentInspectionQualifiedNum != value)) + { + this.OnEquipmentInspectionQualifiedNumChanging(value); + this.SendPropertyChanging(); + this._EquipmentInspectionQualifiedNum = value; + this.SendPropertyChanged("EquipmentInspectionQualifiedNum"); + this.OnEquipmentInspectionQualifiedNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MachineInspectionNum", DbType="Int")] + public System.Nullable MachineInspectionNum + { + get + { + return this._MachineInspectionNum; + } + set + { + if ((this._MachineInspectionNum != value)) + { + this.OnMachineInspectionNumChanging(value); + this.SendPropertyChanging(); + this._MachineInspectionNum = value; + this.SendPropertyChanged("MachineInspectionNum"); + this.OnMachineInspectionNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MachineInspectionQualifiedNum", DbType="Int")] + public System.Nullable MachineInspectionQualifiedNum + { + get + { + return this._MachineInspectionQualifiedNum; + } + set + { + if ((this._MachineInspectionQualifiedNum != value)) + { + this.OnMachineInspectionQualifiedNumChanging(value); + this.SendPropertyChanging(); + this._MachineInspectionQualifiedNum = value; + this.SendPropertyChanged("MachineInspectionQualifiedNum"); + this.OnMachineInspectionQualifiedNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PersonInspectionNum", DbType="Int")] + public System.Nullable PersonInspectionNum + { + get + { + return this._PersonInspectionNum; + } + set + { + if ((this._PersonInspectionNum != value)) + { + this.OnPersonInspectionNumChanging(value); + this.SendPropertyChanging(); + this._PersonInspectionNum = value; + this.SendPropertyChanged("PersonInspectionNum"); + this.OnPersonInspectionNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PersonInspectionQualifiedNum", DbType="Int")] + public System.Nullable PersonInspectionQualifiedNum + { + get + { + return this._PersonInspectionQualifiedNum; + } + set + { + if ((this._PersonInspectionQualifiedNum != value)) + { + this.OnPersonInspectionQualifiedNumChanging(value); + this.SendPropertyChanging(); + this._PersonInspectionQualifiedNum = value; + this.SendPropertyChanged("PersonInspectionQualifiedNum"); + this.OnPersonInspectionQualifiedNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialInspectionNum", DbType="Int")] + public System.Nullable MaterialInspectionNum + { + get + { + return this._MaterialInspectionNum; + } + set + { + if ((this._MaterialInspectionNum != value)) + { + this.OnMaterialInspectionNumChanging(value); + this.SendPropertyChanging(); + this._MaterialInspectionNum = value; + this.SendPropertyChanged("MaterialInspectionNum"); + this.OnMaterialInspectionNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialInspectionQualifiedNum", DbType="Int")] + public System.Nullable MaterialInspectionQualifiedNum + { + get + { + return this._MaterialInspectionQualifiedNum; + } + set + { + if ((this._MaterialInspectionQualifiedNum != value)) + { + this.OnMaterialInspectionQualifiedNumChanging(value); + this.SendPropertyChanging(); + this._MaterialInspectionQualifiedNum = value; + this.SendPropertyChanged("MaterialInspectionQualifiedNum"); + this.OnMaterialInspectionQualifiedNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructSolutionNum", DbType="Int")] + public System.Nullable ConstructSolutionNum + { + get + { + return this._ConstructSolutionNum; + } + set + { + if ((this._ConstructSolutionNum != value)) + { + this.OnConstructSolutionNumChanging(value); + this.SendPropertyChanging(); + this._ConstructSolutionNum = value; + this.SendPropertyChanged("ConstructSolutionNum"); + this.OnConstructSolutionNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructSolutionProjectApproveNum", DbType="Int")] + public System.Nullable ConstructSolutionProjectApproveNum + { + get + { + return this._ConstructSolutionProjectApproveNum; + } + set + { + if ((this._ConstructSolutionProjectApproveNum != value)) + { + this.OnConstructSolutionProjectApproveNumChanging(value); + this.SendPropertyChanging(); + this._ConstructSolutionProjectApproveNum = value; + this.SendPropertyChanged("ConstructSolutionProjectApproveNum"); + this.OnConstructSolutionProjectApproveNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructSolutionUnitApproveNum", DbType="Int")] + public System.Nullable ConstructSolutionUnitApproveNum + { + get + { + return this._ConstructSolutionUnitApproveNum; + } + set + { + if ((this._ConstructSolutionUnitApproveNum != value)) + { + this.OnConstructSolutionUnitApproveNumChanging(value); + this.SendPropertyChanging(); + this._ConstructSolutionUnitApproveNum = value; + this.SendPropertyChanged("ConstructSolutionUnitApproveNum"); + this.OnConstructSolutionUnitApproveNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SpecialEquipmentQualityAssuranceSystemNum", DbType="Int")] + public System.Nullable SpecialEquipmentQualityAssuranceSystemNum + { + get + { + return this._SpecialEquipmentQualityAssuranceSystemNum; + } + set + { + if ((this._SpecialEquipmentQualityAssuranceSystemNum != value)) + { + this.OnSpecialEquipmentQualityAssuranceSystemNumChanging(value); + this.SendPropertyChanging(); + this._SpecialEquipmentQualityAssuranceSystemNum = value; + this.SendPropertyChanged("SpecialEquipmentQualityAssuranceSystemNum"); + this.OnSpecialEquipmentQualityAssuranceSystemNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DesignDetailsNum", DbType="Int")] + public System.Nullable DesignDetailsNum + { + get + { + return this._DesignDetailsNum; + } + set + { + if ((this._DesignDetailsNum != value)) + { + this.OnDesignDetailsNumChanging(value); + this.SendPropertyChanging(); + this._DesignDetailsNum = value; + this.SendPropertyChanged("DesignDetailsNum"); + this.OnDesignDetailsNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitProjectAcceptNum", DbType="Int")] + public System.Nullable UnitProjectAcceptNum + { + get + { + return this._UnitProjectAcceptNum; + } + set + { + if ((this._UnitProjectAcceptNum != value)) + { + this.OnUnitProjectAcceptNumChanging(value); + this.SendPropertyChanging(); + this._UnitProjectAcceptNum = value; + this.SendPropertyChanged("UnitProjectAcceptNum"); + this.OnUnitProjectAcceptNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitProjectAcceptOKNum", DbType="Int")] + public System.Nullable UnitProjectAcceptOKNum + { + get + { + return this._UnitProjectAcceptOKNum; + } + set + { + if ((this._UnitProjectAcceptOKNum != value)) + { + this.OnUnitProjectAcceptOKNumChanging(value); + this.SendPropertyChanging(); + this._UnitProjectAcceptOKNum = value; + this.SendPropertyChanged("UnitProjectAcceptOKNum"); + this.OnUnitProjectAcceptOKNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubProjectAcceptNum", DbType="Int")] + public System.Nullable SubProjectAcceptNum + { + get + { + return this._SubProjectAcceptNum; + } + set + { + if ((this._SubProjectAcceptNum != value)) + { + this.OnSubProjectAcceptNumChanging(value); + this.SendPropertyChanging(); + this._SubProjectAcceptNum = value; + this.SendPropertyChanged("SubProjectAcceptNum"); + this.OnSubProjectAcceptNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubProjectAcceptOKNum", DbType="Int")] + public System.Nullable SubProjectAcceptOKNum + { + get + { + return this._SubProjectAcceptOKNum; + } + set + { + if ((this._SubProjectAcceptOKNum != value)) + { + this.OnSubProjectAcceptOKNumChanging(value); + this.SendPropertyChanging(); + this._SubProjectAcceptOKNum = value; + this.SendPropertyChanged("SubProjectAcceptOKNum"); + this.OnSubProjectAcceptOKNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubdivisionalWorksAcceptNum", DbType="Int")] + public System.Nullable SubdivisionalWorksAcceptNum + { + get + { + return this._SubdivisionalWorksAcceptNum; + } + set + { + if ((this._SubdivisionalWorksAcceptNum != value)) + { + this.OnSubdivisionalWorksAcceptNumChanging(value); + this.SendPropertyChanging(); + this._SubdivisionalWorksAcceptNum = value; + this.SendPropertyChanged("SubdivisionalWorksAcceptNum"); + this.OnSubdivisionalWorksAcceptNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubdivisionalWorksAcceptOKNum", DbType="Int")] + public System.Nullable SubdivisionalWorksAcceptOKNum + { + get + { + return this._SubdivisionalWorksAcceptOKNum; + } + set + { + if ((this._SubdivisionalWorksAcceptOKNum != value)) + { + this.OnSubdivisionalWorksAcceptOKNumChanging(value); + this.SendPropertyChanging(); + this._SubdivisionalWorksAcceptOKNum = value; + this.SendPropertyChanged("SubdivisionalWorksAcceptOKNum"); + this.OnSubdivisionalWorksAcceptOKNumChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -95298,10 +95754,10 @@ namespace Model private string _TrainNumber; - private string _TrainNumberId; - private System.Nullable _TypeInt; + private string _TrainNumberId; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -95330,10 +95786,10 @@ namespace Model partial void OnReceiveDateChanged(); partial void OnTrainNumberChanging(string value); partial void OnTrainNumberChanged(); - partial void OnTrainNumberIdChanging(string value); - partial void OnTrainNumberIdChanged(); partial void OnTypeIntChanging(System.Nullable value); partial void OnTypeIntChanged(); + partial void OnTrainNumberIdChanging(string value); + partial void OnTrainNumberIdChanged(); #endregion public HJGL_PackagingManage() @@ -95581,26 +96037,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TrainNumberId", DbType="VarChar(50)")] - public string TrainNumberId - { - get - { - return this._TrainNumberId; - } - set - { - if ((this._TrainNumberId != value)) - { - this.OnTrainNumberIdChanging(value); - this.SendPropertyChanging(); - this._TrainNumberId = value; - this.SendPropertyChanged("TrainNumberId"); - this.OnTrainNumberIdChanged(); - } - } - } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TypeInt", DbType="Int")] public System.Nullable TypeInt { @@ -95621,6 +96057,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TrainNumberId", DbType="VarChar(50)")] + public string TrainNumberId + { + get + { + return this._TrainNumberId; + } + set + { + if ((this._TrainNumberId != value)) + { + this.OnTrainNumberIdChanging(value); + this.SendPropertyChanging(); + this._TrainNumberId = value; + this.SendPropertyChanged("TrainNumberId"); + this.OnTrainNumberIdChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -100308,7 +100764,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalPriority", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalPriority", DbType="NVarChar(50)")] public string TotalPriority { get @@ -106668,7 +107124,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Rectification", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Rectification", DbType="NVarChar(500)")] public string Rectification { get @@ -106794,7 +107250,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Measures", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Measures", DbType="NVarChar(500)")] public string Measures { get @@ -108945,6 +109401,16 @@ namespace Model private System.Nullable _EnvironmentalTrainNum; + private System.Nullable _HseTechnicalNum; + + private System.Nullable _ArgumentNum; + + private System.Nullable _SuperArgumentNum; + + private System.Nullable _ProjectDrillPersonNum; + + private System.Nullable _CompanyDrillPersonNum; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -109107,6 +109573,16 @@ namespace Model partial void OnCreateDateChanged(); partial void OnEnvironmentalTrainNumChanging(System.Nullable value); partial void OnEnvironmentalTrainNumChanged(); + partial void OnHseTechnicalNumChanging(System.Nullable value); + partial void OnHseTechnicalNumChanged(); + partial void OnArgumentNumChanging(System.Nullable value); + partial void OnArgumentNumChanged(); + partial void OnSuperArgumentNumChanging(System.Nullable value); + partial void OnSuperArgumentNumChanged(); + partial void OnProjectDrillPersonNumChanging(System.Nullable value); + partial void OnProjectDrillPersonNumChanged(); + partial void OnCompanyDrillPersonNumChanging(System.Nullable value); + partial void OnCompanyDrillPersonNumChanged(); #endregion public HSSEData_HSSE() @@ -110694,6 +111170,106 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HseTechnicalNum", DbType="Int")] + public System.Nullable HseTechnicalNum + { + get + { + return this._HseTechnicalNum; + } + set + { + if ((this._HseTechnicalNum != value)) + { + this.OnHseTechnicalNumChanging(value); + this.SendPropertyChanging(); + this._HseTechnicalNum = value; + this.SendPropertyChanged("HseTechnicalNum"); + this.OnHseTechnicalNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ArgumentNum", DbType="Int")] + public System.Nullable ArgumentNum + { + get + { + return this._ArgumentNum; + } + set + { + if ((this._ArgumentNum != value)) + { + this.OnArgumentNumChanging(value); + this.SendPropertyChanging(); + this._ArgumentNum = value; + this.SendPropertyChanged("ArgumentNum"); + this.OnArgumentNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SuperArgumentNum", DbType="Int")] + public System.Nullable SuperArgumentNum + { + get + { + return this._SuperArgumentNum; + } + set + { + if ((this._SuperArgumentNum != value)) + { + this.OnSuperArgumentNumChanging(value); + this.SendPropertyChanging(); + this._SuperArgumentNum = value; + this.SendPropertyChanged("SuperArgumentNum"); + this.OnSuperArgumentNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectDrillPersonNum", DbType="Int")] + public System.Nullable ProjectDrillPersonNum + { + get + { + return this._ProjectDrillPersonNum; + } + set + { + if ((this._ProjectDrillPersonNum != value)) + { + this.OnProjectDrillPersonNumChanging(value); + this.SendPropertyChanging(); + this._ProjectDrillPersonNum = value; + this.SendPropertyChanged("ProjectDrillPersonNum"); + this.OnProjectDrillPersonNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompanyDrillPersonNum", DbType="Int")] + public System.Nullable CompanyDrillPersonNum + { + get + { + return this._CompanyDrillPersonNum; + } + set + { + if ((this._CompanyDrillPersonNum != value)) + { + this.OnCompanyDrillPersonNumChanging(value); + this.SendPropertyChanging(); + this._CompanyDrillPersonNum = value; + this.SendPropertyChanged("CompanyDrillPersonNum"); + this.OnCompanyDrillPersonNumChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -158909,7 +159485,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttentPerson", DbType="NVarChar(500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttentPerson", DbType="NVarChar(3000)")] public string AttentPerson { get @@ -189892,7 +190468,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectDescription", DbType="VarChar(255)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectDescription", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)] public string ProjectDescription { get @@ -190012,7 +190588,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CalculationRule", DbType="VarChar(255)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CalculationRule", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)] public string CalculationRule { get @@ -190072,7 +190648,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionSubcontractor", DbType="VarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionSubcontractor", DbType="VarChar(100)")] public string ConstructionSubcontractor { get @@ -190456,7 +191032,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageEstimate", DbType="Decimal(18,2)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageEstimate", DbType="Decimal(18,3)")] public System.Nullable WorkPackageEstimate { get @@ -190761,6 +191337,16 @@ namespace Model private string _ProjectId; + private string _ContractId; + + private string _OrderCode; + + private System.Nullable _OrderInDate; + + private System.Nullable _OrderOutDate; + + private string _MaterialRequisitionUnit; + private System.Nullable _State; private string _InvoiceCode; @@ -190789,16 +191375,6 @@ namespace Model private string _CreateUser; - private string _ContractId; - - private System.Nullable _OrderInDate; - - private string _OrderCode; - - private System.Nullable _OrderOutDate; - - private string _MaterialRequisitionUnit; - #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -190807,6 +191383,16 @@ namespace Model partial void OnInvoiceIdChanged(); partial void OnProjectIdChanging(string value); partial void OnProjectIdChanged(); + partial void OnContractIdChanging(string value); + partial void OnContractIdChanged(); + partial void OnOrderCodeChanging(string value); + partial void OnOrderCodeChanged(); + partial void OnOrderInDateChanging(System.Nullable value); + partial void OnOrderInDateChanged(); + partial void OnOrderOutDateChanging(System.Nullable value); + partial void OnOrderOutDateChanged(); + partial void OnMaterialRequisitionUnitChanging(string value); + partial void OnMaterialRequisitionUnitChanged(); partial void OnStateChanging(System.Nullable value); partial void OnStateChanged(); partial void OnInvoiceCodeChanging(string value); @@ -190835,16 +191421,6 @@ namespace Model partial void OnCreateDateChanged(); partial void OnCreateUserChanging(string value); partial void OnCreateUserChanged(); - partial void OnContractIdChanging(string value); - partial void OnContractIdChanged(); - partial void OnOrderInDateChanging(System.Nullable value); - partial void OnOrderInDateChanged(); - partial void OnOrderCodeChanging(string value); - partial void OnOrderCodeChanged(); - partial void OnOrderOutDateChanging(System.Nullable value); - partial void OnOrderOutDateChanged(); - partial void OnMaterialRequisitionUnitChanging(string value); - partial void OnMaterialRequisitionUnitChanged(); #endregion public PHTGL_Invoice() @@ -190892,6 +191468,106 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractId", DbType="NVarChar(50)")] + public string ContractId + { + get + { + return this._ContractId; + } + set + { + if ((this._ContractId != value)) + { + this.OnContractIdChanging(value); + this.SendPropertyChanging(); + this._ContractId = value; + this.SendPropertyChanged("ContractId"); + this.OnContractIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderCode", DbType="NVarChar(50)")] + public string OrderCode + { + get + { + return this._OrderCode; + } + set + { + if ((this._OrderCode != value)) + { + this.OnOrderCodeChanging(value); + this.SendPropertyChanging(); + this._OrderCode = value; + this.SendPropertyChanged("OrderCode"); + this.OnOrderCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderInDate", DbType="Date")] + public System.Nullable OrderInDate + { + get + { + return this._OrderInDate; + } + set + { + if ((this._OrderInDate != value)) + { + this.OnOrderInDateChanging(value); + this.SendPropertyChanging(); + this._OrderInDate = value; + this.SendPropertyChanged("OrderInDate"); + this.OnOrderInDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderOutDate", DbType="Date")] + public System.Nullable OrderOutDate + { + get + { + return this._OrderOutDate; + } + set + { + if ((this._OrderOutDate != value)) + { + this.OnOrderOutDateChanging(value); + this.SendPropertyChanging(); + this._OrderOutDate = value; + this.SendPropertyChanged("OrderOutDate"); + this.OnOrderOutDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialRequisitionUnit", DbType="NVarChar(100)")] + public string MaterialRequisitionUnit + { + get + { + return this._MaterialRequisitionUnit; + } + set + { + if ((this._MaterialRequisitionUnit != value)) + { + this.OnMaterialRequisitionUnitChanging(value); + this.SendPropertyChanging(); + this._MaterialRequisitionUnit = value; + this.SendPropertyChanged("MaterialRequisitionUnit"); + this.OnMaterialRequisitionUnitChanged(); + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_State", DbType="Int")] public System.Nullable State { @@ -191172,106 +191848,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractId", DbType="NVarChar(50)")] - public string ContractId - { - get - { - return this._ContractId; - } - set - { - if ((this._ContractId != value)) - { - this.OnContractIdChanging(value); - this.SendPropertyChanging(); - this._ContractId = value; - this.SendPropertyChanged("ContractId"); - this.OnContractIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderInDate", DbType="Date")] - public System.Nullable OrderInDate - { - get - { - return this._OrderInDate; - } - set - { - if ((this._OrderInDate != value)) - { - this.OnOrderInDateChanging(value); - this.SendPropertyChanging(); - this._OrderInDate = value; - this.SendPropertyChanged("OrderInDate"); - this.OnOrderInDateChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderCode", DbType="NVarChar(50)")] - public string OrderCode - { - get - { - return this._OrderCode; - } - set - { - if ((this._OrderCode != value)) - { - this.OnOrderCodeChanging(value); - this.SendPropertyChanging(); - this._OrderCode = value; - this.SendPropertyChanged("OrderCode"); - this.OnOrderCodeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderOutDate", DbType="Date")] - public System.Nullable OrderOutDate - { - get - { - return this._OrderOutDate; - } - set - { - if ((this._OrderOutDate != value)) - { - this.OnOrderOutDateChanging(value); - this.SendPropertyChanging(); - this._OrderOutDate = value; - this.SendPropertyChanged("OrderOutDate"); - this.OnOrderOutDateChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialRequisitionUnit", DbType="NVarChar(100)")] - public string MaterialRequisitionUnit - { - get - { - return this._MaterialRequisitionUnit; - } - set - { - if ((this._MaterialRequisitionUnit != value)) - { - this.OnMaterialRequisitionUnitChanging(value); - this.SendPropertyChanging(); - this._MaterialRequisitionUnit = value; - this.SendPropertyChanged("MaterialRequisitionUnit"); - this.OnMaterialRequisitionUnitChanged(); - } - } - } - public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -200278,6 +200854,44 @@ namespace Model private System.Nullable _InspectionLotNum; + private System.Nullable _EquipmentInspectionNum; + + private System.Nullable _EquipmentInspectionQualifiedNum; + + private System.Nullable _MachineInspectionNum; + + private System.Nullable _MachineInspectionQualifiedNum; + + private System.Nullable _PersonInspectionNum; + + private System.Nullable _PersonInspectionQualifiedNum; + + private System.Nullable _MaterialInspectionNum; + + private System.Nullable _MaterialInspectionQualifiedNum; + + private System.Nullable _ConstructSolutionNum; + + private System.Nullable _ConstructSolutionProjectApproveNum; + + private System.Nullable _ConstructSolutionUnitApproveNum; + + private System.Nullable _SpecialEquipmentQualityAssuranceSystemNum; + + private System.Nullable _DesignDetailsNum; + + private System.Nullable _UnitProjectAcceptNum; + + private System.Nullable _UnitProjectAcceptOKNum; + + private System.Nullable _SubProjectAcceptNum; + + private System.Nullable _SubProjectAcceptOKNum; + + private System.Nullable _SubdivisionalWorksAcceptNum; + + private System.Nullable _SubdivisionalWorksAcceptOKNum; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -200352,6 +200966,44 @@ namespace Model partial void OnSubdivisionalWorksNumChanged(); partial void OnInspectionLotNumChanging(System.Nullable value); partial void OnInspectionLotNumChanged(); + partial void OnEquipmentInspectionNumChanging(System.Nullable value); + partial void OnEquipmentInspectionNumChanged(); + partial void OnEquipmentInspectionQualifiedNumChanging(System.Nullable value); + partial void OnEquipmentInspectionQualifiedNumChanged(); + partial void OnMachineInspectionNumChanging(System.Nullable value); + partial void OnMachineInspectionNumChanged(); + partial void OnMachineInspectionQualifiedNumChanging(System.Nullable value); + partial void OnMachineInspectionQualifiedNumChanged(); + partial void OnPersonInspectionNumChanging(System.Nullable value); + partial void OnPersonInspectionNumChanged(); + partial void OnPersonInspectionQualifiedNumChanging(System.Nullable value); + partial void OnPersonInspectionQualifiedNumChanged(); + partial void OnMaterialInspectionNumChanging(System.Nullable value); + partial void OnMaterialInspectionNumChanged(); + partial void OnMaterialInspectionQualifiedNumChanging(System.Nullable value); + partial void OnMaterialInspectionQualifiedNumChanged(); + partial void OnConstructSolutionNumChanging(System.Nullable value); + partial void OnConstructSolutionNumChanged(); + partial void OnConstructSolutionProjectApproveNumChanging(System.Nullable value); + partial void OnConstructSolutionProjectApproveNumChanged(); + partial void OnConstructSolutionUnitApproveNumChanging(System.Nullable value); + partial void OnConstructSolutionUnitApproveNumChanged(); + partial void OnSpecialEquipmentQualityAssuranceSystemNumChanging(System.Nullable value); + partial void OnSpecialEquipmentQualityAssuranceSystemNumChanged(); + partial void OnDesignDetailsNumChanging(System.Nullable value); + partial void OnDesignDetailsNumChanged(); + partial void OnUnitProjectAcceptNumChanging(System.Nullable value); + partial void OnUnitProjectAcceptNumChanged(); + partial void OnUnitProjectAcceptOKNumChanging(System.Nullable value); + partial void OnUnitProjectAcceptOKNumChanged(); + partial void OnSubProjectAcceptNumChanging(System.Nullable value); + partial void OnSubProjectAcceptNumChanged(); + partial void OnSubProjectAcceptOKNumChanging(System.Nullable value); + partial void OnSubProjectAcceptOKNumChanged(); + partial void OnSubdivisionalWorksAcceptNumChanging(System.Nullable value); + partial void OnSubdivisionalWorksAcceptNumChanged(); + partial void OnSubdivisionalWorksAcceptOKNumChanging(System.Nullable value); + partial void OnSubdivisionalWorksAcceptOKNumChanged(); #endregion public Project_CQMSData_CQMS() @@ -201059,6 +201711,386 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EquipmentInspectionNum", DbType="Int")] + public System.Nullable EquipmentInspectionNum + { + get + { + return this._EquipmentInspectionNum; + } + set + { + if ((this._EquipmentInspectionNum != value)) + { + this.OnEquipmentInspectionNumChanging(value); + this.SendPropertyChanging(); + this._EquipmentInspectionNum = value; + this.SendPropertyChanged("EquipmentInspectionNum"); + this.OnEquipmentInspectionNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EquipmentInspectionQualifiedNum", DbType="Int")] + public System.Nullable EquipmentInspectionQualifiedNum + { + get + { + return this._EquipmentInspectionQualifiedNum; + } + set + { + if ((this._EquipmentInspectionQualifiedNum != value)) + { + this.OnEquipmentInspectionQualifiedNumChanging(value); + this.SendPropertyChanging(); + this._EquipmentInspectionQualifiedNum = value; + this.SendPropertyChanged("EquipmentInspectionQualifiedNum"); + this.OnEquipmentInspectionQualifiedNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MachineInspectionNum", DbType="Int")] + public System.Nullable MachineInspectionNum + { + get + { + return this._MachineInspectionNum; + } + set + { + if ((this._MachineInspectionNum != value)) + { + this.OnMachineInspectionNumChanging(value); + this.SendPropertyChanging(); + this._MachineInspectionNum = value; + this.SendPropertyChanged("MachineInspectionNum"); + this.OnMachineInspectionNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MachineInspectionQualifiedNum", DbType="Int")] + public System.Nullable MachineInspectionQualifiedNum + { + get + { + return this._MachineInspectionQualifiedNum; + } + set + { + if ((this._MachineInspectionQualifiedNum != value)) + { + this.OnMachineInspectionQualifiedNumChanging(value); + this.SendPropertyChanging(); + this._MachineInspectionQualifiedNum = value; + this.SendPropertyChanged("MachineInspectionQualifiedNum"); + this.OnMachineInspectionQualifiedNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PersonInspectionNum", DbType="Int")] + public System.Nullable PersonInspectionNum + { + get + { + return this._PersonInspectionNum; + } + set + { + if ((this._PersonInspectionNum != value)) + { + this.OnPersonInspectionNumChanging(value); + this.SendPropertyChanging(); + this._PersonInspectionNum = value; + this.SendPropertyChanged("PersonInspectionNum"); + this.OnPersonInspectionNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PersonInspectionQualifiedNum", DbType="Int")] + public System.Nullable PersonInspectionQualifiedNum + { + get + { + return this._PersonInspectionQualifiedNum; + } + set + { + if ((this._PersonInspectionQualifiedNum != value)) + { + this.OnPersonInspectionQualifiedNumChanging(value); + this.SendPropertyChanging(); + this._PersonInspectionQualifiedNum = value; + this.SendPropertyChanged("PersonInspectionQualifiedNum"); + this.OnPersonInspectionQualifiedNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialInspectionNum", DbType="Int")] + public System.Nullable MaterialInspectionNum + { + get + { + return this._MaterialInspectionNum; + } + set + { + if ((this._MaterialInspectionNum != value)) + { + this.OnMaterialInspectionNumChanging(value); + this.SendPropertyChanging(); + this._MaterialInspectionNum = value; + this.SendPropertyChanged("MaterialInspectionNum"); + this.OnMaterialInspectionNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialInspectionQualifiedNum", DbType="Int")] + public System.Nullable MaterialInspectionQualifiedNum + { + get + { + return this._MaterialInspectionQualifiedNum; + } + set + { + if ((this._MaterialInspectionQualifiedNum != value)) + { + this.OnMaterialInspectionQualifiedNumChanging(value); + this.SendPropertyChanging(); + this._MaterialInspectionQualifiedNum = value; + this.SendPropertyChanged("MaterialInspectionQualifiedNum"); + this.OnMaterialInspectionQualifiedNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructSolutionNum", DbType="Int")] + public System.Nullable ConstructSolutionNum + { + get + { + return this._ConstructSolutionNum; + } + set + { + if ((this._ConstructSolutionNum != value)) + { + this.OnConstructSolutionNumChanging(value); + this.SendPropertyChanging(); + this._ConstructSolutionNum = value; + this.SendPropertyChanged("ConstructSolutionNum"); + this.OnConstructSolutionNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructSolutionProjectApproveNum", DbType="Int")] + public System.Nullable ConstructSolutionProjectApproveNum + { + get + { + return this._ConstructSolutionProjectApproveNum; + } + set + { + if ((this._ConstructSolutionProjectApproveNum != value)) + { + this.OnConstructSolutionProjectApproveNumChanging(value); + this.SendPropertyChanging(); + this._ConstructSolutionProjectApproveNum = value; + this.SendPropertyChanged("ConstructSolutionProjectApproveNum"); + this.OnConstructSolutionProjectApproveNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructSolutionUnitApproveNum", DbType="Int")] + public System.Nullable ConstructSolutionUnitApproveNum + { + get + { + return this._ConstructSolutionUnitApproveNum; + } + set + { + if ((this._ConstructSolutionUnitApproveNum != value)) + { + this.OnConstructSolutionUnitApproveNumChanging(value); + this.SendPropertyChanging(); + this._ConstructSolutionUnitApproveNum = value; + this.SendPropertyChanged("ConstructSolutionUnitApproveNum"); + this.OnConstructSolutionUnitApproveNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SpecialEquipmentQualityAssuranceSystemNum", DbType="Int")] + public System.Nullable SpecialEquipmentQualityAssuranceSystemNum + { + get + { + return this._SpecialEquipmentQualityAssuranceSystemNum; + } + set + { + if ((this._SpecialEquipmentQualityAssuranceSystemNum != value)) + { + this.OnSpecialEquipmentQualityAssuranceSystemNumChanging(value); + this.SendPropertyChanging(); + this._SpecialEquipmentQualityAssuranceSystemNum = value; + this.SendPropertyChanged("SpecialEquipmentQualityAssuranceSystemNum"); + this.OnSpecialEquipmentQualityAssuranceSystemNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DesignDetailsNum", DbType="Int")] + public System.Nullable DesignDetailsNum + { + get + { + return this._DesignDetailsNum; + } + set + { + if ((this._DesignDetailsNum != value)) + { + this.OnDesignDetailsNumChanging(value); + this.SendPropertyChanging(); + this._DesignDetailsNum = value; + this.SendPropertyChanged("DesignDetailsNum"); + this.OnDesignDetailsNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitProjectAcceptNum", DbType="Int")] + public System.Nullable UnitProjectAcceptNum + { + get + { + return this._UnitProjectAcceptNum; + } + set + { + if ((this._UnitProjectAcceptNum != value)) + { + this.OnUnitProjectAcceptNumChanging(value); + this.SendPropertyChanging(); + this._UnitProjectAcceptNum = value; + this.SendPropertyChanged("UnitProjectAcceptNum"); + this.OnUnitProjectAcceptNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitProjectAcceptOKNum", DbType="Int")] + public System.Nullable UnitProjectAcceptOKNum + { + get + { + return this._UnitProjectAcceptOKNum; + } + set + { + if ((this._UnitProjectAcceptOKNum != value)) + { + this.OnUnitProjectAcceptOKNumChanging(value); + this.SendPropertyChanging(); + this._UnitProjectAcceptOKNum = value; + this.SendPropertyChanged("UnitProjectAcceptOKNum"); + this.OnUnitProjectAcceptOKNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubProjectAcceptNum", DbType="Int")] + public System.Nullable SubProjectAcceptNum + { + get + { + return this._SubProjectAcceptNum; + } + set + { + if ((this._SubProjectAcceptNum != value)) + { + this.OnSubProjectAcceptNumChanging(value); + this.SendPropertyChanging(); + this._SubProjectAcceptNum = value; + this.SendPropertyChanged("SubProjectAcceptNum"); + this.OnSubProjectAcceptNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubProjectAcceptOKNum", DbType="Int")] + public System.Nullable SubProjectAcceptOKNum + { + get + { + return this._SubProjectAcceptOKNum; + } + set + { + if ((this._SubProjectAcceptOKNum != value)) + { + this.OnSubProjectAcceptOKNumChanging(value); + this.SendPropertyChanging(); + this._SubProjectAcceptOKNum = value; + this.SendPropertyChanged("SubProjectAcceptOKNum"); + this.OnSubProjectAcceptOKNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubdivisionalWorksAcceptNum", DbType="Int")] + public System.Nullable SubdivisionalWorksAcceptNum + { + get + { + return this._SubdivisionalWorksAcceptNum; + } + set + { + if ((this._SubdivisionalWorksAcceptNum != value)) + { + this.OnSubdivisionalWorksAcceptNumChanging(value); + this.SendPropertyChanging(); + this._SubdivisionalWorksAcceptNum = value; + this.SendPropertyChanged("SubdivisionalWorksAcceptNum"); + this.OnSubdivisionalWorksAcceptNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubdivisionalWorksAcceptOKNum", DbType="Int")] + public System.Nullable SubdivisionalWorksAcceptOKNum + { + get + { + return this._SubdivisionalWorksAcceptOKNum; + } + set + { + if ((this._SubdivisionalWorksAcceptOKNum != value)) + { + this.OnSubdivisionalWorksAcceptOKNumChanging(value); + this.SendPropertyChanging(); + this._SubdivisionalWorksAcceptOKNum = value; + this.SendPropertyChanged("SubdivisionalWorksAcceptOKNum"); + this.OnSubdivisionalWorksAcceptOKNumChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -202842,6 +203874,16 @@ namespace Model private System.Nullable _EnvironmentalTrainNum; + private System.Nullable _HseTechnicalNum; + + private System.Nullable _ArgumentNum; + + private System.Nullable _SuperArgumentNum; + + private System.Nullable _ProjectDrillPersonNum; + + private System.Nullable _CompanyDrillPersonNum; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -203000,6 +204042,16 @@ namespace Model partial void OnSuperFinishedNumChanged(); partial void OnEnvironmentalTrainNumChanging(System.Nullable value); partial void OnEnvironmentalTrainNumChanged(); + partial void OnHseTechnicalNumChanging(System.Nullable value); + partial void OnHseTechnicalNumChanged(); + partial void OnArgumentNumChanging(System.Nullable value); + partial void OnArgumentNumChanged(); + partial void OnSuperArgumentNumChanging(System.Nullable value); + partial void OnSuperArgumentNumChanged(); + partial void OnProjectDrillPersonNumChanging(System.Nullable value); + partial void OnProjectDrillPersonNumChanged(); + partial void OnCompanyDrillPersonNumChanging(System.Nullable value); + partial void OnCompanyDrillPersonNumChanged(); #endregion public Project_HSSEData_HSSE() @@ -204547,6 +205599,106 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HseTechnicalNum", DbType="Int")] + public System.Nullable HseTechnicalNum + { + get + { + return this._HseTechnicalNum; + } + set + { + if ((this._HseTechnicalNum != value)) + { + this.OnHseTechnicalNumChanging(value); + this.SendPropertyChanging(); + this._HseTechnicalNum = value; + this.SendPropertyChanged("HseTechnicalNum"); + this.OnHseTechnicalNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ArgumentNum", DbType="Int")] + public System.Nullable ArgumentNum + { + get + { + return this._ArgumentNum; + } + set + { + if ((this._ArgumentNum != value)) + { + this.OnArgumentNumChanging(value); + this.SendPropertyChanging(); + this._ArgumentNum = value; + this.SendPropertyChanged("ArgumentNum"); + this.OnArgumentNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SuperArgumentNum", DbType="Int")] + public System.Nullable SuperArgumentNum + { + get + { + return this._SuperArgumentNum; + } + set + { + if ((this._SuperArgumentNum != value)) + { + this.OnSuperArgumentNumChanging(value); + this.SendPropertyChanging(); + this._SuperArgumentNum = value; + this.SendPropertyChanged("SuperArgumentNum"); + this.OnSuperArgumentNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectDrillPersonNum", DbType="Int")] + public System.Nullable ProjectDrillPersonNum + { + get + { + return this._ProjectDrillPersonNum; + } + set + { + if ((this._ProjectDrillPersonNum != value)) + { + this.OnProjectDrillPersonNumChanging(value); + this.SendPropertyChanging(); + this._ProjectDrillPersonNum = value; + this.SendPropertyChanged("ProjectDrillPersonNum"); + this.OnProjectDrillPersonNumChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompanyDrillPersonNum", DbType="Int")] + public System.Nullable CompanyDrillPersonNum + { + get + { + return this._CompanyDrillPersonNum; + } + set + { + if ((this._CompanyDrillPersonNum != value)) + { + this.OnCompanyDrillPersonNumChanging(value); + this.SendPropertyChanging(); + this._CompanyDrillPersonNum = value; + this.SendPropertyChanged("CompanyDrillPersonNum"); + this.OnCompanyDrillPersonNumChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -204600,6 +205752,10 @@ namespace Model private System.Nullable _IsSynchro; + private string _CQMS_OrganizationPic; + + private string _QRCodeAttachUrl; + private EntityRef _Base_Project; private EntityRef _Base_Unit; @@ -204634,6 +205790,10 @@ namespace Model partial void OnRealNamePushTimeChanged(); partial void OnIsSynchroChanging(System.Nullable value); partial void OnIsSynchroChanged(); + partial void OnCQMS_OrganizationPicChanging(string value); + partial void OnCQMS_OrganizationPicChanged(); + partial void OnQRCodeAttachUrlChanging(string value); + partial void OnQRCodeAttachUrlChanged(); #endregion public Project_ProjectUnit() @@ -204911,6 +206071,46 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CQMS_OrganizationPic", DbType="NVarChar(100)")] + public string CQMS_OrganizationPic + { + get + { + return this._CQMS_OrganizationPic; + } + set + { + if ((this._CQMS_OrganizationPic != value)) + { + this.OnCQMS_OrganizationPicChanging(value); + this.SendPropertyChanging(); + this._CQMS_OrganizationPic = value; + this.SendPropertyChanged("CQMS_OrganizationPic"); + this.OnCQMS_OrganizationPicChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_QRCodeAttachUrl", DbType="NVarChar(200)")] + public string QRCodeAttachUrl + { + get + { + return this._QRCodeAttachUrl; + } + set + { + if ((this._QRCodeAttachUrl != value)) + { + this.OnQRCodeAttachUrlChanging(value); + this.SendPropertyChanging(); + this._QRCodeAttachUrl = value; + this.SendPropertyChanged("QRCodeAttachUrl"); + this.OnQRCodeAttachUrlChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Project_ProjectUnit_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -276795,8 +277995,12 @@ namespace Model private string _HandleState; + private string _ProblemTypes; + private System.Nullable _SortIndex; + private string _Situation; + private string _WorkType; private string _DangerPoint; @@ -277101,6 +278305,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProblemTypes", DbType="Char(1)")] + public string ProblemTypes + { + get + { + return this._ProblemTypes; + } + set + { + if ((this._ProblemTypes != value)) + { + this._ProblemTypes = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortIndex", DbType="Int")] public System.Nullable SortIndex { @@ -277117,6 +278337,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Situation", DbType="NVarChar(800)")] + public string Situation + { + get + { + return this._Situation; + } + set + { + if ((this._Situation != value)) + { + this._Situation = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkType", DbType="VarChar(1) NOT NULL", CanBeNull=false)] public string WorkType { @@ -307255,7 +308491,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(200)")] public string Name { get @@ -307832,7 +309068,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")] public string PackageContent { get @@ -308023,7 +309259,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")] public string PackageContent { get @@ -313334,7 +314570,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")] public string PackageContent { get @@ -314806,7 +316042,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")] public string PackageContent { get @@ -324357,7 +325593,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractNo", DbType="NVarChar(500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractNo", DbType="NVarChar(1500)")] public string ContractNo { get @@ -324377,7 +325613,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitWorks", DbType="NVarChar(500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitWorks", DbType="NVarChar(1500)")] public string UnitWorks { get diff --git a/SGGL/Model/Model.csproj b/SGGL/Model/Model.csproj index 472a096b..9e7d979a 100644 --- a/SGGL/Model/Model.csproj +++ b/SGGL/Model/Model.csproj @@ -257,6 +257,7 @@ + @@ -266,6 +267,7 @@ + @@ -274,6 +276,9 @@ + + + diff --git a/SGGL/Model/ZHGL/DataSync/CHCheckItemOutput.cs b/SGGL/Model/ZHGL/DataSync/CHCheckItemOutput.cs new file mode 100644 index 00000000..a1675347 --- /dev/null +++ b/SGGL/Model/ZHGL/DataSync/CHCheckItemOutput.cs @@ -0,0 +1,20 @@ +using System; + +namespace Model +{ + /// + /// 焊接信息 + /// + public class CHCheckItemOutput : BaseEntities + { + public string Id { get; set; } + /// + /// 总片数 + /// + public int? CHT_TotalFilm { get; set; } + /// + /// 合格片数 + /// + public int? CHT_PassFilm { get; set; } + } +} \ No newline at end of file diff --git a/SGGL/Model/ZHGL/DataSync/CQMSDataItem.cs b/SGGL/Model/ZHGL/DataSync/CQMSDataItem.cs index 32f33e16..8d4b0bac 100644 --- a/SGGL/Model/ZHGL/DataSync/CQMSDataItem.cs +++ b/SGGL/Model/ZHGL/DataSync/CQMSDataItem.cs @@ -54,6 +54,25 @@ namespace Model public int? UnitProjectOnesOKNum { get; set; } public string UnitProjectOnesRate { get; set; } public int? UseNum { get; set; } + public int? EquipmentInspectionNum { get; set; } + public int? EquipmentInspectionQualifiedNum { get; set; } + public int? MachineInspectionNum { get; set; } + public int? MachineInspectionQualifiedNum { get; set; } + public int? PersonInspectionNum { get; set; } + public int? PersonInspectionQualifiedNum { get; set; } + public int? MaterialInspectionNum { get; set; } + public int? MaterialInspectionQualifiedNum { get; set; } + public int? ConstructSolutionNum { get; set; } + public int? ConstructSolutionProjectApproveNum { get; set; } + public int? ConstructSolutionUnitApproveNum { get; set; } + public int? SpecialEquipmentQualityAssuranceSystemNum { get; set; } + public int? DesignDetailsNum { get; set; } + public int? UnitProjectAcceptNum { get; set; } + public int? UnitProjectAcceptOKNum { get; set; } + public int? SubProjectAcceptNum { get; set; } + public int? SubProjectAcceptOKNum { get; set; } + public int? SubdivisionalWorksAcceptNum { get; set; } + public int? SubdivisionalWorksAcceptOKNum { get; set; } } } diff --git a/SGGL/Model/ZHGL/DataSync/HSSEDataItem.cs b/SGGL/Model/ZHGL/DataSync/HSSEDataItem.cs index dfd1a9df..9f5e9179 100644 --- a/SGGL/Model/ZHGL/DataSync/HSSEDataItem.cs +++ b/SGGL/Model/ZHGL/DataSync/HSSEDataItem.cs @@ -29,6 +29,8 @@ namespace Model public int? CompanyComprehensiveCheckNum { get; set; } public int? CompanyComprehensivePlanNum { get; set; } public int? CompanyDrillNum { get; set; } + public int? CompanyDrillPersonNum { get; set; } + public int? CompanyLeadShiftCheckNum { get; set; } public int? CompanyOnSiteDisposalPlan { get; set; } public int? CompanySpecialCheckNum { get; set; } @@ -39,6 +41,8 @@ namespace Model public int? CostUse { get; set; } public int? EnterpriseTopicsMeetingNum { get; set; } public int? FinishedNum { get; set; } + public int? ArgumentNum { get; set; } + public int? SuperArgumentNum { get; set; } public int? GeneralAccidentNum { get; set; } public int? GeneralClosedNum { get; set; } public int? GeneralNotClosedNum { get; set; } @@ -64,6 +68,8 @@ namespace Model public decimal? NewWaterConsumption { get; set; } public int? ProjectComprehensivePlanNum { get; set; } public int? ProjectDrillNum { get; set; } + public int? ProjectDrillPersonNum { get; set; } + public int? ProjectFullTimeNum { get; set; } public int? ProjectInspectorGeneralNum { get; set; } public int? ProjectLeadShiftCheckNum { get; set; } @@ -84,6 +90,8 @@ namespace Model public int? ShutdownNum { get; set; } public int? SpecialEquipmentNum { get; set; } public int? SpecialOperationTrainNum { get; set; } + public int? HseTechnicalNum { get; set; } + public int? EnvironmentalTrainNum { get; set; } public int? SpecialSeriousAccidentNum { get; set; } public int? SpecialTrainNum { get; set; } diff --git a/SGGL/Model/ZHGL/DataSync/InspectionManagementOutput.cs b/SGGL/Model/ZHGL/DataSync/InspectionManagementOutput.cs new file mode 100644 index 00000000..a4d6eaf0 --- /dev/null +++ b/SGGL/Model/ZHGL/DataSync/InspectionManagementOutput.cs @@ -0,0 +1,16 @@ +using System; + +namespace Model +{ + /// + /// 质量验收数据 + /// + public class InspectionManagementOutput : BaseEntities + { + public string Id { get; set; } + public string BreakdownCode { get; set; } + public string BreakdownName { get; set; } + public string Basis { get; set; } + public string CheckPoints { get; set; } + } +} \ No newline at end of file diff --git a/SGGL/Model/ZHGL/DataSync/LargeEngineeringOutput.cs b/SGGL/Model/ZHGL/DataSync/LargeEngineeringOutput.cs index d12d0cd2..ed306c79 100644 --- a/SGGL/Model/ZHGL/DataSync/LargeEngineeringOutput.cs +++ b/SGGL/Model/ZHGL/DataSync/LargeEngineeringOutput.cs @@ -1,6 +1,6 @@ namespace Model { - public class LargeEngineeringOutput:BaseEntities + public class LargeEngineeringOutput : BaseEntities { /// /// 危大工程审批完成数 @@ -34,5 +34,13 @@ /// 超危大工程完工个数 /// public int SuperFinishedNum { get; set; } + /// + /// 危大工程论证个数 + /// + public int ArgumentNum { get; set; } + /// + /// 超危大工程论证个数 + /// + public int SuperArgumentNum { get; set; } } } \ No newline at end of file diff --git a/SGGL/Model/ZHGL/DataSync/WBSBreakdownProjectOutput.cs b/SGGL/Model/ZHGL/DataSync/WBSBreakdownProjectOutput.cs new file mode 100644 index 00000000..695b15e2 --- /dev/null +++ b/SGGL/Model/ZHGL/DataSync/WBSBreakdownProjectOutput.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class WBSBreakdownProjectOutput :BaseEntities + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 数量 + /// + public int Sum { get; set; } +} +} diff --git a/SGGL/Model/ZHGL/DataSync/WeldDineOutput.cs b/SGGL/Model/ZHGL/DataSync/WeldDineOutput.cs new file mode 100644 index 00000000..a3caa527 --- /dev/null +++ b/SGGL/Model/ZHGL/DataSync/WeldDineOutput.cs @@ -0,0 +1,20 @@ +using System; + +namespace Model +{ + /// + /// 焊接达因数 + /// + public class WeldDineOutput : BaseEntities + { + public string Id { get; set; } + /// + /// 达因数 + /// + public decimal? Size { get; set; } + /// + /// 完成达因数 + /// + public decimal? DoneDin { get; set; } + } +} \ No newline at end of file diff --git a/SGGL/Model/ZHGL/DataSync/WelderOutput.cs b/SGGL/Model/ZHGL/DataSync/WelderOutput.cs new file mode 100644 index 00000000..da791729 --- /dev/null +++ b/SGGL/Model/ZHGL/DataSync/WelderOutput.cs @@ -0,0 +1,14 @@ +using System; + +namespace Model +{ + /// + /// 焊工数据 + /// + public class WelderOutput : BaseEntities + { + public string Id { get; set; } + public string WEDCode { get; set; } + public string WEDName { get; set; } + } +} \ No newline at end of file diff --git a/SGGL/WebAPI/Controllers/DataSync/CNCECServerController.cs b/SGGL/WebAPI/Controllers/DataSync/CNCECServerController.cs index 29f49bd5..a882f8a1 100644 --- a/SGGL/WebAPI/Controllers/DataSync/CNCECServerController.cs +++ b/SGGL/WebAPI/Controllers/DataSync/CNCECServerController.cs @@ -19,7 +19,7 @@ namespace WebAPI.Controllers /// 获取质量统计数据 /// /// - public Model.ReturnData PostGetCQMSData() + public async Task PostGetCQMSData() { var returnData = new Model.ReturnData(); returnData.type = "CQMS"; @@ -29,7 +29,7 @@ namespace WebAPI.Controllers returnData.expiryTime = BLL.SysConstSetService.CNCECTTokenExTime; if (!string.IsNullOrEmpty(returnData.token) && !string.IsNullOrEmpty(returnData.expiryTime) && DateTime.Parse(returnData.expiryTime) > DateTime.Now) { - returnData.data = CQMSDataService.GetTodayCQMSData_CQMS(); + returnData.data = await CQMSDataService.GetTodayCQMSData_CQMS(); } else { @@ -70,7 +70,7 @@ namespace WebAPI.Controllers /// 获取焊接统计数据 /// /// - public Model.ReturnData PostGetHJGLData() + public async Task PostGetHJGLData() { var returnData = new Model.ReturnData(); returnData.type = "HJGL"; @@ -80,7 +80,7 @@ namespace WebAPI.Controllers returnData.expiryTime = BLL.SysConstSetService.CNCECTTokenExTime; if (!string.IsNullOrEmpty(returnData.token) && !string.IsNullOrEmpty(returnData.expiryTime) && DateTime.Parse(returnData.expiryTime) > DateTime.Now) { - returnData.data = HJGLData_HJGLService.GetTodayHJGLData_HJGL(); + returnData.data = await HJGLData_HJGLService.GetTodayHJGLData_HJGLAsync(); } else { @@ -120,6 +120,35 @@ namespace WebAPI.Controllers /// 获取安全统计数据 /// /// + /*public Model.ReturnData PostGetHSSEData() + { + var returnData = new Model.ReturnData(); + returnData.type = "HSSE"; + returnData.time = DateTime.Now.ToString(); + ServerService.GetToken(); + returnData.token = BLL.SysConstSetService.CNCECToken; + returnData.expiryTime = BLL.SysConstSetService.CNCECTTokenExTime; + if (!string.IsNullOrEmpty(returnData.token) && !string.IsNullOrEmpty(returnData.expiryTime) && DateTime.Parse(returnData.expiryTime) > DateTime.Now) + { + try + { + returnData.data = HSSEData_HSSEService.StatisticalDataAsync().Result; + + } + catch (Exception ex) + { + + returnData.code = 0; + returnData.message = ex.ToString(); + } + } + else + { + returnData.code = 500; + returnData.message = "token失效"; + } + return returnData; + }*/ public async Task PostGetHSSEData() { var returnData = new Model.ReturnData(); @@ -147,6 +176,7 @@ namespace WebAPI.Controllers } return returnData; } + /// /// 获取安全统计数据成功后,回调通知上报成功 ///