public ActionResult Index() { string plateNumber = OnlineOrderServices.QueryLastPaymentPlateNumber(PaymentChannel.WeiXinPay, WeiXinUser.OpenID); ViewBag.PlateNumber = plateNumber; return(View()); }
/// <summary> /// 车牌缴费 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Index(bool updatePlateNo = false) { List <string> myLicensePlates = new List <string>(); string defaultPlateNumber = string.Empty; if (UserAccount != null) { myLicensePlates = CarService.GetTempCarInfoIn(UserAccount.AccountID); defaultPlateNumber = OnlineOrderServices.QueryLastPaymentPlateNumber(UserAccount.AccountID); if (!string.IsNullOrWhiteSpace(defaultPlateNumber) && !updatePlateNo) { ParkIORecord model = ParkIORecordServices.QueryLastExitIORecordByPlateNumber(defaultPlateNumber); if (model != null) { return(RedirectToAction("ComputeParkingFee", "H5ParkingPayment", new { licensePlate = defaultPlateNumber, parkingId = model.ParkingID })); } } if (!string.IsNullOrWhiteSpace(defaultPlateNumber)) { if (myLicensePlates.Contains(defaultPlateNumber)) { myLicensePlates.Remove(defaultPlateNumber); } } else if (myLicensePlates.Count > 0) { defaultPlateNumber = myLicensePlates.First(); myLicensePlates.Remove(defaultPlateNumber); } } ViewBag.PlateNumber = defaultPlateNumber; return(View(myLicensePlates)); }
/// <summary> /// 扫码优免进入 /// </summary> /// <param name="vid">小区编号</param> /// <param name="qid">二维码编号</param> /// <param name="type">0-长久二维码 1-临时二维码</param> /// <param name="sign">签名</param> /// <returns></returns> public ActionResult Index(string vid, string qid, string sign) { TxtLogServices.WriteTxtLogEx("QRCodeDerate", "进入扫码打折:vid={0},qid={1},sign={2}", vid, qid, sign); try { if (SourceClient != RequestSourceClient.WeiXin) { throw new MyException("请在微信中打开"); } if (!CheckSignature(vid, qid, sign)) { throw new MyException("验证签名失败"); } if (SourceClient == RequestSourceClient.WeiXin) { if (string.IsNullOrWhiteSpace(WeiXinOpenId)) { ParkDerate derate = ParkDerateServices.Query(qid); if (derate == null) { throw new MyException("获取优免券信息失败"); } ParkSeller seller = ParkSellerServices.QueryBySellerId(derate.SellerID); if (seller == null) { throw new MyException("获取商家信息失败"); } BaseVillage village = VillageServices.QueryVillageByRecordId(seller.VID); if (village == null) { throw new MyException("获取小区信息失败"); } string id = string.Format("QRCodeDerate_Index_vid={0}^qid={1}^sign={2}^companyId={3}", vid, qid, sign, village.CPID); return(RedirectToAction("Index", "WeiXinAuthorize", new { id = id })); } } ViewBag.PlateNumber = OnlineOrderServices.QueryLastPaymentPlateNumber(PaymentChannel.WeiXinPay, WeiXinOpenId); ViewBag.VillageId = vid; ViewBag.QId = qid; return(View()); } catch (MyException ex) { TxtLogServices.WriteTxtLogEx("QRCodeDerate", "扫码打折异常:描述:{0}", ex.Message); return(RedirectToAction("Index", "ErrorPrompt", new { message = ex.Message })); } catch (Exception ex) { TxtLogServices.WriteTxtLogEx("QRCodeDerate", "扫码打折异常:描述:{0},明细:{1}", ex.Message, ex.StackTrace); return(RedirectToAction("Index", "ErrorPrompt", new { message = "扫码失败,未知异常" })); } }
/// <summary> /// 扫描缴费 /// </summary> /// <param name="pid">车场编号</param> /// <param name="pn">车牌号</param> /// <param name="bid">岗亭编号</param> /// <returns></returns> public ActionResult Index(string pid, string pn, string bid, string personId = "") { TxtLogServices.WriteTxtLogEx("QRCodeParkPayment", "进入Index,pid:{0}, pn:{1}, bid:{2},personId:{3}", pid, pn, bid, personId); try { if (SourceClient != RequestSourceClient.AliPay && SourceClient != RequestSourceClient.WeiXin) { return(RedirectToAction("Index", "ErrorPrompt", new { message = "请在微信或支付宝中打开" })); } string companyId = CompanyServices.GetCompanyId(pid, bid); if (string.IsNullOrWhiteSpace(companyId)) { throw new MyException("获取单位编号失败"); } if (SourceClient == RequestSourceClient.AliPay) { if (string.IsNullOrWhiteSpace(AliPayUserId)) { string id = string.Format("QRCodeParkPayment_Index_pid={0}^pn={1}^bid={2}^companyId={3}^personId={4}", pid, pn, bid, companyId, personId); return(RedirectToAction("Index", "AliPayAuthorize", new { id = id })); } } else if (SourceClient == RequestSourceClient.WeiXin) { if (string.IsNullOrWhiteSpace(WeiXinOpenId)) { string id = string.Format("QRCodeParkPayment_Index_pid={0}^pn={1}^bid={2}^companyId={3}^personId={4}", pid, pn, bid, companyId, personId); return(RedirectToAction("Index", "WeiXinAuthorize", new { id = id })); } } if (!string.IsNullOrWhiteSpace(bid)) { return(RedirectToAction("ComputeParkingFee", "QRCodeParkPayment", new { bid = bid })); } else { if (SourceClient == RequestSourceClient.WeiXin || SourceClient == RequestSourceClient.AliPay) { TxtLogServices.WriteTxtLogEx("QRCodeParkPayment", "车牌号:" + pn); if (!string.IsNullOrWhiteSpace(pn)) { return(RedirectToAction("ComputeParkingFee", "QRCodeParkPayment", new { pid = pid, licensePlate = pn })); } } else { return(RedirectToAction("Index", "ErrorPrompt", new { message = "请在微信或支付宝中打开" })); } } ViewBag.CurrParkingId = pid; if (SourceClient == RequestSourceClient.AliPay) { ViewBag.PlateNumber = OnlineOrderServices.QueryLastPaymentPlateNumber(PaymentChannel.AliPay, AliPayUserId); } else { ViewBag.PlateNumber = OnlineOrderServices.QueryLastPaymentPlateNumber(PaymentChannel.WeiXinPay, WeiXinOpenId); } if (!string.IsNullOrWhiteSpace(personId)) { Session["SmartSystem_WeiXinTg_personid"] = personId; } return(View()); } catch (Exception ex) { ExceptionsServices.AddExceptionToDbAndTxt("QRCodeParkPayment", "Index方法处理异常", ex, LogFrom.WeiXin); return(RedirectToAction("Index", "ErrorPrompt", new { message = "处理异常" })); } }