Example #1
0
        /// <summary>
        /// 查看事件类型,事发园区,预案类型,开始时间与结束时间相同的预案
        /// </summary>
        /// <param name="eventPlanId"></param>
        /// <param name="eventTypeId">事件类型</param>
        /// <param name="regionId">事发园区</param>
        /// <param name="planTime">开始时间</param>
        /// <param name="executionCycle">周期</param>
        /// <param name="endTime">结束时间</param>
        /// <returns></returns>
        public List <EventPlanInfo> CheckPlanTimeOccupied(int eventPlanId, int eventTypeId, int regionId, string planTime, string executionCycle, string endTime)
        {
            try
            {
                EventPlanInfo        eventPlanInfo     = new EventPlanInfo();
                List <EventPlanInfo> eventPlanInfoList = new List <EventPlanInfo>();
                eventPlanInfo.event_type      = eventTypeId;
                eventPlanInfo.region_Id       = regionId;
                eventPlanInfo.start_time      = planTime;
                eventPlanInfo.id              = eventPlanId;
                eventPlanInfo.end_time        = endTime;
                eventPlanInfo.execution_cycle = executionCycle;
                eventPlanInfo.type            = (int)RelateType.事件预案;
                eventPlanInfo.plan_status     = (int)PlanStatus.废止;
                if (endTime == "")
                {
                    if (eventPlanId == -1)
                    {
                        string sql = IBatisHelper.GetRuntimeSql(this.mapContext, "IsEventPlanTimeOccupied", eventPlanInfo);
                        eventPlanInfoList = mapContext.QueryForList <EventPlanInfo>("IsEventPlanTimeOccupied", eventPlanInfo).ToList();
                    }
                    else
                    {
                        eventPlanInfoList = mapContext.QueryForList <EventPlanInfo>("UpdateEventPlanTimeOccupied", eventPlanInfo).ToList();
                    }
                }
                else
                {
                    if (eventPlanId == -1)
                    {
                        eventPlanInfoList = mapContext.QueryForList <EventPlanInfo>("IsTimeSlotOccupy", eventPlanInfo).ToList();
                    }
                    else
                    {
                        eventPlanInfoList = mapContext.QueryForList <EventPlanInfo>("UpdateIsTimeSlotOccupy", eventPlanInfo).ToList();
                    }
                }

                return(eventPlanInfoList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
 /// <summary>
 /// 分页查询获取时间预案 2016.12.04 乔会会
 /// </summary>
 /// <param name="servDevicePlanQuery"></param>
 /// <param name="pageSize">每页记录数</param>
 /// <param name="pageNumber">当前页码</param>
 /// <param name="totalNumber">共多少条</param>
 /// <returns></returns>
 public List <EventPlanInfo> GetEntities(ServEventPlanQuery servEventPlanQuery, int pageNumber, int pageSize, out int totalNumber)
 {
     try
     {
         List <ServEventPlanModel> EventPlanlist     = new List <ServEventPlanModel>();
         List <EventPlanInfo>      eventPlanInfoList = new List <EventPlanInfo>();
         EventPlanlist = servEventPlanDAL.GetEntities(servEventPlanQuery, pageSize, pageNumber, out totalNumber);
         EventPlanInfo eventPlanInfoModel;
         foreach (ServEventPlanModel item in EventPlanlist)
         {
             eventPlanInfoModel            = new EventPlanInfo();
             eventPlanInfoModel.id         = item.id;
             eventPlanInfoModel.plan_code  = item.plan_code;
             eventPlanInfoModel.plan_name  = item.plan_name;
             eventPlanInfoModel.plan_level = item.plan_level;
             //获取事件类型
             var u = baseEventTypeDAL.GetEntity(item.event_type);
             eventPlanInfoModel.event_name = u == null ? "未知" : u.event_name;
             //事发园区
             var a = baseRegionConfigDAL.GetEntity(item.region_id);
             eventPlanInfoModel.region_name = a == null ? "未知" : a.region_name;
             eventPlanInfoModel.create_time = item.create_time;
             eventPlanInfoModel.update_time = item.update_time;
             if (item.plan_status != (int)CSM.Common.EnumClass.PlanStatus.废止)
             {
                 eventPlanInfoModel.planStatus = Enum.GetName(typeof(EnumClass.PlanStatus), item.plan_status);
             }
             //获取创建人名称
             //var a = DeviceInfobll.GetPersonNameById(item.person_id);
             eventPlanInfoList.Add(eventPlanInfoModel);
         }
         return(eventPlanInfoList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }