protected static SupplierInfo getSupplierInfo(MatchedPolicy specialPolicy, SpeicalProductInfo product) { var supplier = CompanyService.GetCompanyDetail(specialPolicy.Provider); if (!publisherIsValid(supplier)) { throw new CustomException("产品发布方已无效,无法生成订单"); } return(new Domain.SupplierInfo(specialPolicy.Provider, supplier.AbbreviateName) { Rebate = Deduction.GetDeduction(specialPolicy).Supplier, Product = product }); }
protected static bool hasETDZPermission(Guid publisherId, SpeicalProductInfo speicalProduct) { var publisher = CompanyService.GetCompanyInfo(publisherId); if (publisher.Type == CompanyType.Provider) { return(true); } switch (speicalProduct.SpeicalProductType) { case SpecialProductType.Singleness: case SpecialProductType.Disperse: case SpecialProductType.CostFree: case SpecialProductType.Bloc: return(false); case SpecialProductType.Business: return(true); default: return(false); } }
internal static ProductInfo GetProductInfo(PolicyMatch.MatchedPolicy policy) { ProductInfo productInfo = null; if (policy.PolicyType == PolicyType.NormalDefault || policy.PolicyType == PolicyType.BargainDefault || policy.PolicyType == PolicyType.OwnerDefault || (policy.PolicyType == PolicyType.Normal && policy.OriginalPolicy == null && policy.OriginalExternalPolicy == null)) { return(new CommonProductInfo { OfficeNo = policy.OfficeNumber, //NeedAuth = policy.NeedAUTH, ProductType = policy.PolicyType == PolicyType.BargainDefault ? ProductType.Promotion : ProductType.General, RequireChangePNR = false, ETDZMode = ETDZMode.Manual, TicketType = TicketType.BSP, Id = policy.Id, Remark = string.Empty, Condition = string.Empty, IsDefaultPolicy = policy.PolicyType == PolicyType.NormalDefault || policy.PolicyType == PolicyType.BargainDefault || policy.PolicyType == PolicyType.OwnerDefault, RefundAndReschedulingProvision = new RefundAndReschedulingProvision() }); } if (policy.PolicyType == PolicyType.Special) { var specialPolicy = policy.OriginalPolicy as SpecialPolicyInfo; productInfo = new SpeicalProductInfo { RequireConfirm = specialPolicy.ConfirmResource, SpeicalProductType = specialPolicy.Type, ProductType = ProductType.Special, OfficeNo = specialPolicy.OfficeCode, //NeedAuth = policy.NeedAUTH }; } else if (policy.IsExternal) { productInfo = new CommonProductInfo { ProductType = GetProductType(policy), RequireChangePNR = policy.OriginalExternalPolicy.RequireChangePNR, ETDZMode = ETDZMode.Manual }; } else { var generalPolicy = policy.OriginalPolicy as IGeneralPolicy; productInfo = new CommonProductInfo { ProductType = GetProductType(policy), RequireChangePNR = generalPolicy.ChangePNR, ETDZMode = generalPolicy.AutoPrint ? ETDZMode.Auto : ETDZMode.Manual }; } if (policy.IsExternal) { productInfo.Id = Guid.NewGuid(); productInfo.OfficeNo = policy.OriginalExternalPolicy.OfficeNo; //productInfo.NeedAuth = policy.OriginalExternalPolicy.RequireAuth; productInfo.TicketType = policy.OriginalExternalPolicy.TicketType; productInfo.Remark = policy.OriginalExternalPolicy.Remark; productInfo.Condition = policy.OriginalExternalPolicy.Condition; } else { productInfo.Id = policy.OriginalPolicy.Id; productInfo.OfficeNo = policy.OriginalPolicy.OfficeCode; //productInfo.NeedAuth = policy.OriginalPolicy.NeedAUTH; productInfo.TicketType = policy.OriginalPolicy.TicketType; productInfo.Remark = policy.OriginalPolicy.Remark; productInfo.Condition = policy.OriginalPolicy.Condition; } if (policy.OriginalPolicy is IHasRegulation) { var regulation = (IHasRegulation)policy.OriginalPolicy; productInfo.RefundAndReschedulingProvision = new RefundAndReschedulingProvision() { Refund = regulation.RefundRegulation, Scrap = regulation.InvalidRegulation, Alteration = regulation.ChangeRegulation, Transfer = regulation.EndorseRegulation }; } else { productInfo.RefundAndReschedulingProvision = new RefundAndReschedulingProvision(); } return(productInfo); }