Beispiel #1
0
        /// <summary>
        /// 显示创建订单页面
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public ComfireFlightOrderResponseViewModel ComfireOrderViewApplicationService(
            ComfireFlightOrderRequestViewModel request)
        {
            CustomerModel           customerModel     = _getCustomerServiceBll.GetCustomerByCid(request.Cid);
            List <ProjectNameModel> projectNameModels = _getProjectNameServiceBll.GetProjectNameByNotDelete(request.Cid);

            List <InsuranceCompanyModel> insuranceCompanyModels = _getInsuranceCompanyServiceBll.GetInsuranceCompany();

            if (request.OrderSource != "O")
            {
                insuranceCompanyModels = insuranceCompanyModels?.FindAll(n => n.UpOnLine == "T");
            }

            ComfireFlightOrderResponseViewModel v = new ComfireFlightOrderResponseViewModel();

            v.CName    = customerModel.RealName;
            v.EMail    = customerModel.Email;
            v.IsMaster = customerModel.IsMaster;
            v.Mobile   = customerModel.Mobile;
            if (!string.IsNullOrEmpty(customerModel.CorpID))
            {
                CorporationModel corporationModel = _getCorpServiceBll.GetCorp(customerModel.CorpID);
                v.IsPrint = corporationModel.IsPrint ?? 0;
                //获取成本中心
                List <CostCenterModel> costCenterModels =
                    _getCostCenterServiceBll.GetCostCenterByNoDelete(customerModel.CorpID);
                v.CostCenterList = Mapper.Map <List <CostCenterModel>, List <CostCenterViewModel> >(costCenterModels);
            }

            v.ProjectNameList = Mapper.Map <List <ProjectNameModel>, List <ProjectNameViewModel> >(projectNameModels);
            v.InsuranceList   = (from n in insuranceCompanyModels
                                 select new FltInsuranceViewModel()
            {
                ProductId = n.CompanyID,
                ProductName = n.ProductName,
                SalePrice = n.FacePrice
            }).ToList();

            v.CardTypeList = (from n in EnumConvert.QueryEnum <CardTypeEnum>()
                              select new SortedListViewModel()
            {
                Key = n.Key,
                Value = n.Value
            }).ToList();

            v.SendTicketTypeList = (from sendTicket in EnumConvert.QueryEnum <SendTicketTypeEnum>()
                                    where
                                    sendTicket.Key != (int)SendTicketTypeEnum.TraAfter &&
                                    sendTicket.Key != (int)SendTicketTypeEnum.TraBefore
                                    select new SortedListViewModel()
            {
                Key = sendTicket.Key,
                Value = sendTicket.Value
            }).ToList();

            List <ContactAddressModel> contactAddressModels =
                _getContactAddressServiceBll.GetContactAddressByCid(request.Cid);

            if (contactAddressModels != null && contactAddressModels.Count > 0)
            {
                v.AddressList = contactAddressModels.Select(n => n.Address).ToList();
            }

            return(v);
        }
Beispiel #2
0
        public QueryFltOrderResponseViewModel QueryOrder(QueryFltOrderRequestViewModel request)
        {
            if (!request.OrderId.HasValue)
            {
                throw new Exception("请传入订单Id");
            }
            //1.查询机场信息
            SearchCityAportModel aportModel = _getCityForFlightServiceBll.SearchAirport(new List <string>()
            {
                "N"
            });
            //2.根据Cid查询客户信息
            CustomerModel customerModel = _getCustomerServiceBll.GetCustomerByCid(request.Cid);
            //3.获取保险产品信息
            List <InsuranceCompanyModel> insuranceCompanyModels = _getInsuranceCompanyServiceBll.GetInsuranceCompany();
            //4.获取项目名称
            List <ProjectNameModel>    projectNameModels = _getProjectNameServiceBll.GetProjectName(request.Cid);
            QueryFlightOrderQueryModel query             = Mapper.Map <QueryFltOrderRequestViewModel, QueryFlightOrderQueryModel>(request);

            query.AportInfo        = aportModel;
            query.Customer         = customerModel;
            query.CorpId           = customerModel.CorpID;
            query.InsuranceCompany = insuranceCompanyModels;
            query.ProjectName      = projectNameModels;
            if (!string.IsNullOrEmpty(customerModel.CorpID))
            {
                query.CorpCustomerList = _getCustomerServiceBll.GetCustomerByCorpId(customerModel.CorpID);
            }


            //判断当前客户是该订单的审批人
            query.IsFromAduitQuery = _checkAduitOrderServiceBll.CheckAduitCidHasOrderId(request.Cid,
                                                                                        request.OrderId.Value);

            QueryFlightOrderDataModel dataModel = _queryFlightOrderServiceBll.QueryFlightOrder(query);

            if (dataModel != null && customerModel.Corporation != null && customerModel.Corporation.AllowShowDataBeginTime.HasValue)
            {
                if (customerModel.Corporation.AllowShowDataBeginTime > dataModel.OrderDate)
                {
                    throw new Exception("查无此订单");
                }
            }

            if (dataModel != null && dataModel.IsOnlineShow != 1)
            {
                List <CorpAduitOrderInfoModel> corpAduitOrderInfoModels =
                    _getCorpAduitOrderServiceBll.GetAduitOrderInfoByOrderId(dataModel.OrderId);

                if (corpAduitOrderInfoModels != null && corpAduitOrderInfoModels.Count > 0)
                {
                    dataModel.AduitOrderId     = corpAduitOrderInfoModels[0].AduitOrderId;
                    dataModel.AduitOrderStatus = corpAduitOrderInfoModels[0].Status;
                    if (!string.IsNullOrEmpty(corpAduitOrderInfoModels[0].NextAduitName))
                    {
                        dataModel.AuditStatus = string.Format("待{0}审批", corpAduitOrderInfoModels[0].NextAduitName);
                        if (corpAduitOrderInfoModels[0].NextAduitCidList.Contains(request.Cid))
                        {
                            dataModel.IsCurrentCustomerAduitOrder = true;
                        }
                    }
                }
                else
                {
                    if ((dataModel.ProcessStatus & 8) != 8 && dataModel.OrderStatus != "C")
                    {
                        dataModel.IsShowCancelButton = true; //没有审批的,并且还没有出票的,显示取消按钮
                    }
                }
            }

            QueryFltOrderResponseViewModel viewModel = Mapper.Map <QueryFlightOrderDataModel, QueryFltOrderResponseViewModel>(dataModel);

            return(viewModel);
        }