Esempio n. 1
0
        /// <summary>
        /// 获取功能点
        /// </summary>
        /// <param name="parkingcode"></param>
        /// <returns></returns>
        public FunctionPointModel GetFunctionPoint(string projectguid, string parkcode)
        {
            FunctionPointModel model = null;

            redisoperate.model = new FunctionPointModel()
            {
                ParkCode = parkcode
            };
            model = redisoperate.GetFromRedis();

            //从数据库读
            if (model == null)
            {
                model = databaseoperate.GetFromDataBase(parkcode);
                if (model == null)
                {
                    //都没有的时候设置一个默认的
                    model = new FunctionPointModel()
                    {
                        ProjectGuid  = projectguid,
                        ParkCode     = parkcode,
                        PostponeMode = 0,
                        PastDueMode  = 0,
                        MinDays      = 0,
                        MinBalance   = 0
                    };
                }
            }

            return(model);
        }
Esempio n. 2
0
        /// <summary>
        /// 下发手动开闸车类guid集合
        /// </summary>
        /// <param name="projectGuid"></param>
        /// <param name="parkCode"></param>
        /// <returns></returns>
        public bool SendManualOpenGateGuid(string projectGuid, string parkCode)
        {
            try
            {
                FunctionPointModel model = GetFunctionPoint(projectGuid, parkCode);
                if (model == null || model.ManualOpenGateGuid == null)
                {
                    return(false);
                }
                ManualOpenGateModel sendmodel = new ManualOpenGateModel();
                sendmodel.CarTypeList = new List <string>();
                foreach (var item in model.ManualOpenGateGuid)
                {
                    sendmodel.CarTypeList.Add(item);
                }
                CommandEntity <ManualOpenGateModel> entity = new CommandEntity <ManualOpenGateModel>()
                {
                    command = BussineCommand.ManualOpenGate,
                    idMsg   = Convert.ToBase64String(Guid.NewGuid().ToByteArray()),
                    message = sendmodel
                };

                return(m_rabbitMQ.SendMessageForRabbitMQ("发送手动开闸车类guid集合", m_serializer.Serialize(entity), entity.idMsg, model.ParkCode));
            }
            catch (Exception ex)
            {
                m_logger.LogFatal(LoggerLogicEnum.Bussiness, "", parkCode, "", "Fujica.com.cn.Business.ParkLot.FunctionPointManager.SendManualOpenGateGuid", "下发手动开闸车类guid集合时发生异常", ex.ToString());
                return(false);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 设置功能点
        /// </summary>
        /// <returns></returns>
        public bool SetFunctionPoint(FunctionPointModel model)
        {
            redisoperate.model = model;
            bool flag = databaseoperate.SaveToDataBase(model);

            if (!flag)
            {
                return(false);
            }
            //此时不需要判断redis是否成功,因为修改时redis一定会返回false
            redisoperate.SaveToRedis();
            return(flag);
        }
Esempio n. 4
0
        ///// <summary>
        ///// 日志记录器
        ///// </summary>
        //internal readonly ILogger m_logger;

        ///// <summary>
        ///// 序列化器
        ///// </summary>
        //internal readonly ISerializer m_serializer = null;

        ///// <summary>
        ///// redis操作类
        ///// </summary>
        //private IBaseRedisOperate<FunctionPointModel> redisoperate = null;

        ///// <summary>
        ///// 数据库操作类
        ///// </summary>
        //private IBaseDataBaseOperate<FunctionPointModel> databaseoperate = null;

        //private readonly RabbitMQSender m_rabbitMQ;

        ///// <summary>
        ///// 车类管理器
        ///// </summary>
        //private CarTypeManager cartypemanager;

        ///// <summary>
        ///// 计费模板管理器
        ///// </summary>
        //private BillingTemplateManager billingtemplatemanager = null;

        //public string LastErrorDescribe
        //{
        //    get
        //    {
        //        throw new NotImplementedException();
        //    }

        //    set
        //    {
        //        throw new NotImplementedException();
        //    }
        //}

        //public FunctionPointManager(ILogger _logger, ISerializer _serializer,
        //    IBaseRedisOperate<FunctionPointModel> _redisoperate,
        //    IBaseDataBaseOperate<FunctionPointModel> _databaseoperate,
        //    RabbitMQSender _rabbitMQ,
        //    CarTypeManager _cartypemanager, BillingTemplateManager _billingtemplatemanager)
        //{
        //    m_logger = _logger;
        //    m_serializer = _serializer;
        //    redisoperate = _redisoperate;
        //    databaseoperate = _databaseoperate;
        //    m_rabbitMQ = _rabbitMQ;
        //    cartypemanager = _cartypemanager;
        //    billingtemplatemanager = _billingtemplatemanager;
        //}

        /// <summary>
        /// 设置功能点
        /// 设置固定车延期方式 0=顺延 1=跳延
        /// 设置固定车过期处理方式 -1=禁止入场 0=看做临时车 大于等于N(N>=1) 过期N天后禁止入场
        /// 设置满位禁止入场车类
        /// 设置参与剩余车位统计的车类
        /// 设置不同颜色车牌的收费车类
        /// 设置月租车延期提醒
        /// 设置储值车充值提醒
        /// </summary>
        /// <returns></returns>
        public bool SetFunctionPoint(FunctionPointModel model)
        {
            bool flag = _iFunctionPointContext.SetFunctionPoint(model);

            if (!flag)
            {
                LastErrorDescribe = BussinessErrorCodeEnum.BUSINESS_SAVE_ERROR.GetDesc();
                return(false);
            }

            //返回值不参考mq的结果
            SendTempCarTypeOfPlateColor(model.ProjectGuid, model.ParkCode);
            SendBarredEntryCarTypeOnParkingFull(model.ProjectGuid, model.ParkCode);
            SendMonthCarExpireRemindDay(model.ProjectGuid, model.ParkCode);
            SendMonthCarExpireMode(model.ProjectGuid, model.ParkCode);
            SendManualOpenGateGuid(model.ProjectGuid, model.ParkCode);
            return(true);
        }
Esempio n. 5
0
        /// <summary>
        /// 下发临时车不同车牌颜色对应车类计费信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool SendTempCarTypeOfPlateColor(string projectGuid, string parkCode)
        {
            try
            {
                FunctionPointModel model       = GetFunctionPoint(projectGuid, parkCode);
                CarTypeModel       cartypemode = _iCarTypeContext.AllCarType(parkCode, projectGuid).Where(o => o.DefaultType == true).FirstOrDefault(); //找出默认的车类的
                if (cartypemode == null)
                {
                    LastErrorDescribe = "该停车场未设置默认车类";
                    return(false);
                }
                List <TempCarTypeModel> sendmodel = new List <TempCarTypeModel>()
                {
                };

                sendmodel.Add(TempCarTypeDataInit(1, string.IsNullOrWhiteSpace(model.BluePlateCarTypeGuid) ? cartypemode.Guid : model.BluePlateCarTypeGuid));
                sendmodel.Add(TempCarTypeDataInit(2, string.IsNullOrWhiteSpace(model.YellowPlateCarTypeGuid) ? cartypemode.Guid : model.YellowPlateCarTypeGuid));
                sendmodel.Add(TempCarTypeDataInit(3, string.IsNullOrWhiteSpace(model.WhitePlateCarTypeGuid) ? cartypemode.Guid : model.WhitePlateCarTypeGuid));
                sendmodel.Add(TempCarTypeDataInit(4, string.IsNullOrWhiteSpace(model.GreenPlateCarTypeGuid) ? cartypemode.Guid : model.GreenPlateCarTypeGuid));
                sendmodel.Add(TempCarTypeDataInit(5, string.IsNullOrWhiteSpace(model.BlackPlateCarTypeGuid) ? cartypemode.Guid : model.BlackPlateCarTypeGuid));


                CommandEntity <List <TempCarTypeModel> > entity = new CommandEntity <List <TempCarTypeModel> >()
                {
                    command = BussineCommand.CarType,
                    idMsg   = Convert.ToBase64String(Guid.NewGuid().ToByteArray()),
                    message = sendmodel
                };

                return(m_rabbitMQ.SendMessageForRabbitMQ("发送临时车车类指令", m_serializer.Serialize(entity), entity.idMsg, model.ParkCode));
            }
            catch (Exception ex)
            {
                m_logger.LogFatal(LoggerLogicEnum.Bussiness, "", parkCode, "", "Fujica.com.cn.Business.ParkLot.FunctionPointManager.SendTempCarTypeOfPlateColor", "下发临时车车类时发生异常", ex.ToString());
                return(false);
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 下发月租车过期处理方式
        /// </summary>
        /// <param name="projectGuid"></param>
        /// <param name="parkCode"></param>
        /// <returns></returns>
        public bool SendMonthCarExpireMode(string projectGuid, string parkCode)
        {
            try
            {
                FunctionPointModel model = GetFunctionPoint(projectGuid, parkCode);
                if (model == null)
                {
                    return(true);
                }
                CommandEntity <int> entity = new CommandEntity <int>()
                {
                    command = BussineCommand.MonthCarExpireMode,
                    idMsg   = Convert.ToBase64String(Guid.NewGuid().ToByteArray()),
                    message = model.PastDueMode
                };

                return(m_rabbitMQ.SendMessageForRabbitMQ("发送月租车过期处理方式", m_serializer.Serialize(entity), entity.idMsg, model.ParkCode));
            }
            catch (Exception ex)
            {
                m_logger.LogFatal(LoggerLogicEnum.Bussiness, "", parkCode, "", "Fujica.com.cn.Business.ParkLot.FunctionPointManager.SendMonthCarExpireMode", "下发月租车过期处理方式时发生异常", ex.ToString());
                return(false);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 获取功能点
        /// </summary>
        /// <param name="parkingcode"></param>
        /// <returns></returns>
        public FunctionPointModel GetFunctionPoint(string projectguid, string parkcode)
        {
            FunctionPointModel model = _iFunctionPointContext.GetFunctionPoint(projectguid, parkcode);

            return(model);
        }