| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Web; | 
					
						
							|  |  |  |  | using System.Web.UI; | 
					
						
							|  |  |  |  | using System.Web.UI.WebControls; | 
					
						
							|  |  |  |  | using BLL; | 
					
						
							|  |  |  |  | using Newtonsoft.Json; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace FineUIPro.Web.common | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class main : PageBase | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         //protected string ProjectJSStr; | 
					
						
							|  |  |  |  |         List<Model.Base_Project> allProjects; | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (!IsPostBack) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 #region 项目数据 | 
					
						
							|  |  |  |  |                 allProjects = ProjectService.GetAllProjectDropDownList(); | 
					
						
							|  |  |  |  |                 int acount = allProjects.Count(); | 
					
						
							|  |  |  |  |                 //工地总数 | 
					
						
							|  |  |  |  |                 this.numProjetcA.InnerHtml = acount.ToString(); | 
					
						
							|  |  |  |  |                 int pcount1 = 0; | 
					
						
							|  |  |  |  |                 int pcount2 = 0; | 
					
						
							|  |  |  |  |                 int pcount3 = 0; | 
					
						
							|  |  |  |  |                 if (acount > 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     pcount1 = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Count(); | 
					
						
							|  |  |  |  |                     pcount2 = allProjects.Where(x => x.ProjectState == Const.ProjectState_2).Count(); | 
					
						
							|  |  |  |  |                     pcount3 = allProjects.Where(x => x.ProjectState == Const.ProjectState_3).Count(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 //在建 | 
					
						
							|  |  |  |  |                 this.numProjetc1.InnerHtml = pcount1.ToString(); | 
					
						
							|  |  |  |  |                 //停工 | 
					
						
							|  |  |  |  |                 this.numProjetc2.InnerHtml = pcount2.ToString(); | 
					
						
							|  |  |  |  |                 //竣工 | 
					
						
							|  |  |  |  |                 this.numProjetc3.InnerHtml = pcount3.ToString(); | 
					
						
							|  |  |  |  |                 #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 #region 进度数据 | 
					
						
							|  |  |  |  |                 this.divJD.InnerHtml = "<div class='flex tab-h'><div class='txt'>    项目</div><div class='flex1' style='text-align: center'>进度条</div><div class='txt'>进度百分比</div></div><div id='divJD_wrap' class='swiper-container'>"; | 
					
						
							|  |  |  |  |                 var project1s = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null); | 
					
						
							|  |  |  |  |                 foreach (var project1 in project1s) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     this.divJD.InnerHtml += "<div class='flex tab-i'><div class='txt' style='color: #00a2e9'>" + project1.ShortName + "</div><div class='flex1 flex line-wrap'><div class='line-item'><div class='normal' style='width: 80%'></div></div></div><div class='txt' style='color: #00a2e9'>80%</div></div>"; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 this.divJD.InnerHtml += "</div>"; | 
					
						
							|  |  |  |  |                 #endregion | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region  项目信息 | 
					
						
							|  |  |  |  |         protected string Project | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Model.SingleSerie series = new Model.SingleSerie(); | 
					
						
							|  |  |  |  |                 var project1s = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null); | 
					
						
							|  |  |  |  |                 var consts = Funs.DB.Sys_Const.Where(x => x.GroupId == ConstValue.GroupId_ProjectState); | 
					
						
							|  |  |  |  |                 string name = string.Empty; | 
					
						
							|  |  |  |  |                 if (project1s.Count() > 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     foreach (var project1 in project1s) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         string state = string.Empty; | 
					
						
							|  |  |  |  |                         var c = consts.FirstOrDefault(x => x.ConstValue == project1.ProjectState2); | 
					
						
							|  |  |  |  |                         if (c != null) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             state = c.ConstText; | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         name += "<li style=\"border:1px solid white; padding:3px;\" class=\"c-item disabled swiper-slide\"><div class=\"tit tit-read\"><div class=\"flex\" ><div class=\"tit-t flex1\">" + project1.ProjectName + "</div><div class=\"tit-v\">" + state + "</div></div></div></li>"; | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 var provinceDic = from x in Funs.DB.RealName_City select x; | 
					
						
							|  |  |  |  |                 List<double> listdata = new List<double>(); | 
					
						
							|  |  |  |  |                 List<string> jd = new List<string>(); | 
					
						
							|  |  |  |  |                 List<string> sg = new List<string>(); | 
					
						
							|  |  |  |  |                 List<string> time = new List<string>(); | 
					
						
							|  |  |  |  |                 List<string> ht = new List<string>(); | 
					
						
							|  |  |  |  |                 List<string> convert = new List<string>(); | 
					
						
							|  |  |  |  |                 List<string> loc = new List<string>(); | 
					
						
							|  |  |  |  |                 listdata.Add(allProjects.Count()); | 
					
						
							|  |  |  |  |                 jd.Add(""); | 
					
						
							|  |  |  |  |                 sg.Add(""); | 
					
						
							|  |  |  |  |                 time.Add(""); | 
					
						
							|  |  |  |  |                 ht.Add(""); | 
					
						
							|  |  |  |  |                 List<string> provinces = new List<string>(); | 
					
						
							|  |  |  |  |                 provinces.Add("上海"); | 
					
						
							|  |  |  |  |                 provinces.Add("河北"); | 
					
						
							|  |  |  |  |                 provinces.Add("山西"); | 
					
						
							|  |  |  |  |                 provinces.Add("内蒙古"); | 
					
						
							|  |  |  |  |                 provinces.Add("辽宁"); | 
					
						
							|  |  |  |  |                 provinces.Add("吉林"); | 
					
						
							|  |  |  |  |                 provinces.Add("黑龙江"); | 
					
						
							|  |  |  |  |                 provinces.Add("江苏"); | 
					
						
							|  |  |  |  |                 provinces.Add("浙江"); | 
					
						
							|  |  |  |  |                 provinces.Add("安徽"); | 
					
						
							|  |  |  |  |                 provinces.Add("福建"); | 
					
						
							|  |  |  |  |                 provinces.Add("江西"); | 
					
						
							|  |  |  |  |                 provinces.Add("山东"); | 
					
						
							|  |  |  |  |                 provinces.Add("河南"); | 
					
						
							|  |  |  |  |                 provinces.Add("湖北"); | 
					
						
							|  |  |  |  |                 provinces.Add("湖南"); | 
					
						
							|  |  |  |  |                 provinces.Add("广东"); | 
					
						
							|  |  |  |  |                 provinces.Add("广西"); | 
					
						
							|  |  |  |  |                 provinces.Add("海南"); | 
					
						
							|  |  |  |  |                 provinces.Add("四川"); | 
					
						
							|  |  |  |  |                 provinces.Add("贵州"); | 
					
						
							|  |  |  |  |                 provinces.Add("云南"); | 
					
						
							|  |  |  |  |                 provinces.Add("西藏"); | 
					
						
							|  |  |  |  |                 provinces.Add("陕西"); | 
					
						
							|  |  |  |  |                 provinces.Add("甘肃"); | 
					
						
							|  |  |  |  |                 provinces.Add("青海"); | 
					
						
							|  |  |  |  |                 provinces.Add("宁夏"); | 
					
						
							|  |  |  |  |                 provinces.Add("新疆"); | 
					
						
							|  |  |  |  |                 provinces.Add("北京"); | 
					
						
							|  |  |  |  |                 provinces.Add("天津"); | 
					
						
							|  |  |  |  |                 provinces.Add("重庆"); | 
					
						
							|  |  |  |  |                 provinces.Add("香港"); | 
					
						
							|  |  |  |  |                 provinces.Add("澳门"); | 
					
						
							|  |  |  |  |                 provinces.Add("台湾"); | 
					
						
							|  |  |  |  |                 Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  |                 var accidentList1 = from x in db.Accident_AccidentPersonRecord | 
					
						
							|  |  |  |  |                                     join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId | 
					
						
							|  |  |  |  |                                     where y.AccidentTypeName.Contains("未遂") | 
					
						
							|  |  |  |  |                                     select x; | 
					
						
							|  |  |  |  |                 var accidentList2 = from x in db.Accident_AccidentReportOther | 
					
						
							|  |  |  |  |                                     join y in db.Sys_Const on x.AccidentTypeId equals y.ConstValue | 
					
						
							|  |  |  |  |                                     where y.ConstText.Contains("未遂") | 
					
						
							|  |  |  |  |                                     select x; | 
					
						
							|  |  |  |  |                 foreach (var province in provinces) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     int accidentNum = 0; | 
					
						
							|  |  |  |  |                     DateTime date = DateTime.Now; | 
					
						
							|  |  |  |  |                     decimal money1 = 0, money2 = 0; | 
					
						
							|  |  |  |  |                     var projects = from x in allProjects | 
					
						
							|  |  |  |  |                                    join y in provinceDic on x.Province equals y.ProvinceCode | 
					
						
							|  |  |  |  |                                    where y.CnShortName == province | 
					
						
							|  |  |  |  |                                    select x; | 
					
						
							|  |  |  |  |                     listdata.Add(projects.Count()); | 
					
						
							|  |  |  |  |                     decimal progress = 0; | 
					
						
							|  |  |  |  |                     if (projects.Count() > 0) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         convert.Add(province); | 
					
						
							|  |  |  |  |                         foreach (var item in projects) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             //未遂事故 | 
					
						
							|  |  |  |  |                             var accidentListProject1 = accidentList1.Where(x => x.ProjectId == item.ProjectId); | 
					
						
							|  |  |  |  |                             var accidentListProject2 = accidentList2.Where(x => x.ProjectId == item.ProjectId); | 
					
						
							|  |  |  |  |                             accidentNum = accidentListProject1.Count() + accidentListProject2.Count(); | 
					
						
							|  |  |  |  |                             //时间 | 
					
						
							|  |  |  |  |                             if (item.StartDate != null && item.StartDate < date) | 
					
						
							|  |  |  |  |                             { | 
					
						
							|  |  |  |  |                                 date = Convert.ToDateTime(item.StartDate); | 
					
						
							|  |  |  |  |                             } | 
					
						
							|  |  |  |  |                             //合同额 | 
					
						
							|  |  |  |  |                             if (item.ConstructionMoney != null) | 
					
						
							|  |  |  |  |                             { | 
					
						
							|  |  |  |  |                                 money1 += item.ConstructionMoney.Value; | 
					
						
							|  |  |  |  |                             } | 
					
						
							|  |  |  |  |                             if (item.Progress != null) | 
					
						
							|  |  |  |  |                             { | 
					
						
							|  |  |  |  |                                 progress = item.Progress.Value; | 
					
						
							|  |  |  |  |                             } | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         jd.Add("进度:" + progress.ToString("0.##") + "%"); | 
					
						
							|  |  |  |  |                         sg.Add("未遂事故:" + accidentNum.ToString()); | 
					
						
							|  |  |  |  |                         time.Add("时间:" + string.Format("{0:yyyy-MM-dd}", date)); | 
					
						
							|  |  |  |  |                         ht.Add("合同额(" + money1.ToString("0.##") + "W);收款额(" + money2 + "W)"); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                     else | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         jd.Add(""); | 
					
						
							|  |  |  |  |                         sg.Add(""); | 
					
						
							|  |  |  |  |                         time.Add(""); | 
					
						
							|  |  |  |  |                         ht.Add(""); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 foreach (var item in allProjects) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     decimal jdNum = 0; | 
					
						
							|  |  |  |  |                     string mapStr = ""; | 
					
						
							|  |  |  |  |                     int accidentNum = 0; | 
					
						
							|  |  |  |  |                     DateTime date = DateTime.Now; | 
					
						
							|  |  |  |  |                     decimal money1 = 0, money2 = 0; | 
					
						
							|  |  |  |  |                     string endDate = string.Empty; | 
					
						
							|  |  |  |  |                     int timeSpan = 0; | 
					
						
							|  |  |  |  |                     if (!string.IsNullOrEmpty(item.MapCoordinates)) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         mapStr = item.MapCoordinates + ","; | 
					
						
							|  |  |  |  |                         //未遂事故 | 
					
						
							|  |  |  |  |                         var accidentListProject1 = accidentList1.Where(x => x.ProjectId == item.ProjectId); | 
					
						
							|  |  |  |  |                         var accidentListProject2 = accidentList2.Where(x => x.ProjectId == item.ProjectId); | 
					
						
							|  |  |  |  |                         accidentNum = accidentListProject1.Count() + accidentListProject2.Count(); | 
					
						
							|  |  |  |  |                         //时间 | 
					
						
							|  |  |  |  |                         if (item.StartDate != null && item.StartDate < date) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             date = Convert.ToDateTime(item.StartDate); | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         if (item.EndDate != null) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             endDate = string.Format("{0:yyyy-MM-dd}", item.EndDate); | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         if (item.StartDate != null && item.EndDate != null) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             TimeSpan t = (TimeSpan)(item.EndDate - item.StartDate); | 
					
						
							|  |  |  |  |                             timeSpan = t.Days / 30; | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         //合同额 | 
					
						
							|  |  |  |  |                         if (item.ConstructionMoney != null) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             money1 += item.ConstructionMoney.Value; | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         if (item.Progress != null) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             jdNum = item.Progress.Value; | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         mapStr += string.Format("{0:yyyy-MM-dd}", date) + "~" + endDate + ","; | 
					
						
							|  |  |  |  |                         if (timeSpan > 0) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             mapStr += timeSpan.ToString() + "个月,"; | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         else | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             mapStr += timeSpan.ToString() + ","; | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         //mapStr += accidentNum.ToString() + ","; | 
					
						
							|  |  |  |  |                         mapStr += jdNum.ToString("0.##") + "%,"; | 
					
						
							|  |  |  |  |                         mapStr += money1.ToString("0.##") + ","; | 
					
						
							|  |  |  |  |                         mapStr += money2 + ","; | 
					
						
							|  |  |  |  |                         mapStr += item.ShortName + ","; | 
					
						
							|  |  |  |  |                         mapStr += item.ProjectId; | 
					
						
							|  |  |  |  |                         loc.Add(mapStr); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 series.name = name; | 
					
						
							|  |  |  |  |                 series.data = listdata; | 
					
						
							|  |  |  |  |                 series.jd = jd; | 
					
						
							|  |  |  |  |                 series.sg = sg; | 
					
						
							|  |  |  |  |                 series.time = time; | 
					
						
							|  |  |  |  |                 series.ht = ht; | 
					
						
							|  |  |  |  |                 series.convert = convert; | 
					
						
							|  |  |  |  |                 series.loc = loc; | 
					
						
							|  |  |  |  |                 return JsonConvert.SerializeObject(series); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region  人员分布 | 
					
						
							|  |  |  |  |         protected string Person | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  |                 Model.PieData totalPie = new Model.PieData(); | 
					
						
							|  |  |  |  |                 List<Model.Pie> pie = new List<Model.Pie>(); | 
					
						
							|  |  |  |  |                 List<string> data = new List<string>(); | 
					
						
							|  |  |  |  |                 List<Model.PieData> pieData = new List<Model.PieData>(); | 
					
						
							|  |  |  |  |                 List<Model.PieData> pieDataStr = new List<Model.PieData>(); | 
					
						
							|  |  |  |  |                 var personLists = from x in db.SitePerson_Person where x.IsUsed == true select x; | 
					
						
							|  |  |  |  |                 var getProjectIds = (from x in personLists | 
					
						
							|  |  |  |  |                                      group x by x.ProjectId into g | 
					
						
							|  |  |  |  |                                      select new { g.First().ProjectId, pCout = g.Count() }).OrderByDescending(x => x.pCout).Take(5).Select(x => x.ProjectId); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 //  var projects = BLL.ProjectService.GetProjectWorkList(); | 
					
						
							|  |  |  |  |                 var whPersons = personLists.Where(x => x.UnitId == BLL.Const.UnitId_CWCEC); | 
					
						
							|  |  |  |  |                 var projectUnits = from x in db.Project_ProjectUnit | 
					
						
							|  |  |  |  |                                    join y in db.Base_Unit on x.UnitId equals y.UnitId | 
					
						
							|  |  |  |  |                                    where x.UnitType == "2" | 
					
						
							|  |  |  |  |                                    select new { UnitId = x.UnitId, ProjectId = x.ProjectId, UnitName = y.UnitName }; | 
					
						
							|  |  |  |  |                 Model.PieData p = new Model.PieData(); | 
					
						
							|  |  |  |  |                 p.value = whPersons.Count(); | 
					
						
							|  |  |  |  |                 p.name = "五环"; | 
					
						
							|  |  |  |  |                 pieData.Add(p); | 
					
						
							|  |  |  |  |                 data.Add("五环"); | 
					
						
							|  |  |  |  |                 Model.Pie whPie = new Model.Pie(); | 
					
						
							|  |  |  |  |                 List<Model.PieData> whPieData = new List<Model.PieData>(); | 
					
						
							|  |  |  |  |                 whPie.name = "五环"; | 
					
						
							|  |  |  |  |                 Model.PieData whPieDataStr = new Model.PieData(); | 
					
						
							|  |  |  |  |                 whPieDataStr.name = "五环"; | 
					
						
							|  |  |  |  |                 string whStr = "<li style =\"border:1px solid white; padding:3px;\" class=\"c-item disabled swiper-slide\"><div class=\"tit tit-read\"><div class=\"flex\" ><div class=\"tit-t flex1\">五环</div><div class=\"tit-v\"></div></div></div></li>"; | 
					
						
							|  |  |  |  |                 foreach (var IdItem in getProjectIds) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     var getProject = ProjectService.GetProjectByProjectId(IdItem); | 
					
						
							|  |  |  |  |                     if (getProject != null) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         //五环人员分布 | 
					
						
							|  |  |  |  |                         Model.PieData wh = new Model.PieData(); | 
					
						
							|  |  |  |  |                         wh.name = getProject.ShortName; | 
					
						
							|  |  |  |  |                         wh.value = whPersons.Count(x => x.ProjectId == getProject.ProjectId); | 
					
						
							|  |  |  |  |                         whPieData.Add(wh); | 
					
						
							|  |  |  |  |                         whStr += "<li style=\"border:1px solid white; padding:3px;\" class=\"c-item disabled swiper-slide\"><div class=\"tit tit-read\"><div class=\"flex\" ><div class=\"tit-t flex1\">" + getProject.ProjectName + "</div><div class=\"tit-v\">" + wh.value + "</div></div></div></li>"; | 
					
						
							|  |  |  |  |                         //各项目分布 | 
					
						
							|  |  |  |  |                         Model.PieData projectPie = new Model.PieData(); | 
					
						
							|  |  |  |  |                         projectPie.value = personLists.Count(x => x.ProjectId == getProject.ProjectId); | 
					
						
							|  |  |  |  |                         projectPie.name = getProject.ShortName; | 
					
						
							|  |  |  |  |                         pieData.Add(projectPie); | 
					
						
							|  |  |  |  |                         Model.Pie xmPie = new Model.Pie(); | 
					
						
							|  |  |  |  |                         List<Model.PieData> xmPieData = new List<Model.PieData>(); | 
					
						
							|  |  |  |  |                         var pUnits = projectUnits.Where(x => x.ProjectId == getProject.ProjectId); | 
					
						
							|  |  |  |  |                         Model.PieData projectPieDataStr = new Model.PieData(); | 
					
						
							|  |  |  |  |                         projectPieDataStr.name = getProject.ShortName; | 
					
						
							|  |  |  |  |                         string projectStr = "<li style=\"border:1px solid white; padding:3px;\" class=\"c-item disabled swiper-slide\"><div class=\"tit tit-read\"><div class=\"flex\" ><div class=\"tit-t flex1\">" + getProject.ProjectName + "</div><div class=\"tit-v\"></div></div></div></li>"; | 
					
						
							|  |  |  |  |                         foreach (var pUnit in pUnits) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             Model.PieData xm = new Model.PieData(); | 
					
						
							|  |  |  |  |                             xm.name = pUnit.UnitName; | 
					
						
							|  |  |  |  |                             xm.value = personLists.Count(x => x.ProjectId == getProject.ProjectId && x.UnitId == pUnit.UnitId); | 
					
						
							|  |  |  |  |                             xmPieData.Add(xm); | 
					
						
							|  |  |  |  |                             projectStr += "<li style=\"border:1px solid white; padding:3px;\" class=\"c-item disabled swiper-slide\"><div class=\"tit tit-read\"><div class=\"flex\" ><div class=\"tit-t flex1\">" + pUnit.UnitName + "</div><div class=\"tit-v\">" + xm.value + "</div></div></div></li>"; | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         projectPieDataStr.str = projectStr; | 
					
						
							|  |  |  |  |                         pieDataStr.Add(projectPieDataStr); | 
					
						
							|  |  |  |  |                         xmPie.name = getProject.ShortName; | 
					
						
							|  |  |  |  |                         xmPie.showList = xmPieData; | 
					
						
							|  |  |  |  |                         pie.Add(xmPie); | 
					
						
							|  |  |  |  |                         data.Add(getProject.ShortName); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 whPie.showList = whPieData; | 
					
						
							|  |  |  |  |                 whPieDataStr.str = whStr; | 
					
						
							|  |  |  |  |                 pieDataStr.Add(whPieDataStr); | 
					
						
							|  |  |  |  |                 List<Model.Pie> newPie = new List<Model.Pie>(); | 
					
						
							|  |  |  |  |                 newPie.Add(whPie); | 
					
						
							|  |  |  |  |                 newPie.AddRange(pie); | 
					
						
							|  |  |  |  |                 totalPie.p = newPie; | 
					
						
							|  |  |  |  |                 totalPie.pData = pieData; | 
					
						
							|  |  |  |  |                 totalPie.data = data; | 
					
						
							|  |  |  |  |                 totalPie.dataStr = pieDataStr; | 
					
						
							|  |  |  |  |                 return JsonConvert.SerializeObject(totalPie); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected string PersonAll | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  |                 Model.PieData totalPie = new Model.PieData(); | 
					
						
							|  |  |  |  |                 List<Model.PieData> pieDataStr = new List<Model.PieData>(); | 
					
						
							|  |  |  |  |                 var personLists = from x in db.SitePerson_Person where x.IsUsed == true select x; | 
					
						
							|  |  |  |  |                 var projects = BLL.ProjectService.GetProjectWorkList(); | 
					
						
							|  |  |  |  |                 Model.PieData whPieDataStr = new Model.PieData(); | 
					
						
							|  |  |  |  |                 whPieDataStr.name = "五环"; | 
					
						
							|  |  |  |  |                 string whStr = string.Empty; | 
					
						
							|  |  |  |  |                 foreach (var project in projects) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     //五环人员分布 | 
					
						
							|  |  |  |  |                     var whvalues = personLists.Count(x => x.ProjectId == project.ProjectId); | 
					
						
							|  |  |  |  |                     whStr += "<li style=\"border:1px solid white; padding:3px;\" class=\"c-item disabled swiper-slide\"><div class=\"tit tit-read\"><div class=\"flex\" ><div class=\"tit-t flex1\">" + project.ProjectName + "</div><div class=\"tit-v\">" + whvalues + "</div></div></div></li>"; | 
					
						
							|  |  |  |  |                     ////各项目分布 | 
					
						
							|  |  |  |  |                     //var xmvalue = personLists.Count(x => x.ProjectId == project.ProjectId); | 
					
						
							|  |  |  |  |                     //Model.PieData projectPieDataStr = new Model.PieData(); | 
					
						
							|  |  |  |  |                     //whStr += "<li style=\"border:1px solid white; padding:3px;\" class=\"c-item disabled swiper-slide\"><div class=\"tit tit-read\"><div class=\"flex\" ><div class=\"tit-t flex1\">" + project.ProjectName + "</div><div class=\"tit-v\">" + xmvalue + "</div></div></div></li>"; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     //projectPieDataStr.str = projectStr; | 
					
						
							|  |  |  |  |                     //pieDataStr.Add(projectPieDataStr); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 whPieDataStr.str = whStr; | 
					
						
							|  |  |  |  |                 pieDataStr.Add(whPieDataStr); | 
					
						
							|  |  |  |  |                 totalPie.dataStr = pieDataStr; | 
					
						
							|  |  |  |  |                 return JsonConvert.SerializeObject(totalPie); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region  事故统计 | 
					
						
							|  |  |  |  |         protected string Accident | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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>(); | 
					
						
							|  |  |  |  |                 businessColumn.title = "质量事故"; | 
					
						
							|  |  |  |  |                 var projects = BLL.ProjectService.GetProjectWorkList(); | 
					
						
							|  |  |  |  |                 Model.SingleSerie s = new Model.SingleSerie(); | 
					
						
							|  |  |  |  |                 List<double> listdata = new List<double>(); | 
					
						
							|  |  |  |  |                 List<double> listdata2 = new List<double>(); | 
					
						
							|  |  |  |  |                 List<double> listdata3 = new List<double>(); | 
					
						
							|  |  |  |  |                 List<decimal> listdata4 = new List<decimal>(); | 
					
						
							|  |  |  |  |                 var swAccidentList1 = from x in db.Accident_AccidentPersonRecord | 
					
						
							|  |  |  |  |                                       join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId | 
					
						
							|  |  |  |  |                                       where y.AccidentTypeName.Contains("伤亡") | 
					
						
							|  |  |  |  |                                       select x; | 
					
						
							|  |  |  |  |                 var swAccidentList2 = from x in db.Accident_AccidentReport | 
					
						
							|  |  |  |  |                                       join y in db.Sys_Const on x.AccidentTypeId equals y.ConstValue | 
					
						
							|  |  |  |  |                                       where (y.ConstText.Contains("轻伤") || y.ConstText.Contains("重伤") || y.ConstText.Contains("死亡")) && y.GroupId == ConstValue.Group_AccidentReportRegistration | 
					
						
							|  |  |  |  |                                       select x; | 
					
						
							|  |  |  |  |                 var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord | 
					
						
							|  |  |  |  |                                       join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId | 
					
						
							|  |  |  |  |                                       where y.AccidentTypeName.Contains("未遂") | 
					
						
							|  |  |  |  |                                       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("未遂") | 
					
						
							|  |  |  |  |                                       select x; | 
					
						
							|  |  |  |  |                 var qualityAccidents = from x in db.Comprehensive_QualityAccident select x; | 
					
						
							|  |  |  |  |                 foreach (var project in projects) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     listCategories.Add(project.ShortName); | 
					
						
							|  |  |  |  |                     listdata4.Add(project.Progress ?? 0); | 
					
						
							|  |  |  |  |                     int qualityAccidentProjectsCount = qualityAccidents.Count(x => x.ProjectId == project.ProjectId); | 
					
						
							|  |  |  |  |                     int wsAccidentListCount1 = wsAccidentList1.Count(x => x.ProjectId == project.ProjectId); | 
					
						
							|  |  |  |  |                     int wsAccidentListCount2 = wsAccidentList2.Count(x => x.ProjectId == project.ProjectId); | 
					
						
							|  |  |  |  |                     int swAccidentListCount1 = swAccidentList1.Count(x => x.ProjectId == project.ProjectId); | 
					
						
							|  |  |  |  |                     int swAccidentListCount2 = swAccidentList2.Count(x => x.ProjectId == project.ProjectId); | 
					
						
							|  |  |  |  |                     listdata.Add(qualityAccidentProjectsCount); | 
					
						
							|  |  |  |  |                     listdata2.Add(wsAccidentListCount1 + wsAccidentListCount2); | 
					
						
							|  |  |  |  |                     listdata3.Add(swAccidentListCount1 + swAccidentListCount2); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 s.data = listdata; | 
					
						
							|  |  |  |  |                 s.data2 = listdata2; | 
					
						
							|  |  |  |  |                 s.data3 = listdata3; | 
					
						
							|  |  |  |  |                 s.data4 = listdata4; | 
					
						
							|  |  |  |  |                 series.Add(s); | 
					
						
							|  |  |  |  |                 businessColumn.categories = listCategories; | 
					
						
							|  |  |  |  |                 businessColumn.series = series; | 
					
						
							|  |  |  |  |                 return JsonConvert.SerializeObject(businessColumn); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region  关键事项 | 
					
						
							|  |  |  |  |         protected string swiper_One | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 var getGJSX = (from x in Funs.DB.GJSX | 
					
						
							|  |  |  |  |                                join y in Funs.DB.Base_QuestionType on x.QuestionTypeID equals y.QuestionTypeID | 
					
						
							| 
									
										
										
										
											2021-11-25 13:15:13 +08:00
										 |  |  |  |                                where (y.QuestionTypeName.Contains("紧急") || y.QuestionTypeName.Contains("重要")) && x.State != "0" | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |                                orderby x.CreateDate | 
					
						
							| 
									
										
										
										
											2021-11-25 13:15:13 +08:00
										 |  |  |  |                                select new { x.GJSXID, x.Detail, x.CreateDate, x.ProjectId, y.QuestionTypeName }).Distinct().Take(20); | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |                 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/GJSXList.aspx?projectId=" + item.ProjectId; | 
					
						
							|  |  |  |  |                     //var attachFile = BLL.AttachFileService.GetAttachFile(item.NoticeId, BLL.Const.ServerNoticeMenuId); | 
					
						
							|  |  |  |  |                     //if (attachFile != null && !string.IsNullOrEmpty(attachFile.AttachUrl)) | 
					
						
							|  |  |  |  |                     //{ | 
					
						
							|  |  |  |  |                     //    url = "../" + attachFile.AttachUrl.Split(',')[0].Replace("\\", "/"); | 
					
						
							|  |  |  |  |                     //} | 
					
						
							|  |  |  |  |                     string projectShortName = BLL.ProjectService.GetShortNameByProjectId(item.ProjectId); | 
					
						
							|  |  |  |  |                     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;\">" + projectShortName + "/" + 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\" style=\"color:yellow;\">" + projectShortName + "/" + 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); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |