BI0052 跑批报错处理 GetCount(用法不懂哪里有问题) SPS更早就已经处理了
This commit is contained in:
		
							parent
							
								
									4be8c45cc1
								
							
						
					
					
						commit
						2dcb1eaaea
					
				@ -5188,7 +5188,7 @@ namespace APT.BS.WebApi.Controllers.Api
 | 
				
			|||||||
                filterRiskContent.IgnoreDataRule = true;
 | 
					                filterRiskContent.IgnoreDataRule = true;
 | 
				
			||||||
                var IlistRiskContent = GetEntities(expressionSC, filterRiskContent);
 | 
					                var IlistRiskContent = GetEntities(expressionSC, filterRiskContent);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                BaseFilter filterArea = new BaseFilter();
 | 
					                BaseFilter filterArea = new BaseFilter(pageFilter.OrgId);
 | 
				
			||||||
                filterArea.SelectField = new List<string> { "ID", "NAME" };
 | 
					                filterArea.SelectField = new List<string> { "ID", "NAME" };
 | 
				
			||||||
                var IlistArea = GetEntities(expressionA, filterArea, null);//<T_HM_RISK_AREA>
 | 
					                var IlistArea = GetEntities(expressionA, filterArea, null);//<T_HM_RISK_AREA>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -5310,7 +5310,7 @@ namespace APT.BS.WebApi.Controllers.Api
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                expression = expression.And(e => CHECKCONTENT == e.CHECKCONTENT);
 | 
					                expression = expression.And(e => CHECKCONTENT == e.CHECKCONTENT);
 | 
				
			||||||
                expression = expression.And(e => DESCREPTION == e.DESCREPTION);
 | 
					                expression = expression.And(e => DESCREPTION == e.DESCREPTION);
 | 
				
			||||||
                BaseFilter fiter = new BaseFilter();
 | 
					                BaseFilter fiter = new BaseFilter(pageFilter.OrgId);
 | 
				
			||||||
                fiter.IgnoreDataRule = true;
 | 
					                fiter.IgnoreDataRule = true;
 | 
				
			||||||
                var listContent = GetEntities(expression, fiter, "Nav_Department", "Nav_UserActualDeal");
 | 
					                var listContent = GetEntities(expression, fiter, "Nav_Department", "Nav_UserActualDeal");
 | 
				
			||||||
                if (listContent == null || !listContent.Any())
 | 
					                if (listContent == null || !listContent.Any())
 | 
				
			||||||
 | 
				
			|||||||
@ -565,24 +565,61 @@ namespace APT.PP.WebApi.Controllers.Api.PP
 | 
				
			|||||||
            Expression<Func<T_BS_RISK_SUBMIT_CONTENT, bool>> expression = e => !e.IS_DELETED && e.ISFINISHINTTIME.HasValue && e.ISFINISHINTTIME.Value && e.CREATE_TIME.HasValue && dtMin < e.CREATE_TIME.Value && e.CREATE_TIME.Value < dtMax;//按期整改
 | 
					            Expression<Func<T_BS_RISK_SUBMIT_CONTENT, bool>> expression = e => !e.IS_DELETED && e.ISFINISHINTTIME.HasValue && e.ISFINISHINTTIME.Value && e.CREATE_TIME.HasValue && dtMin < e.CREATE_TIME.Value && e.CREATE_TIME.Value < dtMax;//按期整改
 | 
				
			||||||
            Expression<Func<T_BS_RISK_SUBMIT_CONTENT, bool>> expression2 = e => !e.IS_DELETED && e.OKDATE.HasValue && e.LastDateUser.HasValue && e.OKDATE.Value > e.LastDateUser.Value && e.CREATE_TIME.HasValue && dtMin < e.CREATE_TIME.Value && e.CREATE_TIME.Value < dtMax;//超期整改
 | 
					            Expression<Func<T_BS_RISK_SUBMIT_CONTENT, bool>> expression2 = e => !e.IS_DELETED && e.OKDATE.HasValue && e.LastDateUser.HasValue && e.OKDATE.Value > e.LastDateUser.Value && e.CREATE_TIME.HasValue && dtMin < e.CREATE_TIME.Value && e.CREATE_TIME.Value < dtMax;//超期整改
 | 
				
			||||||
            Expression<Func<T_BS_RISK_SUBMIT_CONTENT, bool>> expression3 = e => !e.IS_DELETED && !e.OKDATE.HasValue && e.CREATE_TIME.HasValue && dtMin < e.CREATE_TIME.Value && e.CREATE_TIME.Value < dtMax;//未完成
 | 
					            Expression<Func<T_BS_RISK_SUBMIT_CONTENT, bool>> expression3 = e => !e.IS_DELETED && !e.OKDATE.HasValue && e.CREATE_TIME.HasValue && dtMin < e.CREATE_TIME.Value && e.CREATE_TIME.Value < dtMax;//未完成
 | 
				
			||||||
 | 
					            BaseFilter filter = new BaseFilter(ORG_ID);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (MineType != BSMineTypeEnum.All)
 | 
					            if (MineType != BSMineTypeEnum.All)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                int iMineType = (int)MineType;
 | 
					                int iMineType = (int)MineType;
 | 
				
			||||||
                expression = expression.And(e => e.Nav_SafeCheck.CHECKOBJECT.HasValue && e.Nav_SafeCheck.CHECKOBJECT.Value == iMineType);
 | 
					                expression = expression.And(e => e.SAFE_CHECK_ID.HasValue && e.Nav_SafeCheck != null && e.Nav_SafeCheck.CHECKOBJECT.HasValue && e.Nav_SafeCheck.CHECKOBJECT.Value == iMineType);
 | 
				
			||||||
                expression2 = expression2.And(e => e.Nav_SafeCheck.CHECKOBJECT.HasValue && e.Nav_SafeCheck.CHECKOBJECT.Value == iMineType);
 | 
					                expression2 = expression2.And(e => e.SAFE_CHECK_ID.HasValue && e.Nav_SafeCheck != null && e.Nav_SafeCheck.CHECKOBJECT.HasValue && e.Nav_SafeCheck.CHECKOBJECT.Value == iMineType);
 | 
				
			||||||
                expression3 = expression3.And(e => e.Nav_SafeCheck.CHECKOBJECT.HasValue && e.Nav_SafeCheck.CHECKOBJECT.Value == iMineType);
 | 
					                expression3 = expression3.And(e => e.SAFE_CHECK_ID.HasValue && e.Nav_SafeCheck != null && e.Nav_SafeCheck.CHECKOBJECT.HasValue && e.Nav_SafeCheck.CHECKOBJECT.Value == iMineType);
 | 
				
			||||||
            }
 | 
					
 | 
				
			||||||
            BaseFilter filter = null;
 | 
					                filter.SelectField = new List<string> { "ID", "SAFE_CHECK_ID", "Nav_SafeCheck.ID" };
 | 
				
			||||||
            if (MineType != BSMineTypeEnum.All)
 | 
					
 | 
				
			||||||
 | 
					                try
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                filter = new BaseFilter();
 | 
					                    //GetCount  filter.DataRule 加属性也不起作用 !!!!!!!
 | 
				
			||||||
                filter.DataRule.Add("Nav_SafeCheck");
 | 
					                    typeYearMonth.INTTIMECOUNT = GetEntities(expression, filter, "Nav_SafeCheck").Count();//按期整改
 | 
				
			||||||
 | 
					                    typeYearMonth.OUTTIMECOUNT = GetEntities(expression2, filter, "Nav_SafeCheck").Count();//超期整改
 | 
				
			||||||
 | 
					                    typeYearMonth.NOTFINISHCOUN = GetEntities(expression3, filter, "Nav_SafeCheck").Count();//未完成
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					                catch (Exception ex)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    throw new Exception(("MsgDIY Message: " + ex.Message) + (!string.IsNullOrEmpty(ex.StackTrace) ? ("  StackTrace: " + ex.StackTrace) : ""));
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                try
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
                    typeYearMonth.INTTIMECOUNT = GetCount<T_BS_RISK_SUBMIT_CONTENT>(expression, filter);//按期整改
 | 
					                    typeYearMonth.INTTIMECOUNT = GetCount<T_BS_RISK_SUBMIT_CONTENT>(expression, filter);//按期整改
 | 
				
			||||||
                    typeYearMonth.OUTTIMECOUNT = GetCount<T_BS_RISK_SUBMIT_CONTENT>(expression2, filter);//超期整改
 | 
					                    typeYearMonth.OUTTIMECOUNT = GetCount<T_BS_RISK_SUBMIT_CONTENT>(expression2, filter);//超期整改
 | 
				
			||||||
                    typeYearMonth.NOTFINISHCOUN = GetCount<T_BS_RISK_SUBMIT_CONTENT>(expression3, filter);//未完成
 | 
					                    typeYearMonth.NOTFINISHCOUN = GetCount<T_BS_RISK_SUBMIT_CONTENT>(expression3, filter);//未完成
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                catch (Exception ex)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    throw new Exception(("MsgDIY Message: " + ex.Message) + (!string.IsNullOrEmpty(ex.StackTrace) ? ("  StackTrace: " + ex.StackTrace) : ""));
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //if (MineType != BSMineTypeEnum.All)
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					            //    int iMineType = (int)MineType;
 | 
				
			||||||
 | 
					            //    expression = expression.And(e => e.Nav_SafeCheck.CHECKOBJECT.HasValue && e.Nav_SafeCheck.CHECKOBJECT.Value == iMineType);
 | 
				
			||||||
 | 
					            //    expression2 = expression2.And(e => e.Nav_SafeCheck.CHECKOBJECT.HasValue && e.Nav_SafeCheck.CHECKOBJECT.Value == iMineType);
 | 
				
			||||||
 | 
					            //    expression3 = expression3.And(e => e.Nav_SafeCheck.CHECKOBJECT.HasValue && e.Nav_SafeCheck.CHECKOBJECT.Value == iMineType);
 | 
				
			||||||
 | 
					            //}
 | 
				
			||||||
 | 
					            //BaseFilter filter = null;
 | 
				
			||||||
 | 
					            //if (MineType != BSMineTypeEnum.All)
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					            //    filter = new BaseFilter(ORG_ID);
 | 
				
			||||||
 | 
					            //    filter.DataRule.Add("Nav_SafeCheck");
 | 
				
			||||||
 | 
					            //}
 | 
				
			||||||
 | 
					            //typeYearMonth.INTTIMECOUNT = GetCount<T_BS_RISK_SUBMIT_CONTENT>(expression, filter);//按期整改
 | 
				
			||||||
 | 
					            //typeYearMonth.OUTTIMECOUNT = GetCount<T_BS_RISK_SUBMIT_CONTENT>(expression2, filter);//超期整改
 | 
				
			||||||
 | 
					            //typeYearMonth.NOTFINISHCOUN = GetCount<T_BS_RISK_SUBMIT_CONTENT>(expression3, filter);//未完成
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            typeYearMonth.ALLCOUNT = typeYearMonth.INTTIMECOUNT + typeYearMonth.OUTTIMECOUNT + typeYearMonth.NOTFINISHCOUN;
 | 
					            typeYearMonth.ALLCOUNT = typeYearMonth.INTTIMECOUNT + typeYearMonth.OUTTIMECOUNT + typeYearMonth.NOTFINISHCOUN;
 | 
				
			||||||
            if (typeYearMonth.ALLCOUNT == 0)
 | 
					            if (typeYearMonth.ALLCOUNT == 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
				
			|||||||
@ -423,7 +423,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
                if (!string.IsNullOrEmpty(filter.Keyword))
 | 
					                if (!string.IsNullOrEmpty(filter.Keyword))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    int MineType = int.Parse(filter.Keyword.ToString());
 | 
					                    int MineType = int.Parse(filter.Keyword.ToString());
 | 
				
			||||||
                    BaseFilter filterD = new BaseFilter();
 | 
					                    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 == 0, filterD, null);//部门就可以了 因为都相向 统计了
 | 
					                    var listDep1MineType = GetEntities<T_FM_DEPARTMENT>(t => t.MineType.HasValue && t.MineType == MineType && t.DEPARTMENT_TYPE == 0, filterD, null);//部门就可以了 因为都相向 统计了
 | 
				
			||||||
@ -1018,7 +1018,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                int MineType = int.Parse(filter.Keyword);
 | 
					                int MineType = int.Parse(filter.Keyword);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                BaseFilter filterD = new BaseFilter();
 | 
					                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" };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1259,7 +1259,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                int MineType = int.Parse(filter.Keyword);
 | 
					                int MineType = int.Parse(filter.Keyword);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                BaseFilter filterD = new BaseFilter();
 | 
					                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" };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ///部门
 | 
					                ///部门
 | 
				
			||||||
 | 
				
			|||||||
@ -57,7 +57,7 @@ namespace APT.SC.WebApi.Controllers.Api.SC
 | 
				
			|||||||
                if (!string.IsNullOrEmpty(filter.Parameter1))
 | 
					                if (!string.IsNullOrEmpty(filter.Parameter1))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    var LoginID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
 | 
					                    var LoginID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
 | 
				
			||||||
                    BaseFilter fiterMT = new BaseFilter();
 | 
					                    BaseFilter fiterMT = new BaseFilter(filter.OrgId);
 | 
				
			||||||
                    fiterMT.Order = DbOrder.DESC;
 | 
					                    fiterMT.Order = DbOrder.DESC;
 | 
				
			||||||
                    fiterMT.Orders.Add(new DataOrder() { Field = "CREATE_TIME", Order = DbOrder.DESC });
 | 
					                    fiterMT.Orders.Add(new DataOrder() { Field = "CREATE_TIME", Order = DbOrder.DESC });
 | 
				
			||||||
                    SCMEETINGTYPE MEETINGTYPE = (SCMEETINGTYPE)int.Parse(filter.Parameter1);
 | 
					                    SCMEETINGTYPE MEETINGTYPE = (SCMEETINGTYPE)int.Parse(filter.Parameter1);
 | 
				
			||||||
@ -1634,7 +1634,7 @@ namespace APT.SC.WebApi.Controllers.Api.SC
 | 
				
			|||||||
                        //基层安全会按部门 / 车间 / 班组点选或模糊查询,默认部门所有人员向下包含
 | 
					                        //基层安全会按部门 / 车间 / 班组点选或模糊查询,默认部门所有人员向下包含
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        var LoginID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
 | 
					                        var LoginID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
 | 
				
			||||||
                        BaseFilter fiterMT = new BaseFilter();
 | 
					                        BaseFilter fiterMT = new BaseFilter(filter.OrgId);
 | 
				
			||||||
                        fiterMT.Order = DbOrder.DESC;
 | 
					                        fiterMT.Order = DbOrder.DESC;
 | 
				
			||||||
                        fiterMT.Orders.Add(new DataOrder() { Field = "CREATE_TIME", Order = DbOrder.DESC });
 | 
					                        fiterMT.Orders.Add(new DataOrder() { Field = "CREATE_TIME", Order = DbOrder.DESC });
 | 
				
			||||||
                        //SCMEETINGTYPE MEETINGTYPE = (SCMEETINGTYPE)int.Parse(filter.Parameter1);
 | 
					                        //SCMEETINGTYPE MEETINGTYPE = (SCMEETINGTYPE)int.Parse(filter.Parameter1);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user