修改记录
This commit is contained in:
		
							parent
							
								
									c60228600c
								
							
						
					
					
						commit
						cda63ac05e
					
				@ -525,7 +525,16 @@ namespace APT.HM.WebApi.Controllers.Api
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                if (!string.IsNullOrEmpty(dtSource.Rows[i][18].ToString().Trim()))//责任单位
 | 
					                if (!string.IsNullOrEmpty(dtSource.Rows[i][18].ToString().Trim()))//责任单位
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    item.DEPARTMENT_LIABLE_ID = deps.FirstOrDefault(t => t.NAME == dtSource.Rows[i][18].ToString().Trim()).ID;
 | 
					                    var dep = deps.FirstOrDefault(t => t.NAME == dtSource.Rows[i][18].ToString().Trim());
 | 
				
			||||||
 | 
					                    if (dep != null)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        item.DEPARTMENT_LIABLE_ID = dep.ID;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        var depName = dtSource.Rows[i][18].ToString().Trim();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                if (!string.IsNullOrEmpty(dtSource.Rows[i][19].ToString().Trim()))//责任岗位
 | 
					                if (!string.IsNullOrEmpty(dtSource.Rows[i][19].ToString().Trim()))//责任岗位
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
 | 
				
			|||||||
@ -28,7 +28,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
    [Route("api/BI/BIController")]
 | 
					    [Route("api/BI/BIController")]
 | 
				
			||||||
    public class BIController : APTApiController<T_FM_WORK_TICKET_COMPLETION>
 | 
					    public class BIController : APTApiController<T_FM_WORK_TICKET_COMPLETION>
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        public class GoViewDataReturn
 | 
					        public class GoViewDataReturn
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            public int code { get; set; }
 | 
					            public int code { get; set; }
 | 
				
			||||||
@ -213,7 +213,6 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
                var measure3 = GetEntities<T_HM_EMERGENCY_MEASURES>(t => t.IS_DELETED == false, measureFilter).Select(t => t.NAME).Distinct().Count();
 | 
					                var measure3 = GetEntities<T_HM_EMERGENCY_MEASURES>(t => t.IS_DELETED == false, measureFilter).Select(t => t.NAME).Distinct().Count();
 | 
				
			||||||
                var measure4 = GetEntities<T_HM_ENGINEERING_MEASURES>(t => t.IS_DELETED == false, measureFilter).Select(t => t.NAME).Distinct().Count();
 | 
					                var measure4 = GetEntities<T_HM_ENGINEERING_MEASURES>(t => t.IS_DELETED == false, measureFilter).Select(t => t.NAME).Distinct().Count();
 | 
				
			||||||
                var measure5 = GetEntities<T_HM_MANAGEMENT_MEASURES>(t => t.IS_DELETED == false, measureFilter).Select(t => t.NAME).Distinct().Count();
 | 
					                var measure5 = GetEntities<T_HM_MANAGEMENT_MEASURES>(t => t.IS_DELETED == false, measureFilter).Select(t => t.NAME).Distinct().Count();
 | 
				
			||||||
                //var distinctDepartment = allrisk.Select(t => new { t.SOURCE_DEPARTMENT_ID, t.Nav_SourceDepartment.NAME }).Distinct();
 | 
					 | 
				
			||||||
                var distinctDepartment = GetEntities<T_FM_DEPARTMENT>(t => t.DEPARTMENT_TYPE == 0, new BaseFilter(filter.GetOrgId()));
 | 
					                var distinctDepartment = GetEntities<T_FM_DEPARTMENT>(t => t.DEPARTMENT_TYPE == 0, new BaseFilter(filter.GetOrgId()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                riskData riskData = new riskData();
 | 
					                riskData riskData = new riskData();
 | 
				
			||||||
@ -234,24 +233,12 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
                var distinctArea = allrisk.Select(t => new { t.AREA_ID, AreaName = t.Nav_Area.NAME, SourceDepartmentName = t.Nav_SourceDepartment.NAME }).Distinct();
 | 
					                var distinctArea = allrisk.Select(t => new { t.AREA_ID, AreaName = t.Nav_Area.NAME, SourceDepartmentName = t.Nav_SourceDepartment.NAME }).Distinct();
 | 
				
			||||||
                foreach (var area in distinctArea)
 | 
					                foreach (var area in distinctArea)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
 | 
					                    areaCountModel item = new areaCountModel();
 | 
				
			||||||
                    if (area.SourceDepartmentName.Contains("矿山") || area.SourceDepartmentName.Contains("选矿"))
 | 
					                    item.AREANAME = area.AreaName;
 | 
				
			||||||
                    {
 | 
					                    item.AREACOUNT = allrisk.Count(t => t.AREA_ID == area.AREA_ID);
 | 
				
			||||||
                        areaCountModel item = new areaCountModel();
 | 
					                    item2s.Add(item);
 | 
				
			||||||
 | 
					 | 
				
			||||||
                        if (area.SourceDepartmentName.Contains("矿山"))
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            item.AREATYPE = 0;
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        else
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            item.AREATYPE = 1;
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        item.AREANAME = area.AreaName;
 | 
					 | 
				
			||||||
                        item.AREACOUNT = allrisk.Count(t => t.AREA_ID == area.AREA_ID);
 | 
					 | 
				
			||||||
                        item2s.Add(item);
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var currMonth = DateTime.Now.Month;
 | 
					                var currMonth = DateTime.Now.Month;
 | 
				
			||||||
                DateTime today = DateTime.Today;
 | 
					                DateTime today = DateTime.Today;
 | 
				
			||||||
                for (var i = 1; i < currMonth + 1; i++)
 | 
					                for (var i = 1; i < currMonth + 1; i++)
 | 
				
			||||||
@ -581,10 +568,10 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
                        sDatas.Add(Data);
 | 
					                        sDatas.Add(Data);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                var orderData = sDatas.OrderBy(t => t.NAME1).ThenBy(t=>t.NAME7).ToList();
 | 
					                var orderData = sDatas.OrderBy(t => t.NAME1).ThenBy(t => t.NAME7).ToList();
 | 
				
			||||||
                return orderData;
 | 
					                return orderData;
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user