예제 #1
0
 /// <summary>
 /// 根据预案id获取预案信息
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public ServDevicePlanModel GetEntity(int id)
 {
     try
     {
         ServDevicePlanModel DevicePlanInfo = mapContext.QueryForObject <ServDevicePlanModel>("GetDevicePlanById", id);
         return(DevicePlanInfo);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
 /// <summary>
 /// 获取最后条预案信息
 /// </summary>
 /// <returns></returns>
 public ServDevicePlanModel GetLastDevicePlan()
 {
     try
     {
         ServDevicePlanModel entity = servDevicePlanDAL.GetLastDevicePlan();
         return(entity);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
        /// <summary>
        /// 查看最后一条预案信息
        /// </summary>
        /// <returns></returns>
        public ServDevicePlanModel GetLastDevicePlan()
        {
            try
            {
                ServDevicePlanQuery query = new ServDevicePlanQuery();

                ServDevicePlanModel entity = mapContext.QueryForObject <ServDevicePlanModel>("GetLastDevicePlan", query);
                return(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #4
0
 /// <summary>
 /// 查看设备预案是否存在  封传波  2016-12-22
 /// </summary>
 /// <param name="deviceId">设备ID</param>
 /// <param name="planTime">时间</param>
 /// <param name="status">状态</param>
 /// <returns></returns>
 public ServDevicePlanModel CheckDevicePlanIsExist(int deviceId, string planTime, int status)
 {
     try
     {
         ServDevicePlanModel devicePlanModel = new ServDevicePlanModel();
         devicePlanModel.device_id = deviceId;
         //devicePlanModel.start_time = planTime;
         devicePlanModel.plan_status = status;
         devicePlanModel             = mapContext.QueryForObject <ServDevicePlanModel>("DevicePlanIsExist", devicePlanModel);
         return(devicePlanModel);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #5
0
        /// <summary>
        /// 修改预案信息
        /// </summary>
        /// <param name="entity">预案信息</param>
        /// <param name="defaultPlanHandleItemList">默认处置项</param>
        /// <param name="cnfirmPlanHandleItemList">确认处置项</param>
        /// <param name="defaultPersonList">默认处置项通知其他责任人</param>
        /// <param name="cnfirmPlanPersonList">确认处置项通知其他责任人</param>
        /// <param name="servPlanHandleItemCameraList">关联摄像头</param>
        /// <returns></returns>
        public bool UpdateDevicePlanInfo(ServDevicePlanModel entity, ServExecutionTimeModel executionTimeInfo, List <ServPlanHandleItemModel> defaultPlanHandleItemList, List <ServPlanHandleItemModel> cnfirmPlanHandleItemList, List <ServPlanPersonModel> defaultPersonList, List <ServPlanPersonModel> cnfirmPlanPersonList, List <ServPlanHandleItemCameraModel> servPlanHandleItemCameraList)
        {
            bool result = false;

            try
            {
                DevicePlanRelationInfoModel devicePlanRelationInfoModel = new DevicePlanRelationInfoModel();
                devicePlanRelationInfoModel.entity                       = entity;
                devicePlanRelationInfoModel.servExecutionTime            = executionTimeInfo;
                devicePlanRelationInfoModel.defaultPlanHandleItemList    = defaultPlanHandleItemList;
                devicePlanRelationInfoModel.cnfirmPlanHandleItemList     = cnfirmPlanHandleItemList;
                devicePlanRelationInfoModel.cnfirmPlanPersonList         = cnfirmPlanPersonList;
                devicePlanRelationInfoModel.defaultPersonList            = defaultPersonList;
                devicePlanRelationInfoModel.servPlanHandleItemCameraList = servPlanHandleItemCameraList;
                result = servDevicePlanDAL.UpdateDevicePlan(devicePlanRelationInfoModel);
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #6
0
        /// <summary>
        /// 修改预案信息 2016.12.02 乔会会
        /// </summary>
        /// <param name="servDevicePlanModel"></param>
        /// <returns></returns>
        public bool UpdateDevicePlan(ServDevicePlanModel servDevicePlanModel)
        {
            bool result = servDevicePlanDAL.UpdateEntity(servDevicePlanModel.id, servDevicePlanModel);

            return(result);
        }
예제 #7
0
        /// <summary>
        /// 新增预案信息 2016.12.02 乔会会
        /// </summary>
        /// <param name="configModel"></param>
        /// <returns></returns>
        public int AddDevicePlan(ServDevicePlanModel configModel)
        {
            int id = servDevicePlanDAL.AddEntity(configModel);

            return(id);
        }
예제 #8
0
        /// <summary>
        /// 获取预案信息
        /// </summary>
        /// <param name="devicePlanId"></param>
        /// <param name="planType"></param>
        /// <returns></returns>
        public DevicePlanRelationInfoModel GetDevicePlanInfo(int devicePlanId, int planType)
        {
            try
            {
                //获取预案信息
                ServDevicePlanModel entity = servDevicePlanDAL.GetEntity(devicePlanId);
                //园区信息
                BaseRegionConfigModel regionInfo = baseRegionConfigDAL.GetRegionConfigInfo(entity.device_id);
                //获取时间信息
                ServExecutionTimeModel ServExecutionTime = servExecutionTimeDAL.GetTimeEntity(devicePlanId, planType);
                //获取处置项信息
                List <ServPlanHandleItemModel> PlanHandleItemList = servPlanHandleItemDAL.GetPlanHandleItem(devicePlanId, planType);
                //预案确警前处置项
                List <ServPlanHandleItemModel> defaultPlanHandleItemList = new List <ServPlanHandleItemModel>();
                //预案确警后处置项
                List <ServPlanHandleItemModel> cnfirmPlanHandleItemList = new List <ServPlanHandleItemModel>();
                //预案确警前责任人关联表
                List <ServPlanPersonModel> defaultPersonList = new List <ServPlanPersonModel>();
                //预案确警后责任人关联表
                List <ServPlanPersonModel> cnfirmPlanPersonList = new List <ServPlanPersonModel>();
                //获取关联摄像头信息
                List <ServPlanHandleItemCameraModel> servPlanHandleItemCameraList = new List <ServPlanHandleItemCameraModel>();
                if (PlanHandleItemList.Count() > 0)
                {
                    for (var i = 0; i < PlanHandleItemList.Count(); i++)
                    {
                        if (PlanHandleItemList[i].item_type == (int)CSM.Common.EnumClass.DevicePlanDefaultOptions.通知其他负责人 && PlanHandleItemList[i].confirm_type == (int)CSM.Common.EnumClass.PlanHandleTime.确警前)
                        {
                            defaultPersonList = servPlanPersonDAL.GetPlanPersonInfo(PlanHandleItemList[i].id);
                        }
                        else if (PlanHandleItemList[i].item_type == (int)CSM.Common.EnumClass.DevicePlanConfirmOptions.通知其他负责人 && PlanHandleItemList[i].confirm_type == (int)CSM.Common.EnumClass.PlanHandleTime.确警后)
                        {
                            cnfirmPlanPersonList = servPlanPersonDAL.GetPlanPersonInfo(PlanHandleItemList[i].id);
                        }
                        else if (PlanHandleItemList[i].item_type == (int)CSM.Common.EnumClass.DevicePlanDefaultOptions.关联摄像头)
                        {
                            servPlanHandleItemCameraList = servPlanHandleItemCameraDAL.GetPlanHandleItemCamera(PlanHandleItemList[i].id);
                        }
                        if (PlanHandleItemList[i].confirm_type == (int)CSM.Common.EnumClass.PlanHandleTime.确警前)
                        {
                            defaultPlanHandleItemList.Add(PlanHandleItemList[i]);
                        }
                        else if (PlanHandleItemList[i].confirm_type == (int)CSM.Common.EnumClass.PlanHandleTime.确警后)
                        {
                            cnfirmPlanHandleItemList.Add(PlanHandleItemList[i]);
                        }
                    }
                }

                DevicePlanRelationInfoModel model = new DevicePlanRelationInfoModel();
                model.entity                       = entity;
                model.servExecutionTime            = ServExecutionTime;
                model.BaseRegionConfigInfo         = regionInfo;
                model.defaultPlanHandleItemList    = defaultPlanHandleItemList;
                model.cnfirmPlanHandleItemList     = cnfirmPlanHandleItemList;
                model.cnfirmPlanPersonList         = cnfirmPlanPersonList;
                model.defaultPersonList            = defaultPersonList;
                model.servPlanHandleItemCameraList = servPlanHandleItemCameraList;
                return(model);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #9
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        /// <param name="model"></param>
        public int UpdateDevicePlanById(ServDevicePlanModel model)
        {
            int result = mapContext.Update("UpdateDevicePlanById", model);

            return(result);
        }
예제 #10
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        /// <param name="entity"></param>
        public int AddEntity(ServDevicePlanModel entity)
        {
            int id = (int)mapContext.Insert("InsertDevicePlan", entity);

            return(id);
        }
예제 #11
0
 public bool UpdateEntity(int id, ServDevicePlanModel newentity)
 {
     throw new NotImplementedException();
 }