/// <summary> /// 修改价格信息 /// </summary> internal void ReviseFare(IEnumerable <PriceView> priceViews) { if (Status != OrderStatus.Finished) { throw new StatusException(Id.ToString()); } if (RevisedPrice) { throw new CustomException("已修改过价格,不能再次修改"); } if (FinishedApplyforms.Any(a => a is RefundOrScrapApplyform)) { throw new CustomException("已有完成的退废票申请单,不能修改价格"); } PNRInfos.First().ReviseFare(priceViews); RevisedPrice = true; foreach (var applyform in Applyforms) { applyform.RequireRevisePrice = false; } }
public void UpdateProvision(MatchedPolicy policy) { if (policy.PolicyType == PolicyType.Bargain || policy.PolicyType == PolicyType.BargainDefault) { var regulation = policy as IHasRegulation; Provider.Product.RefundAndReschedulingProvision.Refund = regulation.RefundRegulation; Provider.Product.RefundAndReschedulingProvision.Scrap = regulation.InvalidRegulation; Provider.Product.RefundAndReschedulingProvision.Transfer = regulation.EndorseRegulation; Provider.Product.RefundAndReschedulingProvision.Alteration = regulation.ChangeRegulation; } else { var flight = PNRInfos.First().Flights.First(); var pattern = new Regex("^[a-zA-Z\\d/]+$"); var details = FoundationService.QueryDetailList(flight.Carrier.Code, flight.Bunk.Code).Where(item => pattern.IsMatch(item.Bunks)); string refundRegulation = string.Empty; string changeRegulation = string.Empty; string endorseRegulation = string.Empty; foreach (var item in details) { refundRegulation += "航班起飞前:" + item.ScrapBefore + ";航班起飞后:" + item.ScrapAfter; changeRegulation += "航班起飞前:" + item.ChangeBefore + ";航班起飞后:" + item.ChangeAfter; endorseRegulation += item.Endorse; } if (string.IsNullOrWhiteSpace(refundRegulation)) { refundRegulation = "以航司具体规定为准"; } if (string.IsNullOrWhiteSpace(changeRegulation)) { changeRegulation = "以航司具体规定为准"; } Provider.Product.RefundAndReschedulingProvision.Refund = refundRegulation; Provider.Product.RefundAndReschedulingProvision.Scrap = details.Any() ? details.First().Scrap : "以航司具体规定为准"; Provider.Product.RefundAndReschedulingProvision.Transfer = endorseRegulation; Provider.Product.RefundAndReschedulingProvision.Alteration = changeRegulation; } }
bool updateOrderForResource(PNRPair pnrCode, decimal?patPrice, Guid oemId) { if (PNRPair.IsNullOrEmpty(pnrCode)) { throw new CustomException("编码信息不能为空"); } var pnrInfo = this._pnrInfos.First(); bool fareRevised = false; fareRevised = pnrInfo.UpdateContentForResource(pnrCode, (Product as SpeicalProductInfo).SpeicalProductType != SpecialProductType.OtherSpecial, patPrice, IsStandby, oemId, PNRInfos.First().PNRContent != string.Empty, IsThirdRelation); ReservationPNR = pnrInfo.Code; SupplyTime = DateTime.Now; return(fareRevised); }
string checkReservationPNRValidity(Guid oemId) { if (!PNRPair.IsNullOrEmpty(this.ReservationPNR)) { var executeResult = CommandService.GetReservedPnr(ReservationPNR, oemId); if (executeResult.Success) { CommandService.ValidatePNR(executeResult.Result, IsChildrenOrder ? PassengerType.Child : PassengerType.Adult); if (Source == OrderSource.PlatformOrder && executeResult.Result.Passengers != null && executeResult.Result.Passengers.Join(PNRInfos.First().Passengers, p => p.Name, p => p.Name, (p, q) => p).Count() != executeResult.Result.Passengers.Count) { LogService.SaveExceptionLog(new Exception("乘机人信息不符") { Source = "编码验证" }, "订单号:" + Id + ",编码内容中的乘机人姓名为:" + string.Join(",", executeResult.Result.Passengers.Select(p => p.Name))); } } else { //throw new CustomException("编码提取失败"); if (OrderSource.PlatformOrder != Source) { return("暂时无法验证您导入编码的位置是否有效,请您自行确认"); } else { LogService.SaveExceptionLog(new CustomException(string.Format("由于编码内容提取失败,平台预订的编码:{0} 未进行有效性验证,时间:{1:yyyy-MM-dd HH:mm}", ReservationPNR.ToListString(), DateTime.Now))); } } } return(string.Empty); }