509 lines
		
	
	
		
			36 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			509 lines
		
	
	
		
			36 KiB
		
	
	
	
		
			C#
		
	
	
	
| using Newtonsoft.Json;
 | |
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.Linq;
 | |
| using System.Web;
 | |
| using System.Web.UI;
 | |
| using System.Web.UI.WebControls;
 | |
| using BLL;
 | |
| 
 | |
| namespace FineUIPro.Web.common
 | |
| {
 | |
|     public partial class mainIV : PageBase
 | |
|     {
 | |
|         protected void Page_Load(object sender, EventArgs e)
 | |
|         {
 | |
|             if (!IsPostBack) 
 | |
|             {
 | |
|                 string roleCNs = Request.Params["roleCNs"];
 | |
|                 string roleCNNames = string.Empty;
 | |
|                 string unitWorkIds = Request.Params["unitWorkIds"];
 | |
|                 List<string> cns = Funs.GetStrListByStr(roleCNs, ',');
 | |
|                 List<string> cnNames = new List<string>();
 | |
|                 foreach (var cn in cns)
 | |
|                 {
 | |
|                     var c = BLL.CNProfessionalService.GetCNProfessional(cn);
 | |
|                     if (c != null && !cnNames.Contains(c.ProfessionalName))
 | |
|                     {
 | |
|                         cnNames.Add(c.ProfessionalName);
 | |
|                     }
 | |
|                 }
 | |
|                 List<string> unitWorkIdList = Funs.GetStrListByStr(unitWorkIds, ',');
 | |
|                 Model.SGGLDB db = Funs.DB;
 | |
|                 //未遂事故
 | |
|                 //var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord
 | |
|                 //                      join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
 | |
|                 //                      where y.AccidentTypeName.Contains("未遂") && x.ProjectId == this.CurrUser.LoginProjectId
 | |
|                 //                      select x;
 | |
|                 //var wsAccidentList2 = from x in db.Accident_AccidentReportOther
 | |
|                 //                      join y in db.Sys_Const on x.AccidentTypeId equals y.ConstValue
 | |
|                 //                      where y.ConstText.Contains("未遂") && x.ProjectId == this.CurrUser.LoginProjectId
 | |
|                 //                      select x;
 | |
|                 var licenses = from x in db.License_LicenseManager where x.ProjectId == this.CurrUser.LoginProjectId && cns.Contains(x.CNProfessionalId) select x;
 | |
|                 List<Model.License_LicenseManager> newlicenses = new List<Model.License_LicenseManager>();
 | |
|                 foreach (var item in unitWorkIdList)
 | |
|                 {
 | |
|                     newlicenses.AddRange(licenses.Where(x => x.WorkAreaId.Contains(item)));
 | |
|                 }
 | |
|                 newlicenses = newlicenses.Distinct().ToList();
 | |
|                 this.divZY.InnerHtml = (newlicenses.Count()).ToString();
 | |
|                 //隐患整改
 | |
|                 var getRectify = db.Check_RectifyNotices.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && cns.Contains(x.CNProfessionalId));
 | |
|                 List<Model.Check_RectifyNotices> newRectifyNotices = new List<Model.Check_RectifyNotices>();
 | |
|                 foreach (var item in unitWorkIdList)
 | |
|                 {
 | |
|                     newRectifyNotices.AddRange(getRectify.Where(x => x.WorkAreaId.Contains(item)));
 | |
|                 }
 | |
|                 newRectifyNotices = newRectifyNotices.Distinct().ToList();
 | |
|                 this.divYH.InnerHtml = newRectifyNotices.Count().ToString();
 | |
|                 //安全人工时
 | |
|                 int wHours = db.SitePerson_PersonInOutNumber.Where(x => x.ProjectId == this.CurrUser.LoginProjectId).Max(x => x.WorkHours) ?? 0;
 | |
|                 this.divRGS.InnerHtml = wHours.ToString();
 | |
|                 //教育培训
 | |
|                 var getTrainRecord = from x in db.EduTrain_TrainRecord where x.ProjectId == this.CurrUser.LoginProjectId && cns.Contains(x.CNProfessionalId) select x;
 | |
|                 List<Model.EduTrain_TrainRecord> newTrainRecords = new List<Model.EduTrain_TrainRecord>();
 | |
|                 foreach (var item in unitWorkIdList)
 | |
|                 {
 | |
|                     newTrainRecords.AddRange(getTrainRecord.Where(x => x.UnitWorkIds.Contains(item)));
 | |
|                 }
 | |
|                 newTrainRecords = newTrainRecords.Distinct().ToList();
 | |
|                 this.divPX.InnerHtml = newTrainRecords.Count().ToString();
 | |
|                 //质量问题
 | |
|                 var checkList = from x in db.Check_CheckControl where x.ProjectId == this.CurrUser.LoginProjectId && cns.Contains(x.CNProfessionalCode) && unitWorkIdList.Contains(x.UnitWorkId) select x;
 | |
|                 this.divZLWT.InnerHtml = checkList.Count().ToString();
 | |
|                 //质量共检数据
 | |
|                 var inspectionManagementDetails = (from x in db.ProcessControl_InspectionManagementDetail
 | |
|                                                    join y in db.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
 | |
|                                                    where y.ProjectId == this.CurrUser.LoginProjectId && cns.Contains(y.CNProfessionalId) && unitWorkIdList.Contains(x.UnitWorkId)
 | |
|                                                    select new { x.InspectionId, y.IsOnceQualified }).Distinct().ToList();
 | |
|                 this.divZLGJ.InnerHtml = inspectionManagementDetails.Count().ToString();
 | |
|                 //验收数据
 | |
|                 this.divYS.InnerHtml = inspectionManagementDetails.Count(x => x.IsOnceQualified == true).ToString();
 | |
|                 //焊工过期人数统计
 | |
|                 var welders = from x in db.Comprehensive_InspectionPerson
 | |
|                               join y in db.Base_Post on x.PostId equals y.PostId
 | |
|                               where x.ProjectId == this.CurrUser.LoginProjectId && y.PostName == "焊工" && x.ValidityDate < DateTime.Now && cns.Contains(x.CNProfessionalId)
 | |
|                               select x;
 | |
|                 List<Model.Comprehensive_InspectionPerson> newWelders = new List<Model.Comprehensive_InspectionPerson>();
 | |
|                 foreach (var item in unitWorkIdList)
 | |
|                 {
 | |
|                     newWelders.AddRange(welders.Where(x => x.UnitWorkId.Contains(item)));
 | |
|                 }
 | |
|                 newWelders = newWelders.Distinct().ToList();
 | |
|                 this.divHG.InnerHtml = newWelders.Count().ToString();
 | |
|                 //竣工资料
 | |
|                 this.divJGZL.InnerHtml = inspectionManagementDetails.Count(x => x.IsOnceQualified == true).ToString();
 | |
|                 //NCR
 | |
|                 var NCRManagements = from x in db.Comprehensive_NCRManagement where x.ProjectId == this.CurrUser.LoginProjectId && cns.Contains(x.CNProfessionalId) select x;
 | |
|                 List<Model.Comprehensive_NCRManagement> newNCRManagements = new List<Model.Comprehensive_NCRManagement>();
 | |
|                 foreach (var item in unitWorkIdList)
 | |
|                 {
 | |
|                     newNCRManagements.AddRange(NCRManagements.Where(x => x.UnitWorkId.Contains(item)));
 | |
|                 }
 | |
|                 newNCRManagements = newNCRManagements.Distinct().ToList();
 | |
|                 this.divNCR.InnerHtml = newNCRManagements.Count().ToString();
 | |
|                 //变更单
 | |
|                 var designChangeOrders = from x in db.Comprehensive_DesignChangeOrder where x.ProjectId == this.CurrUser.LoginProjectId && cns.Contains(x.CNProfessionalId) select x;
 | |
|                 List<Model.Comprehensive_DesignChangeOrder> newDesignChangeOrders = new List<Model.Comprehensive_DesignChangeOrder>();
 | |
|                 foreach (var item in unitWorkIdList)
 | |
|                 {
 | |
|                     newDesignChangeOrders.AddRange(designChangeOrders.Where(x => x.UnitWorkId.Contains(item)));
 | |
|                 }
 | |
|                 newDesignChangeOrders = newDesignChangeOrders.Distinct().ToList();
 | |
|                 this.divBG.InnerHtml = newDesignChangeOrders.Count().ToString();
 | |
|                 //签证
 | |
|                 var siteVisas = from x in db.Comprehensive_SiteVisaManagement where x.ProjectId == this.CurrUser.LoginProjectId && cns.Contains(x.CNProfessionalId) && unitWorkIdList.Contains(x.UnitWorkId) select x;
 | |
|                 this.divQZ.InnerHtml = siteVisas.Count().ToString();
 | |
|                 //管道材料汇总表
 | |
|                 string contractQuantitySheetsStr = string.Empty;
 | |
|                 long projectId = BLL.ProjectService.GetCLProjectCodeByProjectId(this.CurrUser.LoginProjectId);
 | |
|                 var contractQuantitySheets = from x in Funs.DB.CLGL_PipelineMaterialSumList where x.ProjectId == projectId.ToString() && x.Type == "M" select x;
 | |
|                 if (contractQuantitySheets.Count() > 0)
 | |
|                 {
 | |
|                     contractQuantitySheetsStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>材料类别</div><div class='item jd-title'>设计量</div><div class='item jd-title'>预制量</div><div class='item jd-title'>采购量</div><div class='item jd-title'>采购量百分比</div><div class='item jd-title'>已到货</div><div class='item jd-title'>已到货百分比</div><div class='item jd-title'>已领料</div><div class='item jd-title'>已领料百分比</div><div class='item jd-title'>采购量MTO</div><div class='item jd-title'>采购量百分比MTO</div></div>";
 | |
|                     int i = 1;
 | |
|                     foreach (var item in contractQuantitySheets)
 | |
|                     {
 | |
|                         contractQuantitySheetsStr += "<div class='jd-item'><div class='item'>"
 | |
|                                         + i + "</div><div class='item'>"
 | |
|                                         + item.C1 + "</div><div class='item'>"
 | |
|                                         + item.C2 + "</div><div class='item'>"
 | |
|                                         + item.C3 + "</div><div class='item'>"
 | |
|                                         + item.C4 + "</div><div class='item'>"
 | |
|                                         + item.C5 + "</div><div class='item'>"
 | |
|                                         + item.C6 + "</div><div class='item'>"
 | |
|                                         + item.C7 + "</div><div class='item'>"
 | |
|                                         + item.C8 + "</div><div class='item'>"
 | |
|                                         + item.C9 + "</div><div class='item'>"
 | |
|                                         + item.C10 + "</div><div class='item'>"
 | |
|                                         + item.C11 + "</div></div>";
 | |
|                         i++;
 | |
|                     }
 | |
|                 }
 | |
|                 this.divGZL.InnerHtml = contractQuantitySheetsStr;
 | |
|                 this.hdContractQuantitySheets.Value = contractQuantitySheetsStr;
 | |
|                 ////材料出库情况
 | |
|                 //string materialRecordsStr = string.Empty;
 | |
|                 //var materialRecords = from x in db.CLGL_PickMaterialRecord where x.ProjectId == projectId.ToString() && cnNames.Contains(x.Major) select x;
 | |
|                 //if (materialRecords.Count() > 0)
 | |
|                 //{
 | |
|                 //    materialRecordsStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>领料单号</div><div class='item jd-title'>领料时间</div><div class='item jd-title'>领料单位</div><div class='item jd-title'>领料截止时间</div><div class='item jd-title'>专业</div><div class='item jd-title'>材料编码</div><div class='item jd-title'>位号</div><div class='item jd-title'>申领量</div><div class='item jd-title'>批准量</div><div class='item jd-title'>实发量</div><div class='item jd-title'>装置号</div><div class='item jd-title'>主项号</div><div class='item jd-title'>发料备注</div></div>";
 | |
|                 //    int i = 1;
 | |
|                 //    foreach (var item in materialRecords)
 | |
|                 //    {
 | |
|                 //        materialRecordsStr += "<div class='jd-item'><div class='item'>"
 | |
|                 //                        + i + "</div><div class='item'>"
 | |
|                 //                        + item.PickCode + "</div><div class='item'>"
 | |
|                 //                        + (item.PickDate.HasValue ? string.Format("{0:yyyy-MM-dd}", item.PickDate.Value) : "") + "</div><div class='item'>"
 | |
|                 //                        + item.PickUnit + "</div><div class='item'>"
 | |
|                 //                        + (item.PickLimitDate.HasValue ? string.Format("{0:yyyy-MM-dd}", item.PickLimitDate.Value) : "") + "</div><div class='item'>"
 | |
|                 //                        + item.Major + "</div><div class='item'>"
 | |
|                 //                        + item.MaterialCode + "</div><div class='item'>"
 | |
|                 //                        + item.TagNo + "</div><div class='item'>"
 | |
|                 //                        + item.ClaimQuantity + "</div><div class='item'>"
 | |
|                 //                        + item.ApproveQuantity + "</div><div class='item'>"
 | |
|                 //                        + item.ActualQuantity + "</div><div class='item'>"
 | |
|                 //                        + item.DeviceCode + "</div><div class='item'>"
 | |
|                 //                        + item.MainItemCode + "</div><div class='item'>"
 | |
|                 //                        + item.Remark + "</div></div>";
 | |
|                 //        i++;
 | |
|                 //    }
 | |
|                 //}
 | |
|                 //this.hdMaterialRecords.Value = materialRecordsStr;
 | |
|                 //项目管道焊接工程量
 | |
|                 string totalQuantityStr = string.Empty;
 | |
|                 var totalQuantitys = from x in db.HJGL_FL_TotalQuantity where x.ProjectId == this.CurrUser.LoginProjectId orderby x.DeviceName, x.DeviceCode select x;
 | |
|                 if (totalQuantitys.Count() > 0)
 | |
|                 {
 | |
|                     totalQuantityStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>装置名称</div><div class='item jd-title'>单元号</div><div class='item jd-title'>施工单位</div><div class='item jd-title'>焊接总量</div><div class='item jd-title'>已完成总量</div><div class='item jd-title'>完成比例</div></div>";
 | |
|                     int i = 1;
 | |
|                     foreach (var item in totalQuantitys)
 | |
|                     {
 | |
|                         string rate = "0%";
 | |
|                         decimal totalWeldQuantity = Convert.ToDecimal(!string.IsNullOrEmpty(item.TotalWeldQuantity) ? item.TotalWeldQuantity : "0");
 | |
|                         decimal totalCompleted = Convert.ToDecimal(!string.IsNullOrEmpty(item.TotalCompleted) ? item.TotalCompleted : "0");
 | |
|                         if (totalWeldQuantity > 0 && totalCompleted > 0)
 | |
|                         {
 | |
|                             rate = Convert.ToDecimal(Math.Round(totalCompleted * 100 / totalWeldQuantity, 2)).ToString() + "%";
 | |
|                         }
 | |
|                         totalQuantityStr += "<div class='jd-item'><div class='item'>"
 | |
|                                         + i + "</div><div class='item'>"
 | |
|                                         + item.DeviceName + "</div><div class='item'>"
 | |
|                                         + item.DeviceCode + "</div><div class='item'>"
 | |
|                                         + item.Unit + "</div><div class='item'>"
 | |
|                                         + item.TotalWeldQuantity + "</div><div class='item'>"
 | |
|                                         + item.TotalCompleted + "</div><div class='item'>"
 | |
|                                         + rate + "</div></div>";
 | |
|                         i++;
 | |
|                     }
 | |
|                 }
 | |
|                 this.hdTotalQuantity.Value = totalQuantityStr;
 | |
|                 //焊接工程量表
 | |
|                 string quantityStr = string.Empty;
 | |
|                 var quantitys = from x in db.HJGL_FL_Quantity where x.ProjectId == this.CurrUser.LoginProjectId orderby x.DeviceName, x.DeviceNumber, x.ZoneNumber select x;
 | |
|                 if (quantitys.Count() > 0)
 | |
|                 {
 | |
|                     quantityStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>装置名称</div><div class='item jd-title'>装置号</div><div class='item jd-title'>施工单位</div><div class='item jd-title'>区域号</div><div class='item jd-title'>焊接完成量</div><div class='item jd-title'>已完成量</div><div class='item jd-title'>昨日完成量</div><div class='item jd-title'>周计划量</div><div class='item jd-title'>周完成量</div></div>";
 | |
|                     int i = 1;
 | |
|                     foreach (var item in quantitys)
 | |
|                     {
 | |
|                         quantityStr += "<div class='jd-item'><div class='item'>"
 | |
|                                         + i + "</div><div class='item'>"
 | |
|                                         + item.DeviceName + "</div><div class='item'>"
 | |
|                                         + item.DeviceNumber + "</div><div class='item'>"
 | |
|                                         + item.UnitName + "</div><div class='item'>"
 | |
|                                         + item.ZoneNumber + "</div><div class='item'>"
 | |
|                                         + item.InchesDiameterTotal + "</div><div class='item'>"
 | |
|                                         + item.InchesDiameterFinish + "</div><div class='item'>"
 | |
|                                         + item.YesterdayFinish + "</div><div class='item'>"
 | |
|                                         + item.WeekInchesDiameterPlan + "</div><div class='item'>"
 | |
|                                         + item.WeekInchesDiameterFinish + "</div></div>";
 | |
|                         i++;
 | |
|                     }
 | |
|                 }
 | |
|                 this.hdQuantity.Value = quantityStr;
 | |
|                 //无损检测一次合格率
 | |
|                 string oneOKRateStr = string.Empty;
 | |
|                 var oneOKRates = from x in db.HJGL_FL_OneOKRate where x.ProjectId == this.CurrUser.LoginProjectId orderby x.DeviceName, x.DeviceCode, x.ZoneCode select x;
 | |
|                 if (oneOKRates.Count() > 0)
 | |
|                 {
 | |
|                     oneOKRateStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>装置名称</div><div class='item jd-title'>装置号</div><div class='item jd-title'>单元号</div><div class='item jd-title'>施工单位</div><div class='item jd-title'>检测焊口数量</div><div class='item jd-title'>一次合格数量</div><div class='item jd-title'>一次检测合格率</div><div class='item jd-title'>一次拍片总量</div><div class='item jd-title'>一次拍片合格量</div><div class='item jd-title'>一次拍片合格率</div></div>";
 | |
|                     int i = 1;
 | |
|                     foreach (var item in oneOKRates)
 | |
|                     {
 | |
|                         oneOKRateStr += "<div class='jd-item'><div class='item'>"
 | |
|                                         + i + "</div><div class='item'>"
 | |
|                                         + item.DeviceName + "</div><div class='item'>"
 | |
|                                         + item.DeviceCode + "</div><div class='item'>"
 | |
|                                         + item.ZoneCode + "</div><div class='item'>"
 | |
|                                         + item.UnitName + "</div><div class='item'>"
 | |
|                                         + item.TestWeldAmount + "</div><div class='item'>"
 | |
|                                         + item.OnceQualifiedQuantity + "</div><div class='item'>"
 | |
|                                         + item.OneOKRate + "</div><div class='item'>"
 | |
|                                         + item.OneTimeFilmAmount + "</div><div class='item'>"
 | |
|                                         + item.OneTimeFilmQualifiedAmount + "</div><div class='item'>"
 | |
|                                         + item.OneOKFilmRate + "</div></div>";
 | |
|                         i++;
 | |
|                     }
 | |
|                 }
 | |
|                 this.hdOneOKRate.Value = oneOKRateStr;
 | |
|                 //试压包量表
 | |
|                 string pressurePackageListStr = string.Empty;
 | |
|                 var pressurePackageLists = from x in db.HJGL_FL_PressurePackageList where x.ProjectId == this.CurrUser.LoginProjectId orderby x.DeviceName, x.DeviceNumber select x;
 | |
|                 if (pressurePackageLists.Count() > 0)
 | |
|                 {
 | |
|                     pressurePackageListStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>装置名称</div><div class='item jd-title'>装置号</div><div class='item jd-title'>施工单位</div><div class='item jd-title'>试压包总量</div><div class='item jd-title'>试压包完成量</div><div class='item jd-title'>水压包总量</div><div class='item jd-title'>水压包完成量</div><div class='item jd-title'>观察包总量</div><div class='item jd-title'>观察包完成量</div><div class='item jd-title'>运行包总量</div><div class='item jd-title'>运行包完成量</div><div class='item jd-title'>替代包总量</div><div class='item jd-title'>替代包完成量</div></div>";
 | |
|                     int i = 1;
 | |
|                     foreach (var item in pressurePackageLists)
 | |
|                     {
 | |
|                         pressurePackageListStr += "<div class='jd-item'><div class='item'>"
 | |
|                                         + i + "</div><div class='item'>"
 | |
|                                         + item.DeviceName + "</div><div class='item'>"
 | |
|                                         + item.DeviceNumber + "</div><div class='item'>"
 | |
|                                         + item.UnitName + "</div><div class='item'>"
 | |
|                                         + item.PressurePackageTotalNum + "</div><div class='item'>"
 | |
|                                         + item.CompletePressurePackageNum + "</div><div class='item'>"
 | |
|                                         + item.WaterPressurePackageTotalNum + "</div><div class='item'>"
 | |
|                                         + item.CompleteWaterPressurePackageCompleteNum + "</div><div class='item'>"
 | |
|                                         + item.ObservePackageTotalNum + "</div><div class='item'>"
 | |
|                                         + item.CompleteObservePackageNum + "</div><div class='item'>"
 | |
|                                         + item.RunPackageTotalNum + "</div><div class='item'>"
 | |
|                                         + item.CompleteRunPackageNum + "</div><div class='item'>"
 | |
|                                         + item.AlternativePackageTotalNum + "</div><div class='item'>"
 | |
|                                         + item.CompleteAlternativePackageNum + "</div></div>";
 | |
|                         i++;
 | |
|                     }
 | |
|                 }
 | |
|                 this.hdPressurePackageList.Value = pressurePackageListStr;
 | |
|                 //无损检测量表
 | |
|                 string ndtListStr = string.Empty;
 | |
|                 var ndtLists = from x in db.HJGL_FL_NdtList where x.ProjectId == this.CurrUser.LoginProjectId orderby x.DeviceName, x.DeviceNumber, x.ZoneCode select x;
 | |
|                 if (ndtLists.Count() > 0)
 | |
|                 {
 | |
|                     ndtListStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>装置名称</div><div class='item jd-title'>装置号</div><div class='item jd-title'>单元号</div><div class='item jd-title'>施工单位</div><div class='item jd-title'>理论检测焊口总量</div><div class='item jd-title'>检测焊口数量</div><div class='item jd-title'>一次合格数量</div><div class='item jd-title'>一次拍片总量</div><div class='item jd-title'>一次拍片合格量</div></div>";
 | |
|                     int i = 1;
 | |
|                     foreach (var item in ndtLists)
 | |
|                     {
 | |
|                         ndtListStr += "<div class='jd-item'><div class='item'>"
 | |
|                                         + i + "</div><div class='item'>"
 | |
|                                         + item.DeviceName + "</div><div class='item'>"
 | |
|                                         + item.DeviceNumber + "</div><div class='item'>"
 | |
|                                         + item.ZoneCode + "</div><div class='item'>"
 | |
|                                         + item.UnitName + "</div><div class='item'>"
 | |
|                                         + item.TheoreticalWeldedJointsTotal + "</div><div class='item'>"
 | |
|                                         + item.TestWeldAmount + "</div><div class='item'>"
 | |
|                                         + item.OnceQualifiedQuantity + "</div><div class='item'>"
 | |
|                                         + item.OneTimeFilmAmount + "</div><div class='item'>"
 | |
|                                         + item.OneTimeFilmQualifiedAmount + "</div></div>";
 | |
|                         i++;
 | |
|                     }
 | |
|                 }
 | |
|                 this.hdNdtList.Value = ndtListStr;
 | |
|                 //无损检测量表
 | |
|                 string tailItemListStr = string.Empty;
 | |
|                 var tailItemLists = from x in db.HJGL_FL_TailItemList where x.ProjectId == this.CurrUser.LoginProjectId orderby x.DeviceName, x.DeviceNumber select x;
 | |
|                 if (tailItemLists.Count() > 0)
 | |
|                 {
 | |
|                     tailItemListStr = "<div class='jd-item'><div class='item jd-title'>序号</div><div class='item jd-title'>装置名称</div><div class='item jd-title'>装置号</div><div class='item jd-title'>施工单位</div><div class='item jd-title'>剩余焊接焊口数</div><div class='item jd-title'>热处理数</div><div class='item jd-title'>硬度检测数</div><div class='item jd-title'>无损检测对接未完数</div><div class='item jd-title'>无损检测角接未完数</div><div class='item jd-title'>无损检测支管未完数</div><div class='item jd-title'>现场检查A类</div><div class='item jd-title'>现场检查B类</div></div>";
 | |
|                     int i = 1;
 | |
|                     foreach (var item in tailItemLists)
 | |
|                     {
 | |
|                         tailItemListStr += "<div class='jd-item'><div class='item'>"
 | |
|                                         + i + "</div><div class='item'>"
 | |
|                                         + item.DeviceName + "</div><div class='item'>"
 | |
|                                         + item.DeviceNumber + "</div><div class='item'>"
 | |
|                                         + item.UnitName + "</div><div class='item'>"
 | |
|                                         + item.RemainingWeldsNumber + "</div><div class='item'>"
 | |
|                                         + item.HeatTreatmentsNumber + "</div><div class='item'>"
 | |
|                                         + item.HardnessTestsNumber + "</div><div class='item'>"
 | |
|                                         + item.UnfinishedButtNumber + "</div><div class='item'>"
 | |
|                                         + item.UnfinishedCornerJointNumber + "</div><div class='item'>"
 | |
|                                         + item.UnfinishedBranchPipeNumber + "</div><div class='item'>"
 | |
|                                         + item.ClassAQuantity + "</div><div class='item'>"
 | |
|                                         + item.ClassBQuantity + "</div></div>";
 | |
|                         i++;
 | |
|                     }
 | |
|                 }
 | |
|                 this.hdTailItemList.Value = tailItemListStr;
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         #region 赢得值曲线
 | |
|         protected string Two
 | |
|         {
 | |
|             get
 | |
|             {
 | |
|                 List<Model.SingleSerie> series = new List<Model.SingleSerie>();
 | |
|                 Model.BusinessColumn businessColumn = new Model.BusinessColumn();
 | |
|                 List<string> listCategories = new List<string>();
 | |
|                 businessColumn.title = "赢得值曲线";
 | |
|                 var views = (from x in Funs.DB.View_JDGL_ProgressCompletion where x.ProjectId == this.CurrUser.LoginProjectId orderby x.Months select x).ToList();
 | |
|                 Model.SingleSerie s = new Model.SingleSerie();
 | |
|                 Model.SingleSerie s2 = new Model.SingleSerie();
 | |
|                 Model.SingleSerie s3 = new Model.SingleSerie();
 | |
|                 Model.SingleSerie s4 = new Model.SingleSerie();
 | |
|                 List<double> listdata = new List<double>();
 | |
|                 List<double> listdata2 = new List<double>();
 | |
|                 List<double> listdata3 = new List<double>();
 | |
|                 List<double> listdata4 = new List<double>();
 | |
|                 for (int i = 0; i < views.Count; i++)
 | |
|                 {
 | |
|                     listCategories.Add(views[i].MonthStr);
 | |
|                     listdata.Add(Convert.ToDouble(views[i].PlanNum));
 | |
|                     listdata2.Add(Convert.ToDouble(views[i].TotalPlanNum));
 | |
|                     listdata3.Add(Convert.ToDouble(views[i].RealNum));
 | |
|                     listdata4.Add(Convert.ToDouble(views[i].TotalRealNum));
 | |
|                 }
 | |
|                 s.data = listdata;
 | |
|                 s2.data = listdata2;
 | |
|                 s3.data = listdata3;
 | |
|                 s4.data = listdata4;
 | |
|                 series.Add(s);
 | |
|                 series.Add(s2);
 | |
|                 series.Add(s3);
 | |
|                 series.Add(s4);
 | |
|                 businessColumn.categories = listCategories;
 | |
|                 businessColumn.series = series;
 | |
|                 return JsonConvert.SerializeObject(businessColumn);
 | |
|             }
 | |
|         }
 | |
|         #endregion
 | |
| 
 | |
|         #region  人力情况
 | |
|         protected string Person
 | |
|         {
 | |
|             get
 | |
|             {
 | |
|                 string roleCNs = Request.Params["roleCNs"];
 | |
|                 string unitWorkIds = Request.Params["unitWorkIds"];
 | |
|                 Model.SGGLDB db = Funs.DB;
 | |
|                 List<Model.SingleSerie> series = new List<Model.SingleSerie>();
 | |
|                 Model.BusinessColumn businessColumn = new Model.BusinessColumn();
 | |
|                 List<string> listCategories = new List<string>();
 | |
|                 var persons = from x in db.SitePerson_Person where x.ProjectId == this.CurrUser.LoginProjectId && x.IsUsed == true select x;
 | |
|                 persons = persons.Where(x => roleCNs.Split(',').Contains(x.MainCNProfessionalId));
 | |
|                 List<Model.SitePerson_Person> newPersons = new List<Model.SitePerson_Person>();
 | |
|                 if (!string.IsNullOrEmpty(unitWorkIds))
 | |
|                 {
 | |
|                     string[] unitWorkIdList = unitWorkIds.Split(',');
 | |
|                     foreach (var item in unitWorkIdList)
 | |
|                     {
 | |
|                         newPersons.AddRange(persons.Where(x => x.WorkAreaId.Contains(item)));
 | |
|                     }
 | |
|                 }
 | |
|                 newPersons = newPersons.Distinct().ToList();
 | |
|                 Model.SingleSerie s = new Model.SingleSerie();
 | |
|                 List<double> listdata = new List<double>();
 | |
|                 //木工
 | |
|                 listCategories.Add("木工");
 | |
|                 int workPostCount1 = newPersons.Count(x => x.WorkPostId == Const.WorkPost_Carpentry);
 | |
|                 listdata.Add(workPostCount1);
 | |
|                 //钢筋工
 | |
|                 listCategories.Add("钢筋工");
 | |
|                 int workPostCount2 = newPersons.Count(x => x.WorkPostId == Const.WorkPost_SteelWorker);
 | |
|                 listdata.Add(workPostCount2);
 | |
|                 //瓦工
 | |
|                 listCategories.Add("瓦工");
 | |
|                 int workPostCount3 = newPersons.Count(x => x.WorkPostId == Const.WorkPost_Bricklayer);
 | |
|                 listdata.Add(workPostCount3);
 | |
|                 //混凝土工
 | |
|                 listCategories.Add("混凝土工");
 | |
|                 int workPostCount4 = newPersons.Count(x => x.WorkPostId == Const.WorkPost_ConcreteWorker);
 | |
|                 listdata.Add(workPostCount4);
 | |
|                 //钳工
 | |
|                 listCategories.Add("钳工");
 | |
|                 int workPostCount5 = newPersons.Count(x => x.WorkPostId == Const.WorkPost_Fitter1 || x.WorkPostId == Const.WorkPost_Fitter2);
 | |
|                 listdata.Add(workPostCount5);
 | |
|                 //焊工
 | |
|                 listCategories.Add("焊工");
 | |
|                 int workPostCount6 = newPersons.Count(x => x.WorkPostId == Const.WorkPost_Welder1 || x.WorkPostId == Const.WorkPost_Welder2 ||
 | |
|                         x.WorkPostId == Const.WorkPost_Welder3 || x.WorkPostId == Const.WorkPost_Welder4 || x.WorkPostId == Const.WorkPost_Welder5);
 | |
|                 listdata.Add(workPostCount6);
 | |
|                 //铆工
 | |
|                 listCategories.Add("铆工");
 | |
|                 int workPostCount7 = newPersons.Count(x => x.WorkPostId == Const.WorkPost_Riveter);
 | |
|                 listdata.Add(workPostCount7);
 | |
|                 //管工
 | |
|                 listCategories.Add("管工");
 | |
|                 int workPostCount8 = newPersons.Count(x => x.WorkPostId == Const.WorkPost_Foreman);
 | |
|                 listdata.Add(workPostCount8);
 | |
|                 //电工
 | |
|                 listCategories.Add("电工");
 | |
|                 int workPostCount9 = newPersons.Count(x => x.WorkPostId == Const.WorkPost_Electrician1 || x.WorkPostId == Const.WorkPost_Electrician2
 | |
|                          || x.WorkPostId == Const.WorkPost_Electrician3);
 | |
|                 listdata.Add(workPostCount9);
 | |
|                 //仪表工
 | |
|                 listCategories.Add("仪表工");
 | |
|                 int workPostCount10 = newPersons.Count(x => x.WorkPostId == Const.WorkPost_Instrumentalist);
 | |
|                 listdata.Add(workPostCount10);
 | |
|                 //防腐保温工
 | |
|                 listCategories.Add("防腐保温工");
 | |
|                 int workPostCount11 = newPersons.Count(x => x.WorkPostId == Const.WorkPost_AnticorrosionWorker);
 | |
|                 listdata.Add(workPostCount11);
 | |
|                 //防腐保温工
 | |
|                 listCategories.Add("管理人员");
 | |
|                 int workPostCount12 = (from x in newPersons
 | |
|                                        join y in db.Base_WorkPost on x.WorkPostId equals y.WorkPostId
 | |
|                                        where y.PostType == Const.PostType_1
 | |
|                                        select x).Count();
 | |
|                 listdata.Add(workPostCount12);
 | |
|                 //其他
 | |
|                 listCategories.Add("其他");
 | |
|                 int workPostCount13 = newPersons.Count() - workPostCount1 - workPostCount2 - workPostCount3 - workPostCount4 - workPostCount5 - workPostCount6 - workPostCount7
 | |
|                     - workPostCount8 - workPostCount9 - workPostCount10 - workPostCount11 - workPostCount12;
 | |
|                 listdata.Add(workPostCount13);
 | |
|                 s.data = listdata;
 | |
|                 series.Add(s);
 | |
|                 businessColumn.categories = listCategories;
 | |
|                 businessColumn.title = newPersons.Count().ToString();
 | |
|                 businessColumn.series = series;
 | |
|                 return JsonConvert.SerializeObject(businessColumn);
 | |
|             }
 | |
|         }
 | |
|         #endregion
 | |
| 
 | |
|         #region  关键事项
 | |
|         protected string swiper_One
 | |
|         {
 | |
|             get
 | |
|             {
 | |
|                 string roleCNs = Request.Params["roleCNs"];
 | |
|                 var getGJSX = (from x in Funs.DB.GJSX
 | |
|                                join y in Funs.DB.Base_QuestionType on x.QuestionTypeID equals y.QuestionTypeID
 | |
|                                where x.ProjectId == this.CurrUser.LoginProjectId && x.State != "0" && roleCNs.Split(',').Contains(x.CNProfessional_ID)
 | |
|                                && x.User_ReceiveID.Contains(this.CurrUser.UserId)
 | |
|                                orderby x.CreateDate
 | |
|                                select new { x.GJSXID, x.Detail, x.CreateDate, x.ProjectId, y.QuestionTypeName }).Distinct().Take(20);
 | |
|                 string strNoticeHtml = string.Empty;
 | |
|                 var readIds = from x in Funs.DB.Sys_UserRead where x.UserId == this.CurrUser.UserId select x.DataId;
 | |
|                 foreach (var item in getGJSX)
 | |
|                 {
 | |
|                     string url = "../PZHGL/GJSX/GJSXListEdit.aspx?EditType=Edit&Id=" + item.GJSXID;
 | |
|                     if (item.QuestionTypeName.Contains("紧急"))
 | |
|                     {
 | |
|                         strNoticeHtml += "<li data-id=\"" + url + "\" notice-id=\"" + item.GJSXID + "\" class=\"c-item swiper-slide\"><div class=\"tit\" title=\"" + item.Detail + "\"><div class=\"flex\" ><div class=\"tit-t flex1\" style=\"color:red;\">" + item.Detail + "</div><div class=\"tit-v\">" + string.Format("{0:yyyy-MM-dd}", item.CreateDate) + "</div></div></div></li>";
 | |
|                     }
 | |
|                     else if (item.QuestionTypeName.Contains("重要"))
 | |
|                     {
 | |
|                         strNoticeHtml += "<li data-id=\"" + url + "\" notice-id=\"" + item.GJSXID + "\" class=\"c-item swiper-slide\"><div class=\"tit\" title=\"" + item.Detail + "\"><div class=\"flex\" ><div class=\"tit-t flex1\" style=\"color:yellow;\">" + item.Detail + "</div><div class=\"tit-v\">" + string.Format("{0:yyyy-MM-dd}", item.CreateDate) + "</div></div></div></li>";
 | |
|                     }
 | |
|                     else
 | |
|                     {
 | |
|                         strNoticeHtml += "<li data-id=\"" + url + "\" notice-id=\"" + item.GJSXID + "\" class=\"c-item swiper-slide\"><div class=\"tit\" title=\"" + item.Detail + "\"><div class=\"flex\" ><div class=\"tit-t flex1\">" + item.Detail + "</div><div class=\"tit-v\">" + string.Format("{0:yyyy-MM-dd}", item.CreateDate) + "</div></div></div></li>";
 | |
|                     }
 | |
|                 }
 | |
|                 return "<ul class=\"content-ul swiper-wrapper\">" + strNoticeHtml + "</ul>";
 | |
|             }
 | |
|         }
 | |
|         #endregion
 | |
| 
 | |
|         protected void imgBtn_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             Model.GJSX gjsx = BLL.GJSXService.GetGJSXById(this.hdNoticeId.Value);
 | |
|             if (gjsx != null)
 | |
|             {
 | |
|                 BLL.APIUserService.getSaveUserRead(BLL.Const.GJSXMenuId, gjsx.ProjectId, this.CurrUser.UserId, gjsx.GJSXID);
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| } |