Beispiel #1
0
        /// <summary>
        /// 遥控手动开闸发送数据
        /// 添加到异常记录报表
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        private static bool AddOpenGateRecord(GateCatchModel catchModel, DrivewayModel drivewaymodel, ILogger m_ilogger)
        {
            bool result = false;

            try
            {
                Dictionary <string, object> dicParam      = new Dictionary <string, object>();
                RequestFujicaStandard       requestFujica = new RequestFujicaStandard();
                string servername = "Park/UnderLineAddOpenGateRecord";
                dicParam["ParkingCode"]      = drivewaymodel.ParkCode;
                dicParam["EntranceType"]     = (Int32)drivewaymodel.Type;
                dicParam["EquipmentCode"]    = drivewaymodel.DeviceMacAddress;
                dicParam["ThroughName"]      = drivewaymodel.DrivewayName;
                dicParam["DiscernCamera"]    = drivewaymodel.DeviceName;
                dicParam["ThroughType"]      = 2;
                dicParam["OpenGateTime"]     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                dicParam["OpenGateReason"]   = "遥控开闸";
                dicParam["OpenGateOperator"] = "";
                dicParam["Remarks"]          = "";
                dicParam["ImageUrl"]         = catchModel.ImgUrl;
                result = requestFujica.RequestInterfaceV2(servername, dicParam);
                return(result);
            }

            catch (Exception ex)
            {
                m_ilogger.LogFatal(LoggerLogicEnum.Tools, "", drivewaymodel.ParkCode, catchModel.CarNo, "Fujica.com.cn.MonitorServiceClient.Business.GateCatchDataManager.AddOpenGateRecord", "添加到异常记录报表时发生异常", ex.ToString());
                return(false);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 上传压地感车辆数据
        /// </summary>
        /// <param name="carNumber">车牌号</param>
        /// <param name="parkingCode">停车场编码</param>
        /// <param name="amount">应缴费用</param>
        /// <param name="actualAmount">实缴费用</param>
        /// <param name="landSenseDate">压地感时间</param>
        /// <param name="recordGuid">唯一订单号</param>
        /// <param name="carType">车类(算费模板编号)</param>
        /// <param name="inImg">入场图片</param>
        /// <param name="beginDate">入场时间</param>
        /// <param name="driveWayMAC">出口编号</param>
        /// <param name="drivewayName">出口名</param>
        /// <returns></returns>
        private static bool UploadExitPayDataToFujica(string carNumber, string parkingCode, decimal amount, decimal actualAmount, DateTime landSenseDate, string recordGuid, string carType, string inImg, DateTime beginDate, string driveWayMAC, string drivewayName)
        {
            RequestFujicaStandard requestFujica = new RequestFujicaStandard();
            //请求方法
            string servername = "/CalculationCost/ApiScanCode";
            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["CarNo"]          = carNumber;             //车牌号
            dicParam["ParkingCode"]    = parkingCode;           //停车场编码
            dicParam["Amount"]         = amount;                //应缴费用
            dicParam["ActualAmount"]   = actualAmount;          //实缴费用
            dicParam["DiscountAmount"] = amount - actualAmount; //优惠费用
            dicParam["LineDate"]       = DateTime.Now;          //客户端时间
            dicParam["LandSenseDate"]  = landSenseDate;         //压地感时间
            dicParam["LineRecordCode"] = recordGuid;            //唯一订单号
            dicParam["CarType"]        = carType;               //车类(算费模板编号)
            dicParam["Img"]            = inImg;                 //入场图片
            dicParam["AdmissionDate"]  = beginDate;             //入场时间
            dicParam["ExportCode"]     = driveWayMAC;           //出口编号
            dicParam["Export"]         = drivewayName;          //出口名

            //fujica api上传出口压地感车辆信息 接口
            return(requestFujica.RequestInterfaceV2(servername, dicParam));
        }
Beispiel #3
0
        private bool ImportDataToFujica(CardServiceModel model, string idx)
        {
            Dictionary <string, object> dicParam = new Dictionary <string, object>();
            string beginDt = model.StartDate.Date.ToString("yyyy-MM-dd HH:mm:ss");                         //开始时间从0分秒
            string endDt   = model.EndDate.Date.AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss"); //结束时间截止到23:59:59

            model.EndDate        = Convert.ToDateTime(model.EndDate.Date.ToString("yyyy-MM-dd HH:mm:ss"));
            model.PrimaryEndDate = Convert.ToDateTime(model.PrimaryEndDate.Date.ToString("yyyy-MM-dd HH:mm:ss"));
            RequestFujicaStandard requestFujica = new RequestFujicaStandard();
            //请求方法
            string servername = "Park/UnderLineMonthCard";

            dicParam["OperatType"] = 0; //操作类型 -新增
            //请求参数
            dicParam["CarType"]          = idx;
            dicParam["PhoneNumber"]      = model.Mobile;
            dicParam["OwnerName"]        = model.CarOwnerName;
            dicParam["StartDate"]        = Convert.ToDateTime(beginDt);
            dicParam["PrimaryEndDate"]   = model.PrimaryEndDate;      //计算前结束日期
            dicParam["EndDate"]          = Convert.ToDateTime(endDt); //计算后结束日期
            dicParam["RenewalType"]      = 1;                         //目前默认都是按天延期
            dicParam["RenewalValue"]     = (model.EndDate - model.PrimaryEndDate).Days;
            dicParam["ParkingCode"]      = model.ParkCode;
            dicParam["CarNo"]            = model.CarNo;
            dicParam["RechargeAmount"]   = model.PayAmount;
            dicParam["PaymentType"]      = 98; //支付类型:4G支付
            dicParam["OrderType"]        = 99; //订单类型:现金支付
            dicParam["TransactionTime"]  = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            dicParam["Remarks"]          = model.Remark;
            dicParam["OrderStauts"]      = 4; //线下确认
            dicParam["RechargeOperator"] = model.RechargeOperator;
            return(requestFujica.RequestInterfaceV2(servername, dicParam));
        }
Beispiel #4
0
        /// <summary>
        /// Fujica Api 获取车道费用信息
        /// </summary>
        /// <param name="parkingCode">停车场编号</param>
        /// <param name="carNumber">车牌号码</param>
        /// <param name="deviceMACAddress">相机mac地址(车道号)</param>
        /// <param name="laneSenseDate">压地感时间</param>
        /// <param name="actualAmount">实际金额</param>
        /// <param name="beginTime">入场时间</param>
        /// <returns></returns>
        private bool GetLaneCostInfoByFujica(string parkingCode, string carNumber, string deviceMACAddress, DateTime laneSenseDate, out decimal actualAmount, out DateTime beginTime)
        {
            actualAmount = 0;
            beginTime    = DateTime.MinValue;

            //请求Fujica Api 获取车道费用信息
            RequestFujicaStandard requestFujica = new RequestFujicaStandard();
            //请求方法
            string servername = "/Park/GetLaneCostInfo";

            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["ParkingCode"]   = parkingCode;
            dicParam["CarNo"]         = carNumber;
            dicParam["ExportCode"]    = deviceMACAddress;
            dicParam["LandSenseDate"] = laneSenseDate;
            dicParam["LineDate"]      = DateTime.Now;

            bool result = requestFujica.RequestInterfaceV2(servername, dicParam);

            if (result)
            {
                Dictionary <string, object> fujicaResultDic = m_serializer.Deserialize <Dictionary <string, object> >(requestFujica.FujicaResult);
                //解析result结果
                Dictionary <string, object> resultDic = m_serializer.Deserialize <Dictionary <string, object> >(fujicaResultDic["Result"].ToString());
                //应缴费用
                decimal.TryParse(Convert.ToString(resultDic["ActualAmount"]), out actualAmount);
                //入场时间
                DateTime.TryParse(Convert.ToString(resultDic["BeginTime"]), out beginTime);
                return(true);
            }
            return(false);
        }
Beispiel #5
0
        /// <summary>
        /// 补发出场数据给主平台Fujica
        /// </summary>
        /// <param name="carNumber">车牌号</param>
        /// <param name="parkingCode">停车场编码</param>
        /// <param name="entrance">入口名</param>
        /// <param name="export">出口名</param>
        /// <param name="beginTime">入场时间</param>
        /// <param name="endTime">出场时间</param>
        /// <param name="inImgUrl">入场车辆图片地址</param>
        /// <param name="outImgUrl">出场车辆图片地址</param>
        /// <param name="recordGuid">当次停车记录编号</param>
        /// <param name="carType">车类</param>
        /// <returns>true:补发成功  false:补发失败</returns>
        private static bool ExitDataToFujica(string carNumber, string parkingCode, string entrance, string export, DateTime beginTime, DateTime endTime, string inImgUrl, string outImgUrl, string recordGuid, string carType)
        {
            RequestFujicaStandard requestFujica = new RequestFujicaStandard();
            //请求方法
            string servername = "/Park/ReVehicleOutRecord";
            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["CarNo"]          = carNumber;                     //车牌号
            dicParam["ParkingCode"]    = parkingCode;                   //停车场编码
            dicParam["LongStop"]       = (endTime - beginTime).Minutes; //停驶时间(分钟)
            dicParam["Entrance"]       = entrance;                      //入口名
            dicParam["Export"]         = export;                        //出口名
            dicParam["CustomDate"]     = DateTime.Now;                  //客户端时间
            dicParam["AppearanceDate"] = endTime;                       //出场时间
            dicParam["AdmissionDate"]  = beginTime;                     //入场时间
            dicParam["InImgUrl"]       = inImgUrl;                      //入场车辆图片地址
            dicParam["OutImgUrl"]      = outImgUrl;                     //出场车辆图片地址
            dicParam["LineRecordCode"] = recordGuid;                    //线下停车记录编号
            dicParam["CarType"]        = carType;                       //车类
            dicParam["CardType"]       = 3;                             //停车卡类型 1月卡 2储值卡 3 临时卡

            //返回fujica api补发车辆入场记录 接口的结果
            return(requestFujica.RequestInterfaceV2(servername, dicParam));
        }
        /// <summary>
        /// 添加到异常记录报表
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddOpenGateRecord(OpenGateRecordModel model)
        {
            bool result = false;

            try
            {
                Dictionary <string, object> dicParam      = new Dictionary <string, object>();
                RequestFujicaStandard       requestFujica = new RequestFujicaStandard();
                string servername = "Park/UnderLineAddOpenGateRecord";
                dicParam["ParkingCode"]      = model.ParkingCode;
                dicParam["EntranceType"]     = model.EntranceType;
                dicParam["EquipmentCode"]    = model.DeviceIdentify;
                dicParam["ThroughName"]      = model.ThroughName;
                dicParam["DiscernCamera"]    = model.DiscernCamera;
                dicParam["ThroughType"]      = model.ThroughType;
                dicParam["OpenGateTime"]     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                dicParam["OpenGateReason"]   = model.OpenGateReason;
                dicParam["OpenGateOperator"] = model.OpenGateOperator;
                dicParam["Remarks"]          = model.Remark;
                dicParam["ImageUrl"]         = model.ImageUrl;
                result = requestFujica.RequestInterfaceV2(servername, dicParam);
                return(result);
            }

            catch (Exception ex)
            {
                m_logger.LogFatal(LoggerLogicEnum.Bussiness, "", model.ParkingCode, "", "Fujica.com.cn.Business.ParkLot.CarInOutManager.AddOpenGateRecord", "添加到异常记录报表时发生异常", ex.ToString());
                return(false);
            }
        }
Beispiel #7
0
        /// <summary>
        /// 补发入场数据给主平台Fujica
        /// </summary>
        /// <param name="entrymodel">入场记录实体</param>
        /// <param name="carType">车类</param>
        /// <returns>true:补发成功  false:补发失败</returns>
        private static bool EntryDataToFujica(VehicleEntryDetailModel entrymodel, string carType)
        {
            RequestFujicaStandard requestFujica = new RequestFujicaStandard();
            //请求方法
            string servername = "/Park/ReVehicleEntryRecordV2";
            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["InEquipmentCode"] = entrymodel.DriveWayMAC;    //入口设备机号
            dicParam["DiscernCamera"]   = entrymodel.EntranceCamera; //识别相机
            dicParam["ThroughType"]     = entrymodel.OpenType;       //通行方式
            dicParam["CarNo"]           = entrymodel.CarNo;          //车牌号
            dicParam["ParkingCode"]     = entrymodel.ParkingCode;    //停车场编码
            dicParam["ParkName"]        = entrymodel.ParkingName;    //停车场名称
            dicParam["CustomDate"]      = DateTime.Now;              //客户端时间
            dicParam["LineRecordCode"]  = entrymodel.RecordGuid;     //线下停车记录编号
            dicParam["OperatorName"]    = "入场服务程序";                  //操作员
            //暂时去掉,后期有可能用到,主平台那边是int类型
            //dicParam["WatchhouseCode"] = driveWayMAC;//出入口设备机号
            dicParam["Entrance"]        = entrymodel.Entrance;                                                              //入口名
            dicParam["InImgUrl"]        = entrymodel.InImgUrl;                                                              //入场车辆图片地址
            dicParam["BeginTime"]       = entrymodel.BeginTime;                                                             //车辆的入场时间
            dicParam["CarType"]         = carType;                                                                          //车类,对应车辆模板类型
            dicParam["CardType"]        = entrymodel.CarType == 0 ? 3 : (entrymodel.CarType == 3 ? 1 : entrymodel.CarType); //fujica停车卡类型 1月卡 2储值卡 3 临时卡
            dicParam["Remark"]          = entrymodel.Description;
            dicParam["ParkingOperator"] = entrymodel.Operator;

            //返回fujica api补发车辆入场记录 接口的结果
            return(requestFujica.RequestInterfaceV2(servername, dicParam));
        }
        /// <summary>
        /// 模板数据同步到主平台Fujica
        /// </summary>
        /// <param name="carTypeGuid">车类唯一编码</param>
        /// <param name="actionType">新增:1 修改:2 删除:3</param>
        /// <param name="templateStr">格式化模板</param>
        /// <param name="carType">0:时租车  2:储值车</param>
        /// <returns></returns>
        private bool TemplateDataToFujica(string carTypeGuid, int actionType, string templateStr, CarTypeEnum carType)
        {
            CarTypeModel          carTypeModel  = _iCarTypeContext.GetCarType(carTypeGuid);
            RequestFujicaStandard requestFujica = new RequestFujicaStandard();
            //请求方法
            string servername = "/CalculationCost/";

            switch (actionType)
            {
            case 1:    //新增api
            case 2:

                if (carType == CarTypeEnum.TempCar)
                {
                    //添加临时车卡模板
                    servername += "ApiAddTemporaryCardTemplate";
                }
                else if (carType == CarTypeEnum.ValueCar)
                {
                    //添加储值卡模板
                    servername += "ApiAddValueCardTemplate";
                }
                break;

            case 3:    //删除api
                servername += "ApiDeleteTemplate";
                break;
            }

            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["ParkingCode"] = carTypeModel.ParkCode;
            dicParam["CarType"]     = carTypeModel.Idx;
            if (actionType != 3)
            {//删除api不需要这2个字段
                dicParam["CarName"]  = carTypeModel.CarTypeName;
                dicParam["Template"] = templateStr;
            }
            else
            {
                dicParam["SmallParkingCode"] = "";
            }
            //返回fujica api计费模板添加、修改、删除请求结果
            return(requestFujica.RequestInterfaceV2(servername, dicParam));
        }
Beispiel #9
0
        /// <summary>
        /// 发送储值卡数据到Fujica
        /// </summary>
        /// <returns></returns>
        private static bool SendValueCarToFujica(CardServiceModel model, string idx)
        {
            RequestFujicaStandard requestFujica = new RequestFujicaStandard();
            //请求方法(新增、修改、删除全用同一个接口)
            string servername = "/BasicResource/ApiUpdateValueCardInfo";
            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["ParkingCode"] = model.ParkCode;
            dicParam["CarType"]     = idx;
            dicParam["CarNo"]       = model.CarNo;
            dicParam["CardNo"]      = "";
            dicParam["Phone"]       = model.Mobile;
            dicParam["CardStatus"]  = model.Enable ? 1 : 2;
            dicParam["Balance"]     = model.Balance;

            //返回fujica api计费模板添加、修改请求结果
            return(requestFujica.RequestInterfaceV2(servername, dicParam));
        }
Beispiel #10
0
        /// <summary>
        /// 获取主平台fujica临时车辆的停车信息
        /// </summary>
        /// <param name="carNumber">车牌号码</param>
        /// <param name="parkingCode">停车场编号</param>
        /// <param name="m_serializer"></param>
        /// <returns></returns>
        private static string GetFujicaTempCarByCarNo(string carNumber, string parkingCode, ISerializer m_serializer)
        {
            string result = string.Empty;

            RequestFujicaStandard requestFujica = new RequestFujicaStandard();
            //请求方法
            string servername = "/Park/GetTempCarPaymentInfoByCarNo";
            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["CarNo"]       = carNumber;   //车牌号
            dicParam["ParkingCode"] = parkingCode; //停车场编码

            //返回fujica api接口的结果
            if (requestFujica.RequestInterfaceV2(servername, dicParam))
            {
                Dictionary <string, object> resultdic = m_serializer.Deserialize <Dictionary <string, object> >(requestFujica.FujicaResult);
                result = Convert.ToString(resultdic["Result"]);
            }

            return(result);
        }
Beispiel #11
0
        /// <summary>
        /// 补发入场数据给主平台Fujica
        /// </summary>
        /// <param name="carNumber">车牌号</param>
        /// <param name="parkingCode">停车场编码</param>
        /// <param name="parkingName">停车场名称</param>
        /// <param name="entryGuid">线下停车记录编号</param>
        /// <param name="driveWayMAC">出入口设备机号</param>
        /// <param name="entrance">入口名</param>
        /// <param name="inImgUrl">入场车辆图片地址</param>
        /// <param name="beginTime">车辆的入场时间</param>
        /// <param name="carType">车类</param>
        /// <returns>true:补发成功  false:补发失败</returns>
        private static bool EntryDataToFujica(string carNumber,string parkingCode,string parkingName,string entryGuid,string driveWayMAC,string entrance,string inImgUrl,DateTime beginTime,string carType)
        {
            RequestFujicaStandard requestFujica = new RequestFujicaStandard();
            //请求方法
            string servername = "/Park/ApiReVehicleEntryRecord";
            //请求参数
            Dictionary<string, object> dicParam = new Dictionary<string, object>();
            dicParam["CarNo"] = carNumber;//车牌号
            dicParam["ParkingCode"] = parkingCode;//停车场编码
            dicParam["ParkName"] = parkingName;//停车场名称
            dicParam["CustomDate"] = DateTime.Now;//客户端时间
            dicParam["LineRecordCode"] = entryGuid;//线下停车记录编号
            dicParam["OperatorName"] = "入场服务程序";//操作员
            dicParam["WatchhouseCode"] = driveWayMAC;//出入口设备机号
            dicParam["Entrance"] = entrance;//入口名
            dicParam["InImgUrl"] = inImgUrl;//入场车辆图片地址
            dicParam["BeginTime"] = beginTime;//车辆的入场时间
            dicParam["CarType"] = carType;//车类,对应车辆模板类型
            dicParam["CardType"] = 3;//停车卡类型 1月卡 2储值卡 3 临时卡

            //返回fujica api补发车辆入场记录 接口的结果
            return requestFujica.RequestInterfaceV2(servername, dicParam);
        }
Beispiel #12
0
        /// <summary>
        /// 补发出场数据给主平台Fujica
        /// </summary>
        /// <param name="exitmodel">出场记录实体</param>
        /// <param name="entrymodel">入场记录实体</param>
        /// <param name="carType">车类</param>
        /// <returns>true:补发成功  false:补发失败</returns>
        private static bool ExitDataToFujica(VehicleExitDetailModel exitmodel, VehicleEntryDetailModel entrymodel, string carType)
        {
            RequestFujicaStandard requestFujica = new RequestFujicaStandard();
            //请求方法
            string servername = "/Park/ReVehicleOutRecordV2";
            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["InEquipmentCode"]  = entrymodel.DriveWayMAC;    //入口设备机号
            dicParam["OutEquipmentCode"] = exitmodel.DriveWayMAC;     //出口设备机号
            dicParam["InDiscernCamera"]  = entrymodel.EntranceCamera; //入口识别相机
            dicParam["OutDiscernCamera"] = exitmodel.ExitCamera;      //出口识别相机
            dicParam["InThroughType"]    = entrymodel.OpenType;       //入口通行方式
            dicParam["OutThroughType"]   = exitmodel.OpenType;        //出口通行方式
            dicParam["CarNo"]            = exitmodel.CarNo;           //车牌号
            dicParam["ParkingCode"]      = exitmodel.ParkingCode;     //停车场编码
            dicParam["LongStop"]         = (Int32)(exitmodel.LeaveTime - entrymodel.BeginTime).TotalMinutes;
            //LongStop  停驶时间(分钟)
            dicParam["Entrance"]           = entrymodel.Entrance;                                                              //入口名
            dicParam["Export"]             = exitmodel.Exit;                                                                   //出口名
            dicParam["CustomDate"]         = DateTime.Now;                                                                     //客户端时间
            dicParam["AppearanceDate"]     = exitmodel.LeaveTime;                                                              //出场时间
            dicParam["AdmissionDate"]      = entrymodel.BeginTime;                                                             //入场时间
            dicParam["InImgUrl"]           = entrymodel.InImgUrl;                                                              //入场车辆图片地址
            dicParam["OutImgUrl"]          = exitmodel.OutImgUrl;                                                              //出场车辆图片地址
            dicParam["LineRecordCode"]     = exitmodel.RecordGuid;                                                             //线下停车记录编号
            dicParam["CarType"]            = carType;                                                                          //车类
            dicParam["CardType"]           = entrymodel.CarType == 0 ? 3 : (entrymodel.CarType == 3 ? 1 : entrymodel.CarType); //fujica停车卡类型 1月卡 2储值卡 3 临时卡
            dicParam["Description"]        = exitmodel.Description;
            dicParam["InParkingOperator"]  = entrymodel.Operator;                                                              //入场值班人员
            dicParam["OutParkingOperator"] = exitmodel.Operator;                                                               //出场值班人员



            //返回fujica api补发车辆入场记录 接口的结果
            return(requestFujica.RequestInterfaceV2(servername, dicParam));
        }
Beispiel #13
0
        /// <summary>
        /// 发送月卡数据到Fujica
        /// </summary>
        /// <returns></returns>
        private static bool SendMonthCarToFujica(CardServiceModel model, string idx)
        {
            string beginDt = model.StartDate.Date.AddHours(0).AddMinutes(0).AddSeconds(0).ToString("yyyy-MM-dd HH:mm:ss"); //开始时间从0分秒
            string endDt   = model.EndDate.Date.AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");                 //结束时间截止到23:59:59
            RequestFujicaStandard requestFujica = new RequestFujicaStandard();
            //请求方法
            string servername = "/BasicResource/ApiUpdateMonthCardInfo";

            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["ParkingCode"] = model.ParkCode;
            dicParam["CarType"]     = idx;
            dicParam["CarNo"]       = model.CarNo;
            dicParam["CardNo"]      = "";
            dicParam["Phone"]       = model.Mobile;
            dicParam["CardStatus"]  = 1;

            dicParam["StartDate"] = beginDt;
            dicParam["EndDate"]   = endDt;

            //返回fujica api计费模板添加、修改请求结果
            return(requestFujica.RequestInterfaceV2(servername, dicParam));
        }
Beispiel #14
0
        /// <summary>
        /// 模板数据同步到主平台Fujica
        /// </summary>
        /// <param name="carTypeGuid">车类唯一编码</param>
        /// <param name="parkingCode">停车场编号</param>
        /// <param name="actionType">新增:1 修改:2 删除:3</param>
        /// <param name="templateStr">格式化模板</param>
        /// <returns></returns>
        private bool TemplateDataToFujica(string carTypeGuid, int actionType, string templateStr)
        {
            CarTypeModel          carTypeModel  = _iCarTypeContext.GetCarType(carTypeGuid);
            RequestFujicaStandard requestFujica = new RequestFujicaStandard();
            //请求方法
            string servername = "/CalculationCost/";

            switch (actionType)
            {
            case 1:    //新增api
                servername += "ApiAddMonthCardTemplate";
                break;

            case 2:    //修改api
                servername += "ApiUpdateMonthCardTemplate";
                break;

            case 3:    //删除api
                servername += "ApiDeleteTemplate";
                break;
            }

            //请求参数
            Dictionary <string, object> dicParam = new Dictionary <string, object>();

            dicParam["ParkingCode"]      = carTypeModel.ParkCode;
            dicParam["smallparkingCode"] = "0";
            dicParam["CarType"]          = carTypeModel.Idx;
            if (actionType != 3)
            {//删除api不需要这2个字段
                dicParam["CarName"]  = carTypeModel.CarTypeName;
                dicParam["Template"] = templateStr;
            }
            //返回fujica api计费模板添加、修改、删除请求结果
            return(requestFujica.RequestInterfaceV2(servername, dicParam));
        }
Beispiel #15
0
        /// <summary>
        /// 免费放行(人工免费=应缴费金额)
        /// </summary>
        /// <param name="parkingCode">车编</param>
        /// <param name="carNumber">车牌号</param>
        /// <param name="tolloperator">操作员</param>
        /// <param name="deviceIdentify">设备标识</param>
        /// <returns></returns>
        public bool FreeOpenGate(FreeOpenGateModel model)
        {
            bool falg = false;

            try
            {
                //判断 是否有入场数据
                VehicleInOutModel entryModel = _iVehicleInOutContext.GetEntryRecord(model.CarNo, model.ParkingCode);
                if (entryModel != null)
                {
                    //通过主平台api接口读取停车费用信息
                    RequestFujicaStandard requestFujica = new RequestFujicaStandard();
                    //请求方法
                    string servername = "Park/GetTempCarPaymentInfoByCarNo";
                    //请求参数
                    Dictionary <string, object> dicParam = new Dictionary <string, object>();
                    dicParam["ParkingCode"] = model.ParkingCode;
                    dicParam["CarNo"]       = model.CarNo;
                    falg = requestFujica.RequestInterfaceV2(servername, dicParam);
                    if (falg)
                    {
                        string fujicaResult = requestFujica.FujicaResult;
                        if (!string.IsNullOrEmpty(fujicaResult))
                        {
                            Dictionary <string, object> tempResultDic = m_serializer.Deserialize <Dictionary <string, object> >(fujicaResult);
                            if (tempResultDic["Result"] != null)
                            {
                                fujicaResult = Convert.ToString(tempResultDic["Result"]);

                                Dictionary <string, object> dicFujicaResult = null;
                                dicFujicaResult = m_serializer.Deserialize <Dictionary <string, object> >(fujicaResult);
                                #region  线下临时卡缴费 添加
                                Dictionary <string, object> dicParam2 = new Dictionary <string, object>();
                                string servername2 = "CalculationCost/OfflinePayV2"; //添加线下临时卡缴费
                                dicParam2["CarType"]       = dicFujicaResult["CarType"].ToString();
                                dicParam2["AdmissionDate"] = Convert.ToDateTime(dicFujicaResult["BeginTime"].ToString());
                                // 计费开始时间 (算费接口返回的 最后一次缴费时间(如果缴费时间>1970说明有过缴费,否则就是入场时间)
                                dicParam2["BillingStartTime"] = Convert.ToDateTime(Convert.ToDateTime(dicFujicaResult["FinalPaymentTime"].ToString()).Year > 1970 ? dicFujicaResult["FinalPaymentTime"].ToString() : dicFujicaResult["BeginTime"].ToString());
                                dicParam2["BillingDeadline"]  = Convert.ToDateTime(dicFujicaResult["ChargeableTime"].ToString());
                                dicParam2["TollOperator"]     = model.TolloPerator;
                                dicParam2["PayStyle"]         = PaymentTypeEnum.SP4G;                                          //支付类型:G4车场
                                dicParam2["OrderType"]        = OrderTypeEnum.ReadyMoney;                                      //订单类型:现金支付
                                dicParam2["FreeAdmission"]    = Convert.ToDecimal(dicFujicaResult["ActualAmount"].ToString()); //人工免费
                                dicParam2["CarNo"]            = model.CarNo;
                                dicParam2["ParkingCode"]      = model.ParkingCode;
                                dicParam2["LineRecordCode"]   = dicFujicaResult["LineRecordCode"].ToString();
                                dicParam2["Amount"]           = Convert.ToDecimal(dicFujicaResult["ParkingFee"].ToString());
                                dicParam2["AmountTime"]       = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                                dicParam2["CouponList"]       = m_serializer.Deserialize <List <CouponCalculateView> >(dicFujicaResult["CouponList"].ToString());
                                dicParam2["DealNo"]           = "4G"; //值给4G,和小乔确认过
                                dicParam2["Remarks"]          = model.Remark;
                                falg = requestFujica.RequestInterfaceV2(servername2, dicParam2);
                                #endregion
                                falg = OpenGateToCamera(new OpenGateModel()
                                {
                                    DeviceIdentify = model.DeviceIdentify, OpenType = OpenTypeEnum.Free, Operator = model.TolloPerator, Remark = model.Remark
                                }, model.ParkingCode);
                            }
                        }
                    }
                    return(falg);
                }
                else
                {
                    return(falg);
                }
            }
            catch (Exception ex)
            {
                m_logger.LogFatal(LoggerLogicEnum.Bussiness, "", model.ParkingCode, model.CarNo, "Fujica.com.cn.Business.ParkLot.CarInOutManager.FreeOpenGate", "免费开闸时发生异常", ex.ToString());
                return(false);
            }
        }