Example #1
0
        public string GetParkingData(string companyId)
        {
            List <BaseParkinfo> parkings = new List <BaseParkinfo>();
            List <BaseCompany>  companys = CompanyServices.GetCurrLoginUserRoleCompany(companyId, GetLoginUser.RecordID);

            if (companys.Count > 0)
            {
                parkings = ParkingServices.QueryParkingByCompanyIds(companys.Select(p => p.CPID).ToList());
            }

            StringBuilder strTree = new StringBuilder();

            strTree.Append("[");
            strTree.Append("{\"id\":\"-1\",");
            strTree.Append("\"text\":\"所有\",\"selected\":true");
            strTree.Append("}");
            foreach (var item in parkings)
            {
                strTree.Append(",{\"id\":\"" + item.PKID + "\",");
                strTree.Append("\"text\":\"" + item.PKName + "\"");
                strTree.Append("}");
            }
            strTree.Append("]");
            return(strTree.ToString());
        }
Example #2
0
        public JsonResult SaveConfig(BaseParkinfo model)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(model.PKID))
                {
                    throw new MyException("获取配置编号失败");
                }

                bool result = ParkingServices.UpdateParkSettleConfig(model);
                if (!result)
                {
                    throw new MyException("保存失败");
                }
                return(Json(MyResult.Success()));
            }
            catch (MyException ex)
            {
                return(Json(MyResult.Error(ex.Message)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "保存结算信息失败");
                return(Json(MyResult.Error("保存失败")));
            }
        }
Example #3
0
        public string GetParkingData()
        {
            try
            {
                StringBuilder str = new StringBuilder();
                if (string.IsNullOrWhiteSpace(Request.Params["villageId"]))
                {
                    return(str.ToString());
                }

                int pageIndex = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int pageSize  = string.IsNullOrEmpty(Request.Params["rows"]) ? 0 : int.Parse(Request.Params["rows"]);

                int totalCount = 0;
                List <BaseParkinfo> parkData = ParkingServices.QueryPage(Request.Params["villageId"].ToString(), pageIndex, pageSize, out totalCount);

                str.Append("{");
                str.Append("\"total\":" + totalCount + ",");
                str.Append("\"rows\":" + JsonHelper.GetJsonString(parkData) + ",");
                str.Append("\"index\":" + pageIndex);
                str.Append("}");
                return(str.ToString());
            }
            catch (Exception ex) {
                ExceptionsServices.AddExceptions(ex, "获取车场信息失败");
                return(string.Empty);
            }
        }
Example #4
0
 public JsonResult SaveParking(BaseParkinfo model)
 {
     try
     {
         bool result = false;
         if (string.IsNullOrWhiteSpace(model.PKID))
         {
             result = ParkingServices.Add(model);
         }
         else
         {
             result = ParkingServices.Update(model);
         }
         if (!result)
         {
             throw new MyException("保存失败");
         }
         return(Json(MyResult.Success()));
     }
     catch (MyException ex) {
         return(Json(MyResult.Error(ex.Message)));
     }
     catch (Exception ex)
     {
         ExceptionsServices.AddExceptions(ex, "保存车场信息失败");
         return(Json(MyResult.Error("保存失败")));
     }
 }
Example #5
0
        public JsonResult QueryRemotelyOpenGateData()
        {
            try
            {
                List <string> parkingIds = new List <string>();
                if (!string.IsNullOrWhiteSpace(Request.Params["parkingId"]))
                {
                    parkingIds.Add(Request.Params["parkingId"]);
                }
                else
                {
                    List <BaseParkinfo> parkings = ParkingServices.QueryParkingByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());
                    if (parkings.Count > 0)
                    {
                        parkingIds.AddRange(parkings.Select(p => p.PKID));
                    }
                }
                string areaId = Request.Params["areaId"];
                string boxId  = Request.Params["boxId"];

                int page             = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int rows             = 15;
                int recordTotalCount = 0;
                List <RemotelyOpenGateView> models = ParkGateServices.QueryRemotelyOpenGate(parkingIds, areaId, boxId, page, rows, out recordTotalCount);
                return(Json(MyResult.Success("", models)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "微信获取远程开闸数据失败");
                return(Json(MyResult.Error("获取失败")));
            }
        }
Example #6
0
        public ActionResult GetParkingData()
        {
            JsonResult result = new JsonResult();

            try
            {
                if (string.IsNullOrEmpty(Request.Params["sellerId"]))
                {
                    return(result);
                }
                string sellerId = Request.Params["sellerId"].ToString();

                ParkSeller seller = ParkSellerServices.QueryBySellerId(sellerId);
                if (seller == null)
                {
                    throw new MyException("获取商家信息失败");
                }

                List <BaseParkinfo> parkings = ParkingServices.QueryParkingByVillageId(seller.VID);
                result.Data = parkings;
                return(result);
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "优免券发放车场信息失败");
                return(result);
            }
        }
Example #7
0
        public JsonResult DownloadQRCode(string gateId, int size)
        {
            try
            {
                List <int> dics = new List <int>();
                dics.Add(258);
                dics.Add(344);
                dics.Add(430);
                dics.Add(860);
                dics.Add(1280);

                List <string> imgs = new List <string>();
                ParkGate      gate = ParkGateServices.QueryByRecordId(gateId);
                if (gate == null)
                {
                    throw new MyException("获取通道信息失败");
                }
                BaseCompany company = CompanyServices.QueryByBoxID(gate.BoxID);
                if (company == null)
                {
                    throw new MyException("获取单位信息失败");
                }

                ParkBox box = ParkBoxServices.QueryByRecordId(gate.BoxID);
                if (box == null)
                {
                    throw new MyException("获取岗亭信息失败");
                }

                ParkArea area = ParkAreaServices.QueryByRecordId(box.AreaID);
                if (area == null)
                {
                    throw new MyException("获取区域信息失败");
                }

                BaseParkinfo parking = ParkingServices.QueryParkingByParkingID(area.PKID);
                if (parking == null)
                {
                    throw new MyException("获取车场信息失败");
                }
                string content = string.Format("{0}/qrl/scio_ix_pid={1}^io={2}", SystemDefaultConfig.SystemDomain, parking.PKID, gate.GateID);
                foreach (var item in dics)
                {
                    string parkingName = string.Format("{0}_{1}_{2}_{3}_{4}", parking.PKName, area.AreaName, box.BoxName, gate.GateName, item);
                    string result      = QRCodeServices.GenerateQRCode(company.CPID, content, item, parkingName);
                    imgs.Add(item.ToString() + "|" + result);
                }

                return(Json(MyResult.Success("", imgs)));
            }
            catch (MyException ex)
            {
                return(Json(MyResult.Error(ex.Message)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "下载二维码失败");
                return(Json(MyResult.Error("下载二维码失败")));
            }
        }
Example #8
0
        public ActionResult Index()
        {
            List <BaseParkinfo> parings = ParkingServices.QueryParkingByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());

            ViewBag.StartTime = DateTime.Now.AddDays(-7).Date.AddSeconds(1).ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T");
            ViewBag.EndTime   = DateTime.Now.Date.AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T");
            return(View(parings));
        }
Example #9
0
        //根据人员和车场信息 下载二维码
        public JsonResult DownloadQRCode(string parkingId, string personId, int size)
        {
            try
            {
                List <int> dics = new List <int>();
                dics.Add(258);
                dics.Add(344);
                dics.Add(430);
                dics.Add(860);
                dics.Add(1280);

                List <string> imgs = new List <string>();
                //if (string.IsNullOrWhiteSpace(SystemDefaultConfig.SystemDomain))
                //{
                //    throw new MyException("获取系统域名失败");
                //}
                BaseParkinfo parking = ParkingServices.QueryParkingByParkingID(parkingId);
                if (parking == null)
                {
                    throw new MyException("获取车场信息失败");
                }

                BaseVillage village = VillageServices.QueryVillageByRecordId(parking.VID);
                if (village == null)
                {
                    throw new MyException("获取小区信息失败");
                }
                //string url = SystemDefaultConfig.SystemDomain;
                string url     = "http://spscs.spsing.cn";
                string content = string.Format("{0}/qrl/qrp_ix_pid={1}^personId={2}", url, parkingId.Trim(), personId);
                foreach (var item in dics)
                {
                    try
                    {
                        string parkingName = string.Format("{0}_{1}", parking.PKName, item);
                        string result      = QRCodeServices.GenerateQRCode(village.CPID, content, item, parkingName);
                        imgs.Add(item.ToString() + "|" + result);
                        TxtLogServices.WriteTxtLogEx("DownloadQRCode", item.ToString() + "|" + result);
                    }
                    catch (Exception ex)
                    {
                        ExceptionsServices.AddExceptions(ex, "生存车场二维码失败");
                        imgs.Add(item.ToString() + "|");
                    }
                }

                return(Json(MyResult.Success("", imgs)));
            }
            catch (MyException ex)
            {
                return(Json(MyResult.Error(ex.Message)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "下载二维码失败");
                return(Json(MyResult.Error("下载二维码失败")));
            }
        }
Example #10
0
        /// <summary>
        /// 获得所有车场
        /// </summary>
        /// <returns></returns>
        public JsonResult GetAllParks()
        {
            JsonResult json = new JsonResult();

            try
            {
                json.Data = ParkingServices.QueryAllParking();
            }
            catch (Exception ex)
            { }
            return(json);
        }
Example #11
0
        /// <summary>
        /// 获得所有车场
        /// </summary>
        /// <returns></returns>
        public JsonResult GetParks()
        {
            JsonResult json = new JsonResult();

            try
            {
                json.Data = ParkingServices.QueryParkingByVillageIds(base.GetLoginUserVillages.Select(u => u.VID).ToList());
            }
            catch (Exception ex)
            { }
            return(json);
        }
Example #12
0
        /// <summary>
        /// 获得最小提现金额
        /// </summary>
        /// <returns></returns>
        public JsonResult GetMinAmount()
        {
            string     pkid = Request.Params["pkid"];
            JsonResult json = new JsonResult();

            try
            {
                json.Data = ParkingServices.QueryParkingByParkingID(pkid);
            }
            catch (Exception ex)
            { }
            return(json);
        }
Example #13
0
 /// <summary>
 /// 获取车场数据
 /// </summary>
 /// <param name="plateNumber"></param>
 /// <returns></returns>
 public JsonResult GetParkingData(string villageId)
 {
     try
     {
         List <BaseParkinfo> parkings = ParkingServices.QueryParkingByVillageId(villageId);
         return(Json(MyResult.Success("", parkings)));
     }
     catch (Exception ex)
     {
         ExceptionsServices.AddExceptionToDbAndTxt("H5CarVisitorError", "获取车场信息失败", ex, LogFrom.WeiXin);
         return(Json(MyResult.Error("获取车场信息失败")));
     }
 }
Example #14
0
        private List <BaseParkinfo> GetParkingBySupportAutoRefund()
        {
            Cache cache = HttpRuntime.Cache;

            if (cache["SupportAutoRefund_Parking_Cache"] != null)
            {
                return(cache["SupportAutoRefund_Parking_Cache"] as List <BaseParkinfo>);
            }
            List <BaseParkinfo> parkings = ParkingServices.GetParkingBySupportAutoRefund();

            cache.Insert("SupportAutoRefund_Parking_Cache", parkings, null, DateTime.Now.AddMinutes(5), System.Web.Caching.Cache.NoSlidingExpiration);
            return(parkings);
        }
Example #15
0
        /// <summary>
        /// 计算金额
        /// </summary>
        /// <param name="PKID">车场编号</param>
        /// <param name="StartTime">开始时间</param>
        /// <param name="EndTime">结束时间</param>
        /// <returns></returns>
        public static CalSettleAmountModel CalSettleAmount(string PKID, DateTime StartTime, DateTime EndTime)
        {
            CalSettleAmountModel settleamount = new CalSettleAmountModel();

            try
            {
                IParkSettlement factory = ParkSettlementFactory.GetFactory();
                //获取结算金额
                decimal totalamount       = 0;
                decimal handlingfeeamount = 0;
                decimal receivableamount  = 0;
                //List<ParkOrder> orderlist = factory.GetSettlementPayAmount(PKID, StartTime, EndTime);
                List <Statistics_Gather> orderlist = factory.GetSettlementPayAmount(PKID, StartTime, EndTime);
                if (orderlist != null && orderlist.Count > 0)
                {
                    var park = ParkingServices.QueryParkingByParkingID(PKID);
                    if (park == null || park.HandlingFee <= 0)
                    {
                        settleamount.Message   = "未配置车场结算费率 不能生成结算单";
                        settleamount.IsSuccess = false;
                        return(settleamount);
                    }
                    //费率在车场配置
                    decimal handlingfee = park.HandlingFee / 1000;
                    //foreach (var order in orderlist)
                    //{
                    //    //totalamount += order.PayAmount;
                    //    //handlingfeeamount += Math.Round(order.PayAmount * handlingfee, 2);
                    //
                    //}
                    //receivableamount = totalamount - handlingfeeamount;
                    foreach (var order in orderlist)
                    {
                        totalamount += order.OnLine_Amount;
                    }
                    handlingfeeamount = Math.Round(totalamount * handlingfee, 2);
                    receivableamount  = totalamount - handlingfeeamount;
                }

                settleamount.IsSuccess     = true;
                settleamount.RateFeeAmount = handlingfeeamount;
                settleamount.ReceiveAmount = receivableamount;
                settleamount.TotalAmount   = totalamount;
            }
            catch (Exception ex)
            {
                settleamount.IsSuccess = false;
                settleamount.Message   = "计算费用异常";
            }
            return(settleamount);
        }
Example #16
0
        static void Main(string[] args)
        {
            IParkingServices _parkingServices = new ParkingServices();
            int    choice;
            string userInput;

            while (true)
            {
                Menu.DisplayTextMenu();
                userInput = Console.ReadLine();
                bool validUserInput = int.TryParse(userInput, out choice);
                if (validUserInput)
                {
                    switch (choice)
                    {
                    case 1:
                        CarMessages.EnterNumberOfVehicle();
                        string plateNumber = Console.ReadLine();
                        _parkingServices.AddCar(plateNumber);
                        break;

                    case 2:
                        _parkingServices.ViewParkedCar();
                        break;

                    case 3:
                        CarMessages.EnterNumberOfVehicle();
                        plateNumber = Console.ReadLine();
                        _parkingServices.UnParkCar(plateNumber);
                        break;

                    case 4:
                        _parkingServices.GetFreeParkingLot();
                        break;

                    case 5:
                        _parkingServices.DisplayParkedCars();
                        break;

                    default:
                        Console.WriteLine("Enter a valid number between 1 and 5");
                        return;
                    }
                }
                else
                {
                    Console.WriteLine("Please enter a number from list menu not a string");
                }
            }
        }
        internal static void Main(string[] args)
        {
            var audiCarParking = new ParkingServices <Audi>(GetAudiParking());

            Console.WriteLine("All Avaialble Slots :" + audiCarParking.GetAllAvailableSlots() + " / All Parking Slots :" + audiCarParking.GetAllSlots());
            Console.WriteLine("\n\n Presss (1) for Add Car or (2) for remove car in parking ");
            var key = Console.ReadLine();

            switch (key)
            {
            case "1":
            {
                var car      = new Car <Audi>();
                var audiinfo = new Audi();
                Console.WriteLine("Enter Car details for audi \n Manufecture Year ");
                audiinfo.ManufectureYear = Console.ReadLine();
                Console.WriteLine("Owner");
                car.Owner = Console.ReadLine();
                Console.WriteLine("Model ");
                audiinfo.Model = Console.ReadLine();
                Console.WriteLine("Price ");
                audiinfo.Price   = Console.ReadLine();
                car.Manufecturer = audiinfo;

                audiCarParking.AddCar(car);
                Console.WriteLine("\n\n All Avaialble Slots :" + audiCarParking.GetAllAvailableSlots() + " / All Parking Slots :" + audiCarParking.GetAllSlots());
                break;
            }

            case "2":
            {
                Console.WriteLine("Enter Parking Details details for audi \n Floor Number");
                var floorNum = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Slot Number ");
                var slotNum = Convert.ToInt32(Console.ReadLine());
                audiCarParking.RemoveCar(floorNum, slotNum);
                Console.WriteLine("\n\n All Avaialble Slots :" + audiCarParking.GetAllAvailableSlots() + " / All Parking Slots :" + audiCarParking.GetAllSlots());
                break;
            }

            default:
                Console.WriteLine("Wrong Choice");
                break;
            }

            Console.ReadKey();
        }
Example #18
0
        public string GetPrakAreaTreeData()
        {
            try
            {
                StringBuilder       strAreaTree = new StringBuilder();
                List <BaseParkinfo> parkings    = ParkingServices.QueryParkingByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());
                if (parkings.Count == 0)
                {
                    return(string.Empty);
                }

                List <ParkArea> parkAreas = ParkAreaServices.GetParkAreaByParkingIds(parkings.Select(p => p.PKID).ToList());

                strAreaTree.Append("[");
                int index = 1;
                foreach (var item in GetLoginUserVillages)
                {
                    BaseCompany company = GetLoginUserRoleCompany.FirstOrDefault(p => p.CPID == item.CPID);
                    if (company == null)
                    {
                        continue;
                    }

                    string text = string.Format("{0}【{1}】", item.VName, company.CPName);
                    strAreaTree.Append("{\"id\":\"" + item.VID + "\",");
                    strAreaTree.Append("\"iconCls\":\"my-village-icon\",");
                    strAreaTree.Append("\"attributes\":{\"type\":0},");
                    strAreaTree.Append("\"text\":\"" + text + "\"");
                    GetParkingTreeData(parkings, parkAreas, item.VID, strAreaTree);
                    strAreaTree.Append("}");
                    if (index != GetLoginUserVillages.Count)
                    {
                        strAreaTree.Append(",");
                    }
                    index++;
                }

                strAreaTree.Append("]");
                return(strAreaTree.ToString());
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "构建车场区域树失败");
                return(string.Empty);
            }
        }
Example #19
0
        public ActionResult SaveBooking(string plateNo, string parkingId, string areaId, DateTime startTime, DateTime endTime)
        {
            try
            {
                WXReserveBitResult result = PkBitBookingServices.WXReservePKBit(WeiXinUser.AccountID, string.Empty, parkingId, areaId, plateNo, startTime, endTime);
                if (result.code == 0)
                {
                    if (parkingId != result.Order.PKID)
                    {
                        throw new MyException("车场编号不一致");
                    }

                    BaseParkinfo parking = ParkingServices.QueryParkingByParkingID(parkingId);
                    if (parking == null)
                    {
                        throw new MyException("获取车场信息失败");
                    }
                    ViewBag.ParkingName = parking.PKName;

                    ParkArea area = ParkAreaServices.QueryByRecordId(areaId);
                    if (area == null)
                    {
                        throw new MyException("获取区域信息失败");
                    }
                    ViewBag.AreaName  = area.AreaName;
                    ViewBag.PlateNo   = plateNo;
                    ViewBag.StartTime = startTime.ToString("yyyy-MM-dd HH:mm:ss");
                    ViewBag.EndTime   = endTime.ToString("yyyy-MM-dd HH:mm:ss");
                    ViewBag.AreaId    = areaId;
                    return(View(result));
                }
                if (result.code == 1)
                {
                    throw new MyException("您已经预约过了,请勿重复预约");
                }
                throw new MyException("预约失败[" + result.message + "]");
            }
            catch (MyException ex) {
                return(PageAlert("Index", "ParkBitBooking", new { RemindUserContent = ex.Message }));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptionToDbAndTxt("WeiXinWeb", "预约失败", ex, LogFrom.WeiXin);
                return(PageAlert("Index", "ParkBitBooking", new { RemindUserContent = "预约失败!" }));
            }
        }
Example #20
0
 private string GetParkingName(string parkingId)
 {
     try
     {
         BaseParkinfo model = ParkingServices.QueryParkingByParkingID(parkingId);
         if (model != null)
         {
             return(model.PKName);
         }
         return(string.Empty);
     }
     catch (Exception ex)
     {
         ExceptionsServices.AddExceptionToDbAndTxt("AliPay_Error", "获取车场名称失败", ex);
         return(string.Empty);
     }
 }
Example #21
0
        public static List <CarParkingResult> GetParkGrantByPlateNo(string plateNo)
        {
            if (plateNo.IsEmpty())
            {
                throw new ArgumentNullException("plateNo");
            }

            List <CarParkingResult> models = new List <CarParkingResult>();
            IParkGrant       factory       = ParkGrantFactory.GetFactory();
            List <ParkGrant> grants        = factory.GetParkGrantByPlateNo(plateNo);

            if (grants.Count > 0)
            {
                List <ParkCarType>  carTypes = ParkCarTypeServices.QueryParkCarTypeByRecordIds(grants.Select(p => p.CarTypeID).ToList());
                List <BaseParkinfo> parkings = ParkingServices.QueryParkingByRecordIds(grants.Select(p => p.PKID).ToList());
                List <BaseVillage>  villages = new List <BaseVillage>();
                if (parkings.Count > 0)
                {
                    IVillage factoryVillage = VillageFactory.GetFactory();
                    villages = factoryVillage.QueryVillageByRecordIds(parkings.Select(p => p.VID).ToList());
                }
                foreach (var item in grants)
                {
                    CarParkingResult model = new CarParkingResult();
                    model.PlateNo = plateNo;
                    BaseParkinfo parking = parkings.FirstOrDefault(p => p.PKID == item.PKID);

                    if (parking != null)
                    {
                        model.ParkingName = parkings != null ? parking.PKName : string.Empty;
                        BaseVillage village = villages.FirstOrDefault(p => p.VID == parking.VID);
                        model.VillageName = village != null ? village.VName : string.Empty;
                    }
                    ParkCarType carType = carTypes.FirstOrDefault(p => p.CarTypeID == item.CarTypeID);
                    if (carType != null)
                    {
                        model.CarTypeName = carType.CarTypeName;
                    }
                    model.StartTime = item.BeginDate;
                    model.EndTime   = item.EndDate;
                    models.Add(model);
                }
            }
            return(models);
        }
Example #22
0
        public string GetParkingTreeData()
        {
            try
            {
                StringBuilder strParkingTree = new StringBuilder();
                if (GetLoginUserVillages.Count == 0)
                {
                    return(strParkingTree.ToString());
                }

                List <BaseParkinfo> parkings = ParkingServices.QueryParkingByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());
                strParkingTree.Append("[");
                int index = 1;
                foreach (var obj in GetLoginUserRoleCompany)
                {
                    //List<BaseVillage> childVillages = GetLoginUserVillages.Where(p => p.CPID == obj.CPID).ToList();
                    //if (childVillages.Count == 0) continue;

                    //List<BaseParkinfo> childParkings = parkings.Where(p => childVillages.Select(o => o.VID).Contains(p.VID)).ToList();
                    //if (childParkings.Count == 0) continue;
                    //if (index != 1)
                    //{
                    //    strParkingTree.Append(",");
                    //}
                    if (index != 1)
                    {
                        strParkingTree.Append(",");
                    }
                    strParkingTree.Append("{\"id\":\"" + obj.CPID + "\",");
                    strParkingTree.Append("\"iconCls\":\"my-company-icon\",");
                    strParkingTree.Append("\"attributes\":{\"type\":0},");
                    strParkingTree.Append("\"text\":\"" + obj.CPName + "\"");
                    GetVillageTreeData(obj.CPID, parkings, strParkingTree);
                    strParkingTree.Append("}");
                    index++;
                }
                strParkingTree.Append("]");
                return(strParkingTree.ToString());
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "构建车场树异常");
                return(string.Empty);
            }
        }
Example #23
0
        /// <summary>
        /// 获得临停缴费记录
        /// </summary>
        /// <param name="paras">输入参数</param>
        /// <returns></returns>
        public static List <Statistics_Gather> Search_MonthStatistics(InParams paras)
        {
            IStatistics factory = StatisticsFactory.GetFactory();
            List <Statistics_Gather> gatherlist = factory.Search_MonthStatistics(paras);

            if (!string.IsNullOrEmpty(paras.ParkingID) && gatherlist != null && gatherlist.Count > 0)
            {
                BaseParkinfo parkinfo = ParkingServices.QueryParkingByParkingID(paras.ParkingID);
                if (parkinfo != null)
                {
                    foreach (var v in gatherlist)
                    {
                        v.ParkingName = parkinfo.PKName;
                    }
                }
            }
            return(gatherlist);
        }
Example #24
0
        /// <summary>
        /// 打折记录
        /// </summary>
        /// <returns></returns>
        public ActionResult DiscountRecord()
        {
            ViewBag.StartTime = DateTime.Now.AddDays(-7).Date.AddSeconds(1).ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T");
            ViewBag.EndTime   = DateTime.Now.Date.AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T");
            List <BaseParkinfo> parkinfos       = ParkingServices.QueryParkingByVillageId(SellerLoginUser.VID);
            List <EnumContext>  parkingContexts = new List <EnumContext>();

            foreach (var item in parkinfos)
            {
                EnumContext model = new EnumContext();
                model.EnumString  = item.PKID;
                model.Description = item.PKName;
                parkingContexts.Add(model);
            }
            ViewBag.CarDerateParkings = parkingContexts;
            ViewBag.CarDerateStatus   = EnumHelper.GetEnumContextList(typeof(CarDerateStatus), true);

            return(View());
        }
Example #25
0
        /// <summary>
        /// 访客信息
        /// </summary>
        /// <param name="parkingid"></param>
        /// <param name="cardtype"></param>
        /// <param name="platenumber"></param>
        /// <param name="addr"></param>
        /// <param name="mobile"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        public void Params_ParkVisitorInfo()
        {
            int page = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
            int rows = string.IsNullOrEmpty(Request.Params["rows"]) ? 0 : int.Parse(Request.Params["rows"]);
            VisitorReportCondition paras = new VisitorReportCondition();

            if (string.IsNullOrWhiteSpace(Request.Params["ParkingId"]) || Request.Params["ParkingId"].ToString() == "-1")
            {
                List <BaseParkinfo> parkings = ParkingServices.QueryParkingByVillageIds(base.GetLoginUserVillages.Select(u => u.VID).ToList());
                if (parkings.Count > 0)
                {
                    paras.ParkingIds = parkings.Select(p => p.PKID).ToList();
                }
            }
            else
            {
                paras.ParkingIds = new List <string>()
                {
                    Request.Params["ParkingId"].ToString()
                };
            }
            paras.PlateNumber  = Request.Params["PlateNumber"].ToString();
            paras.MoblieOrName = Request.Params["MoblieOrName"].ToString();
            paras.BeginTime    = DateTime.Parse(Request.Params["BeginTime"].ToString());
            paras.EndTime      = DateTime.Parse(Request.Params["EndTime"].ToString());
            if (!string.IsNullOrWhiteSpace(Request.Params["VisitorSource"]) && Request.Params["VisitorSource"].ToString() != "-1")
            {
                paras.VisitorSource = int.Parse(Request.Params["VisitorSource"].ToString());
            }

            if (!string.IsNullOrWhiteSpace(Request.Params["VisitorState"]) && Request.Params["VisitorState"].ToString() != "-1")
            {
                paras.VisitorState = int.Parse(Request.Params["VisitorState"].ToString());
            }
            System.Web.HttpContext.Current.Session["VisitorReportCondition"] = paras;
            System.Web.HttpContext.Current.Session["QueryParams"]            = new InParams
            {
                PageIndex  = page,
                PageSize   = rows,
                ReportType = ReportType.ParkVisitorInfo
            };
        }
Example #26
0
        /// <summary>
        /// 获得临停缴费记录
        /// </summary>
        /// <param name="paras">输入参数</param>
        /// <param name="PageSize">每页显示数</param>
        /// <param name="PageIndex">当前页</param>
        /// <returns></returns>
        public static Pagination Search_MonthStatistics(InParams paras, int PageSize, int PageIndex)
        {
            Pagination  _pagination = new Pagination();
            IStatistics factory     = StatisticsFactory.GetFactory();

            _pagination.Total = factory.Search_MonthStatisticsCount(paras);
            _pagination.StatisticsGatherList = factory.Search_MonthStatistics(paras, PageSize, PageIndex);
            if (!string.IsNullOrEmpty(paras.ParkingID) && _pagination.StatisticsGatherList != null && _pagination.StatisticsGatherList.Count > 0)
            {
                BaseParkinfo parkinfo = ParkingServices.QueryParkingByParkingID(paras.ParkingID);
                if (parkinfo != null)
                {
                    foreach (var v in _pagination.StatisticsGatherList)
                    {
                        v.ParkingName = parkinfo.PKName;
                    }
                }
            }
            return(_pagination);
        }
Example #27
0
        public ActionResult DerateSuccess(string msg, string parkingId, string licensePlate)
        {
            try
            {
                TxtLogServices.WriteTxtLogEx("QRCodeDerate", string.Format("领取成功,parkingId:{0},licensePlate:{1}", parkingId, licensePlate));
                ViewBag.Msg = msg;
                string hrefUrl = string.Empty;

                BaseParkinfo parking = ParkingServices.QueryParkingByParkingID(parkingId);
                if (parking == null)
                {
                    throw new MyException("获取车场信息失败");
                }

                if (parking.MobilePay == YesOrNo.Yes)
                {
                    string companyId = CompanyServices.GetCompanyId(parkingId, string.Empty);
                    if (string.IsNullOrWhiteSpace(companyId))
                    {
                        throw new MyException("获取单位编号失败");
                    }

                    WX_ApiConfig config = WXApiConfigServices.QueryWXApiConfig(companyId);
                    if (config == null)
                    {
                        throw new MyException("获取微信配置失败");
                    }

                    hrefUrl = string.Format("{0}/qrl/qrp_ix_pid={1}^pn={2}", SystemDefaultConfig.SystemDomain, parkingId, licensePlate);
                }
                ViewBag.HrefUrl      = hrefUrl;
                ViewBag.LicensePlate = licensePlate;
                ViewBag.DerateTime   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                return(View());
            }
            catch (Exception ex)
            {
                TxtLogServices.WriteTxtLogEx("QRCodeDerate", "提示优免结果出错", ex);
                return(RedirectToAction("BrowseError", "QRCodeDerate", new { errorMsg = "领取优免券成功,但是处理其他业务异常了【不影响优免券的正常使用】" }));
            }
        }
Example #28
0
 public JsonResult Delete(string parkingId)
 {
     try
     {
         bool result = ParkingServices.Delete(parkingId);
         if (!result)
         {
             throw new MyException("删除失败");
         }
         return(Json(MyResult.Success()));
     }
     catch (MyException ex)
     {
         return(Json(MyResult.Error(ex.Message)));
     }
     catch (Exception ex)
     {
         ExceptionsServices.AddExceptions(ex, "删除车场信息失败");
         return(Json(MyResult.Error("删除失败")));
     }
 }
Example #29
0
        public ActionResult GetParkDerateQRcodeData(string derateId, int?status, int page)
        {
            try
            {
                int rows  = 10;
                int total = 0;
                List <ParkDerateQRcode> models = ParkDerateQRcodeServices.QueryPage(SellerLoginUser.SellerID, derateId, 0, status, DerateQRCodeSource.Seller, rows, page, out total);
                if (models.Count > 0)
                {
                    ParkSeller seller = ParkSellerServices.QueryBySellerId(SellerLoginUser.SellerID);
                    if (seller == null)
                    {
                        throw new MyException("获取商家信息失败");
                    }

                    List <BaseParkinfo> parkings = ParkingServices.QueryParkingByVillageId(seller.VID);

                    Dictionary <string, int> result = ParkCarDerateServices.QuerySettlementdCarDerate(models.Select(p => p.RecordID).ToList());
                    foreach (var item in models)
                    {
                        int    useTimes    = result.ContainsKey(item.RecordID) ? result[item.RecordID] : 0;
                        string canUseTimes = item.CanUseTimes == 0 ? "不限" : item.CanUseTimes.ToString();
                        item.UseTimesDes = string.Format("{0}/{1}", canUseTimes, useTimes);
                        BaseParkinfo park = parkings.FirstOrDefault(p => p.PKID == item.PKID);
                        if (park != null)
                        {
                            item.ParkName = park.PKName;
                        }
                    }
                }
                return(Json(MyResult.Success("", models)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "获取优免二维码失败", LogFrom.WeiXin);
                return(Json(MyResult.Error("获取优免二维码失败")));
            }
        }
Example #30
0
        public JsonResult GetParkFeeRuleTreeData()
        {
            JsonResult json = new JsonResult();

            if (string.IsNullOrEmpty(Request.Params["sellerId"]))
            {
                return(json);
            }

            string     sellerId = Request.Params["sellerId"].ToString();
            ParkSeller seller   = ParkSellerServices.QueryBySellerId(sellerId);

            if (seller == null)
            {
                throw new MyException("获取商家信息失败");
            }

            List <BaseParkinfo> parkings = ParkingServices.QueryParkingByVillageId(seller.VID);

            if (parkings.Count == 0)
            {
                return(json);
            }

            List <ParkFeeRule> rules = new List <ParkFeeRule>();

            foreach (var item in parkings)
            {
                List <ParkFeeRule> rule = ParkFeeRuleServices.QueryParkFeeRuleByParkingId(item.PKID);
                if (rule.Count > 0)
                {
                    rules.AddRange(rule);
                }
            }
            json.Data = rules;
            return(json);
        }