首页 安全检查次数统计 月度隐患整改情况
1、去除生产单元 2、显示信息 修改为 部门+班组 之前只有部门
This commit is contained in:
		
							parent
							
								
									77cab780c5
								
							
						
					
					
						commit
						8404623780
					
				@ -9,6 +9,7 @@ using APT.BaseData.Domain.Entities.FM;
 | 
				
			|||||||
using APT.MS.Domain.Entities.BS;
 | 
					using APT.MS.Domain.Entities.BS;
 | 
				
			||||||
using System.Linq.Expressions;
 | 
					using System.Linq.Expressions;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using APT.BaseData.Domain.Enums;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace APT.BaseData.Services.Services.BI
 | 
					namespace APT.BaseData.Services.Services.BI
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -71,17 +72,19 @@ namespace APT.BaseData.Services.Services.BI
 | 
				
			|||||||
        /// <param name="listDep">查询部门</param>
 | 
					        /// <param name="listDep">查询部门</param>
 | 
				
			||||||
        /// <param name="MonthBefo">提前月份</param>
 | 
					        /// <param name="MonthBefo">提前月份</param>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public IEnumerable<T_BI_HOME_BSRISKREASON> GetHomeCorrect(Guid? OrgID, List<T_FM_DEPARTMENT> listDep, int? MonthBefo = 5)
 | 
					        public IEnumerable<T_BI_HOME_BSRISKREASON> GetHomeCorrect(Guid? OrgID, List<T_FM_DEPARTMENT> listDep, int? MonthBefo = 5, FMDepartmentType? DEPARTMENT_TYPE = null)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (listDep == null || listDep.Count < 1)
 | 
					            //if (listDep == null || listDep.Count < 1)
 | 
				
			||||||
            {
 | 
					            //{
 | 
				
			||||||
                return new List<T_BI_HOME_BSRISKREASON>();
 | 
					            //    return new List<T_BI_HOME_BSRISKREASON>();
 | 
				
			||||||
            }
 | 
					            //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            DateTime dtMin = DateTime.Now.AddMonths(-1 * MonthBefo.Value);
 | 
					            DateTime dtMin = DateTime.Now.AddMonths(-1 * MonthBefo.Value);
 | 
				
			||||||
 | 
					            List<Guid> listDepID = null;
 | 
				
			||||||
            List<Guid> listDepID = listDep.Select(e => e.ID).ToList();
 | 
					            if (listDep != null && listDep.Count > 0)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                listDepID = listDep.Select(e => e.ID).ToList();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            Expression<Func<T_BI_HOME_BSRISKREASON, bool>> expression = e => e.TYPE == BSCaculateType.RiskCorrect;
 | 
					            Expression<Func<T_BI_HOME_BSRISKREASON, bool>> expression = e => e.TYPE == BSCaculateType.RiskCorrect;
 | 
				
			||||||
            if (dtMin.Year == DateTime.Now.Year)
 | 
					            if (dtMin.Year == DateTime.Now.Year)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@ -91,11 +94,17 @@ namespace APT.BaseData.Services.Services.BI
 | 
				
			|||||||
            {
 | 
					            {
 | 
				
			||||||
                expression = expression.And(e => ((e.YEAR == dtMin.Year && e.MONTH >= dtMin.Month) || e.YEAR > dtMin.Year));
 | 
					                expression = expression.And(e => ((e.YEAR == dtMin.Year && e.MONTH >= dtMin.Month) || e.YEAR > dtMin.Year));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            if (DEPARTMENT_TYPE.HasValue)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                expression = expression.And(e => e.DEPARTMENT_TYPE == DEPARTMENT_TYPE);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (listDepID != null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
                if (listDepID.Count > 1)
 | 
					                if (listDepID.Count > 1)
 | 
				
			||||||
                    expression = expression.And(e => listDepID.Contains(e.DEPARTMENT_ID));
 | 
					                    expression = expression.And(e => listDepID.Contains(e.DEPARTMENT_ID));
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                    expression = expression.And(e => e.DEPARTMENT_ID == listDepID[0]);
 | 
					                    expression = expression.And(e => e.DEPARTMENT_ID == listDepID[0]);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            BaseFilter filterR = new BaseFilter();
 | 
					            BaseFilter filterR = new BaseFilter();
 | 
				
			||||||
            filterR.OrgId = OrgID;
 | 
					            filterR.OrgId = OrgID;
 | 
				
			||||||
            //filterR.Order = DbOrder.ASC;
 | 
					            //filterR.Order = DbOrder.ASC;
 | 
				
			||||||
@ -109,9 +118,15 @@ namespace APT.BaseData.Services.Services.BI
 | 
				
			|||||||
            foreach (var item in listReason)
 | 
					            foreach (var item in listReason)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                item.SOURCENAME = ((BSCorrectType)item.SOURCEVAL).GetDescription();
 | 
					                item.SOURCENAME = ((BSCorrectType)item.SOURCEVAL).GetDescription();
 | 
				
			||||||
 | 
					                if (listDep != null && listDep.Count > 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
                    item.DEPARTMENTNAME = listDep.First(e => e.ID == item.DEPARTMENT_ID).NAME;
 | 
					                    item.DEPARTMENTNAME = listDep.First(e => e.ID == item.DEPARTMENT_ID).NAME;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    item.DEPARTMENTNAME = "公司级";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            return listReason;
 | 
					            return listReason;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,5 @@
 | 
				
			|||||||
using APT.BaseData.Domain.Entities.FM;
 | 
					using APT.BaseData.Domain.Entities.FM;
 | 
				
			||||||
 | 
					using APT.BaseData.Domain.Enums;
 | 
				
			||||||
using APT.MS.Domain.Entities.BI;
 | 
					using APT.MS.Domain.Entities.BI;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
@ -22,7 +23,7 @@ namespace APT.BaseData.Domain.IServices.BI
 | 
				
			|||||||
        /// <param name="listDep">查询部门</param>
 | 
					        /// <param name="listDep">查询部门</param>
 | 
				
			||||||
        /// <param name="MonthBefo">提前月份</param>
 | 
					        /// <param name="MonthBefo">提前月份</param>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        IEnumerable<T_BI_HOME_BSRISKREASON> GetHomeCorrect(Guid? OrgID, List<T_FM_DEPARTMENT> listDep, int? MonthBefo = 5);
 | 
					        IEnumerable<T_BI_HOME_BSRISKREASON> GetHomeCorrect(Guid? OrgID, List<T_FM_DEPARTMENT> listDep, int? MonthBefo = 5, FMDepartmentType? DEPARTMENT_TYPE = null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
 | 
				
			|||||||
@ -8,6 +8,7 @@ using System.Linq;
 | 
				
			|||||||
using APT.Utility;
 | 
					using APT.Utility;
 | 
				
			||||||
using APT.MS.Domain.Entities.BI;
 | 
					using APT.MS.Domain.Entities.BI;
 | 
				
			||||||
using APT.BaseData.Domain.IServices.BI;
 | 
					using APT.BaseData.Domain.IServices.BI;
 | 
				
			||||||
 | 
					using APT.BaseData.Domain.Enums;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace APT.SC.WebApi.Controllers.Api.BI
 | 
					namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -642,7 +643,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
                #region //月度 隐患整改情况
 | 
					                #region //月度 隐患整改情况
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                List<T_BI_HOME_BSRISKREASON> listCorrectT = BIHomeService.GetHomeCorrect(filter.OrgId, listDep).ToList();
 | 
					                List<T_BI_HOME_BSRISKREASON> listCorrectT = BIHomeService.GetHomeCorrect(filter.OrgId, null, 5, FMDepartmentType.公司).ToList();//listDep
 | 
				
			||||||
                string Val = string.Empty;// 0 ,1,2,3
 | 
					                string Val = string.Empty;// 0 ,1,2,3
 | 
				
			||||||
                //string NameMonth = dtNow.AddMonths(-5).Month.ToString() + "月," + dtNow.AddMonths(-4).Month.ToString() + "月," + dtNow.AddMonths(-3).Month.ToString() + "月," + dtNow.AddMonths(-2).Month.ToString() + "月," + dtNow.AddMonths(-1).Month.ToString() + "月," + dtNow.Month.ToString() + "月";
 | 
					                //string NameMonth = dtNow.AddMonths(-5).Month.ToString() + "月," + dtNow.AddMonths(-4).Month.ToString() + "月," + dtNow.AddMonths(-3).Month.ToString() + "月," + dtNow.AddMonths(-2).Month.ToString() + "月," + dtNow.AddMonths(-1).Month.ToString() + "月," + dtNow.Month.ToString() + "月";
 | 
				
			||||||
                string NameMonth = dtNow.AddMonths(-5).ToString("yyyy-MM") + "," + dtNow.AddMonths(-4).ToString("yyyy-MM") + "," + dtNow.AddMonths(-3).ToString("yyyy-MM") + "," + dtNow.AddMonths(-2).ToString("yyyy-MM") + "," + dtNow.AddMonths(-1).ToString("yyyy-MM") + "," + dtNow.ToString("yyyy-MM");
 | 
					                string NameMonth = dtNow.AddMonths(-5).ToString("yyyy-MM") + "," + dtNow.AddMonths(-4).ToString("yyyy-MM") + "," + dtNow.AddMonths(-3).ToString("yyyy-MM") + "," + dtNow.AddMonths(-2).ToString("yyyy-MM") + "," + dtNow.AddMonths(-1).ToString("yyyy-MM") + "," + dtNow.ToString("yyyy-MM");
 | 
				
			||||||
@ -894,18 +895,21 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
                //filterD.SelectField = new List<string> { "ID", "NAME", "DEPARTMENT_TYPE", "PARENT_ID" };
 | 
					                //filterD.SelectField = new List<string> { "ID", "NAME", "DEPARTMENT_TYPE", "PARENT_ID" };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                //var listDep1MineType = GetEntities<T_FM_DEPARTMENT>(t => t.MineType.HasValue && t.MineType == MineType && t.DEPARTMENT_TYPE == 0, filterD, null);//部门就可以了 因为都相向 统计了
 | 
					                //var listDep1MineType = GetEntities<T_FM_DEPARTMENT>(t => t.MineType.HasValue && t.MineType == MineType && t.DEPARTMENT_TYPE == 0, filterD, null);//部门就可以了 因为都相向 统计了
 | 
				
			||||||
                if (listDep != null && listDep.Any())
 | 
					
 | 
				
			||||||
 | 
					                var listDep1MineTypeBMBZ = GetEntities<T_FM_DEPARTMENT>(t => t.DEPARTMENT_TYPE == 0|| t.DEPARTMENT_TYPE == 2, null, null); //FMDepartmentType 部门=0,  车间=1,   班组=2,  公司=3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (listDep1MineTypeBMBZ != null && listDep1MineTypeBMBZ.Any())
 | 
				
			||||||
                { 
 | 
					                { 
 | 
				
			||||||
                    List<HomeSafeCheckCountMonth> ListSafeCheckYearMonth = new List<HomeSafeCheckCountMonth>();
 | 
					                    List<HomeSafeCheckCountMonth> ListSafeCheckYearMonth = new List<HomeSafeCheckCountMonth>();
 | 
				
			||||||
                    int befoMonth = 12;
 | 
					                    int befoMonth = 12;
 | 
				
			||||||
                    List<T_BI_HOME_BSRISKREASON> ListSafeCheckYearMonthT = BIHomeService.GetHomeCheckCountMonth(filter.OrgId, listDep.ToList(), befoMonth).ToList();
 | 
					                    List<T_BI_HOME_BSRISKREASON> ListSafeCheckYearMonthT = BIHomeService.GetHomeCheckCountMonth(filter.OrgId, listDep1MineTypeBMBZ.ToList(), befoMonth).ToList();
 | 
				
			||||||
                    var listCheckTypeIDT = ListSafeCheckYearMonthT.Select(e => e.SOURCEID).Distinct().ToList();
 | 
					                    var listCheckTypeIDT = ListSafeCheckYearMonthT.Select(e => e.SOURCEID).Distinct().ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    //var enums = GetEntity<T_FM_ENUMS>(e => e.VALUE == MineType && e.CODE == "BSMineTypeEnum");
 | 
					                    //var enums = GetEntity<T_FM_ENUMS>(e => e.VALUE == MineType && e.CODE == "BSMineTypeEnum");
 | 
				
			||||||
                    //if (enums != null)
 | 
					                    //if (enums != null)
 | 
				
			||||||
                    //{
 | 
					                    //{
 | 
				
			||||||
                    //var listTypeMine = GetEntities<MS.Domain.Entities.BS.T_BS_CHECK_TYPE_MINETYPE>(e => e.MINETYPE_ENUMS_ID == enums.ID, null, null);
 | 
					                    //var listTypeMine = GetEntities<MS.Domain.Entities.BS.T_BS_CHECK_TYPE_MINETYPE>(e => e.MINETYPE_ENUMS_ID == enums.ID, null, null);
 | 
				
			||||||
                    var listTypeMine = GetEntities<MS.Domain.Entities.BS.T_BS_CHECK_TYPE_MINETYPE>(e => 1 == 1, null, null);
 | 
					                    var listTypeMine = GetEntities<MS.Domain.Entities.BS.T_BS_CHECK_TYPE_MINETYPE>(null, null, null);
 | 
				
			||||||
                    if (listTypeMine != null && listTypeMine.Any())
 | 
					                    if (listTypeMine != null && listTypeMine.Any())
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        var listMineCheckTypeID = listTypeMine.Where(e => e.CHECK_TYPE_ID.HasValue).Select(e => e.CHECK_TYPE_ID.Value);
 | 
					                        var listMineCheckTypeID = listTypeMine.Where(e => e.CHECK_TYPE_ID.HasValue).Select(e => e.CHECK_TYPE_ID.Value);
 | 
				
			||||||
@ -1013,17 +1017,17 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
            {
 | 
					            {
 | 
				
			||||||
                //按生产单元 获取数据 
 | 
					                //按生产单元 获取数据 
 | 
				
			||||||
                HomeDetailSafeCheckCountMonth result = new HomeDetailSafeCheckCountMonth();
 | 
					                HomeDetailSafeCheckCountMonth result = new HomeDetailSafeCheckCountMonth();
 | 
				
			||||||
                if (string.IsNullOrEmpty(filter.Keyword))
 | 
					                //if (string.IsNullOrEmpty(filter.Keyword))
 | 
				
			||||||
                {
 | 
					                //{
 | 
				
			||||||
                    return result;
 | 
					                //    return result;
 | 
				
			||||||
                }
 | 
					                //}
 | 
				
			||||||
                int MineType = int.Parse(filter.Keyword);
 | 
					                //int MineType = int.Parse(filter.Keyword);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                BaseFilter filterD = new BaseFilter(filter.OrgId);
 | 
					                BaseFilter filterD = new BaseFilter(filter.OrgId);
 | 
				
			||||||
                filterD.SelectField = new List<string> { "ID", "NAME", "DEPARTMENT_TYPE", "PARENT_ID" };
 | 
					                filterD.SelectField = new List<string> { "ID", "NAME", "DEPARTMENT_TYPE", "PARENT_ID" };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var listDep1MineType = GetEntities<T_FM_DEPARTMENT>(t => t.MineType.HasValue && t.MineType == MineType && (t.DEPARTMENT_TYPE == 1 || t.DEPARTMENT_TYPE == 2), filterD, null);
 | 
					                var listDep1MineType = GetEntities<T_FM_DEPARTMENT>(t => t.MineType.HasValue  && (t.DEPARTMENT_TYPE == 1 || t.DEPARTMENT_TYPE == 2), filterD, null);//&& t.MineType == MineType
 | 
				
			||||||
                //FMDepartmentType 部门=0,  车间=1,   班组=2,  公司=3
 | 
					                //FMDepartmentType 部门=0,  车间=1,   班组=2,  公司=3
 | 
				
			||||||
                if (listDep1MineType == null || !listDep1MineType.Any())
 | 
					                if (listDep1MineType == null || !listDep1MineType.Any())
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
@ -1044,22 +1048,22 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
                if (listDepCJ == null || listDepCJ.Count < 1 || listDepBZ == null || listDepBZ.Count < 1)
 | 
					                if (listDepCJ == null || listDepCJ.Count < 1 || listDepBZ == null || listDepBZ.Count < 1)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    //深度查找 部门 MineType 只能存一个值
 | 
					                    //深度查找 部门 MineType 只能存一个值
 | 
				
			||||||
                    enums = GetEntity<T_FM_ENUMS>(e => e.VALUE == MineType && e.CODE == "BSMineTypeEnum");
 | 
					                    //enums = GetEntity<T_FM_ENUMS>(e => e.VALUE == MineType && e.CODE == "BSMineTypeEnum");
 | 
				
			||||||
                    if (enums == null)
 | 
					                    //if (enums == null)
 | 
				
			||||||
                    {
 | 
					                    //{
 | 
				
			||||||
                        throw new Exception("获取生产类型失败");
 | 
					                    //    throw new Exception("获取生产类型失败");
 | 
				
			||||||
                    }
 | 
					                    //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    var listDepID = GetEntities<T_FM_DEPARTMENT_PRODUCTION_UNIT>(e => e.ENUMS_ID == enums.ID, null, null).Select(e => e.DEPARTMENT_ID);
 | 
					                    //var listDepID = GetEntities<T_FM_DEPARTMENT_PRODUCTION_UNIT>(e => e.ENUMS_ID == enums.ID, null, null).Select(e => e.DEPARTMENT_ID);
 | 
				
			||||||
                    if (listDepID != null && listDepID.Any())
 | 
					                    //if (listDepID != null && listDepID.Any())
 | 
				
			||||||
                    {
 | 
					                    //{
 | 
				
			||||||
                        listDep1MineType = GetEntities<T_FM_DEPARTMENT>(t => listDepID.Contains(t.ID) && (t.DEPARTMENT_TYPE == 1 || t.DEPARTMENT_TYPE == 2), filterD, null);
 | 
					                    listDep1MineType = GetEntities<T_FM_DEPARTMENT>(t => (t.DEPARTMENT_TYPE == 1 || t.DEPARTMENT_TYPE == 2), filterD, null);// listDepID.Contains(t.ID) &&
 | 
				
			||||||
                    if (listDep1MineType != null && listDep1MineType.Any())
 | 
					                    if (listDep1MineType != null && listDep1MineType.Any())
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        listDepCJ = listDep1MineType.Where(e => e.DEPARTMENT_TYPE == 1).ToList();
 | 
					                        listDepCJ = listDep1MineType.Where(e => e.DEPARTMENT_TYPE == 1).ToList();
 | 
				
			||||||
                        listDepBZ = listDep1MineType.Where(e => e.DEPARTMENT_TYPE == 2).ToList();
 | 
					                        listDepBZ = listDep1MineType.Where(e => e.DEPARTMENT_TYPE == 2).ToList();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    }
 | 
					                    //}
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (listDepCJ == null || listDepCJ.Count < 1 || listDepBZ == null || listDepBZ.Count < 1)
 | 
					                if (listDepCJ == null || listDepCJ.Count < 1 || listDepBZ == null || listDepBZ.Count < 1)
 | 
				
			||||||
@ -1072,26 +1076,27 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
                List<T_BI_HOME_BSRISKREASON> ListSafeCheckYearMonthT = BIHomeService.GetHomeCheckCountMonth(filter.OrgId, listDep1MineType.ToList(), befoMonth).ToList();
 | 
					                List<T_BI_HOME_BSRISKREASON> ListSafeCheckYearMonthT = BIHomeService.GetHomeCheckCountMonth(filter.OrgId, listDep1MineType.ToList(), befoMonth).ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var listCheckTypeIDT = ListSafeCheckYearMonthT.Select(e => e.SOURCEID).Distinct().ToList();
 | 
					                var listCheckTypeIDT = ListSafeCheckYearMonthT.Select(e => e.SOURCEID).Distinct().ToList();
 | 
				
			||||||
                if (enums == null)
 | 
					
 | 
				
			||||||
                {
 | 
					                //if (enums == null)
 | 
				
			||||||
                    enums = GetEntity<T_FM_ENUMS>(e => e.VALUE == MineType && e.CODE == "BSMineTypeEnum");
 | 
					                //{
 | 
				
			||||||
                }
 | 
					                //    enums = GetEntity<T_FM_ENUMS>(e => e.VALUE == MineType && e.CODE == "BSMineTypeEnum");
 | 
				
			||||||
                if (enums != null)
 | 
					                //}
 | 
				
			||||||
                {
 | 
					                //if (enums != null)
 | 
				
			||||||
                    var listTypeMine = GetEntities<MS.Domain.Entities.BS.T_BS_CHECK_TYPE_MINETYPE>(e => e.MINETYPE_ENUMS_ID == enums.ID, null, null);
 | 
					                //{
 | 
				
			||||||
                    if (listTypeMine != null && listTypeMine.Any())
 | 
					                //var listTypeMine = GetEntities<MS.Domain.Entities.BS.T_BS_CHECK_TYPE_MINETYPE>(e => e.MINETYPE_ENUMS_ID == enums.ID, null, null);
 | 
				
			||||||
                    {
 | 
					                //if (listTypeMine != null && listTypeMine.Any())
 | 
				
			||||||
                        var listMineCheckTypeID = listTypeMine.Where(e => e.CHECK_TYPE_ID.HasValue).Select(e => e.CHECK_TYPE_ID.Value);
 | 
					                //{
 | 
				
			||||||
                        for (int i = 0; i < listCheckTypeIDT.Count; i++)
 | 
					                //    var listMineCheckTypeID = listTypeMine.Where(e => e.CHECK_TYPE_ID.HasValue).Select(e => e.CHECK_TYPE_ID.Value);
 | 
				
			||||||
                        {
 | 
					                //    for (int i = 0; i < listCheckTypeIDT.Count; i++)
 | 
				
			||||||
                            if (!listMineCheckTypeID.Contains(listCheckTypeIDT[i]))
 | 
					                //    {
 | 
				
			||||||
                            {
 | 
					                //        if (!listMineCheckTypeID.Contains(listCheckTypeIDT[i]))
 | 
				
			||||||
                                listCheckTypeIDT.RemoveAt(i);
 | 
					                //        {
 | 
				
			||||||
                                i--;
 | 
					                //            listCheckTypeIDT.RemoveAt(i);
 | 
				
			||||||
                            }
 | 
					                //            i--;
 | 
				
			||||||
                        }
 | 
					                //        }
 | 
				
			||||||
                    }
 | 
					                //    }
 | 
				
			||||||
                }
 | 
					                //}
 | 
				
			||||||
 | 
					                //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var listCheckType = GetEntities<MS.Domain.Entities.BS.T_BS_CHECK_TYPE>(e => listCheckTypeIDT.Contains(e.ID), null, null).OrderBy(e => e.PARENT_ID).ThenBy(e => e.NUM).ToList();
 | 
					                var listCheckType = GetEntities<MS.Domain.Entities.BS.T_BS_CHECK_TYPE>(e => listCheckTypeIDT.Contains(e.ID), null, null).OrderBy(e => e.PARENT_ID).ThenBy(e => e.NUM).ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1254,11 +1259,11 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
            {
 | 
					            {
 | 
				
			||||||
                //按生产单元 获取数据 
 | 
					                //按生产单元 获取数据 
 | 
				
			||||||
                HomeDetailRiskCountMonth result = new HomeDetailRiskCountMonth();
 | 
					                HomeDetailRiskCountMonth result = new HomeDetailRiskCountMonth();
 | 
				
			||||||
                if (string.IsNullOrEmpty(filter.Keyword))
 | 
					                //if (string.IsNullOrEmpty(filter.Keyword))
 | 
				
			||||||
                {
 | 
					                //{
 | 
				
			||||||
                    return result;
 | 
					                //    return result;
 | 
				
			||||||
                }
 | 
					                //}
 | 
				
			||||||
                int MineType = int.Parse(filter.Keyword);
 | 
					                //int MineType = int.Parse(filter.Keyword);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                BaseFilter filterD = new BaseFilter(filter.OrgId);
 | 
					                BaseFilter filterD = new BaseFilter(filter.OrgId);
 | 
				
			||||||
                filterD.SelectField = new List<string> { "ID", "NAME", "DEPARTMENT_TYPE", "PARENT_ID" };
 | 
					                filterD.SelectField = new List<string> { "ID", "NAME", "DEPARTMENT_TYPE", "PARENT_ID" };
 | 
				
			||||||
@ -1266,7 +1271,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
                ///部门
 | 
					                ///部门
 | 
				
			||||||
                //var listDep1MineTypeSum = GetEntities<T_FM_DEPARTMENT>(t => t.MineType.HasValue && t.MineType == MineType && t.DEPARTMENT_TYPE == 0, filterD, null);
 | 
					                //var listDep1MineTypeSum = GetEntities<T_FM_DEPARTMENT>(t => t.MineType.HasValue && t.MineType == MineType && t.DEPARTMENT_TYPE == 0, filterD, null);
 | 
				
			||||||
                ///车间 班组
 | 
					                ///车间 班组
 | 
				
			||||||
                var listDep1MineType = GetEntities<T_FM_DEPARTMENT>(t => t.MineType.HasValue && t.MineType == MineType && (t.DEPARTMENT_TYPE == 1 || t.DEPARTMENT_TYPE == 2 || t.DEPARTMENT_TYPE == 0), filterD, null);
 | 
					                var listDep1MineType = GetEntities<T_FM_DEPARTMENT>(t => t.DEPARTMENT_TYPE == 1 || t.DEPARTMENT_TYPE == 2 || t.DEPARTMENT_TYPE == 0, filterD, null);//t.MineType.HasValue  && (&& t.MineType == MineType)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                //FMDepartmentType 部门=0,  车间=1,   班组=2,  公司=3
 | 
					                //FMDepartmentType 部门=0,  车间=1,   班组=2,  公司=3
 | 
				
			||||||
                if (listDep1MineType == null || !listDep1MineType.Any())
 | 
					                if (listDep1MineType == null || !listDep1MineType.Any())
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user