public GetNotUseTicketNoViewModel GetNotUseNationTicketNoList(GetNotUseTicketNoQueryViewModel request) { //1.查询机场信息 SearchCityAportModel aportModel = _getCityForFlightServiceBll.SearchAirport(new List <string>() { "N" }); //2.根据Cid查询客户信息 CustomerModel customerModel = _getCustomerServiceBll.GetCustomerByCid(request.Cid); //3.查询机票订单 GetNotUseTicketNoQueryModel query = Mapper.Map <GetNotUseTicketNoQueryViewModel, GetNotUseTicketNoQueryModel>(request); query.AportInfo = aportModel; query.CorpId = customerModel.CorpID; query.Customer = customerModel; //3.1判断是否是administrator帐号,如果是则获取当前公司下所有订单 if (customerModel.UserID.ToLower() == "administrator") { query.Cid = null; } GetNotUseTicketNoModel notUseTicketNoModel = _getNotUseTicketNoListServiceBll.GetNotUseNationTicketNoList(query); GetNotUseTicketNoViewModel viewModel = Mapper.Map <GetNotUseTicketNoModel, GetNotUseTicketNoViewModel>(notUseTicketNoModel); return(viewModel); }
public GetAduitOrderResponseViewModel GetAuditOrder(GetAduitOrderRequestViewModel request) { CorpAduitOrderInfoModel corpAduitOrder = _getCorpAduitOrderServiceBll.GetAduitOrderInfoById(request.AduitOrderId); if (request.OrderSource != "O" && (corpAduitOrder.AduitCidList == null || !corpAduitOrder.AduitCidList.Contains(request.Cid))) { throw new Exception("您无权查看该审批单"); } if (corpAduitOrder.OrderDetailList != null && corpAduitOrder.OrderDetailList.Count > 0) { //查询机场信息 _getFltOrderBll.AportInfo = _getCityForFlightServiceBll.SearchAirport(new List <string>() { "N" }); foreach (var detail in corpAduitOrder.OrderDetailList) { //机票 if (detail.OrderTypeEnum == OrderSourceTypeEnum.Flt) { detail.FltOrder = _getFltOrderBll.GetFltOrderById(detail.OrderId); } } } GetAduitOrderResponseViewModel viewModel = Mapper.Map <CorpAduitOrderInfoModel, GetAduitOrderResponseViewModel>(corpAduitOrder); return(viewModel); }
public GetRetApplyResponseViewModel GetRetApplyView(GetRetApplyRequestViewModel request) { //1.查询机场信息 SearchCityAportModel aportModel = _getCityForFlightServiceBll.SearchAirport(new List <string>() { "N" }); //2.根据Cid查询客户信息 CustomerModel customerModel = _getCustomerServiceBll.GetCustomerByCid(request.Cid); GetRetApplyQueryModel query = Mapper.Map <GetRetApplyRequestViewModel, GetRetApplyQueryModel>(request); query.AportInfo = aportModel; query.Customer = customerModel; if (customerModel.UserID.ToLower() == "administrator" && !string.IsNullOrEmpty(customerModel.CorpID)) { throw new Exception("administrator帐号无法提交退票申请"); } GetRetApplyModel dataModel = _getFltDomesticRetApplyViewServiceBll.GetRetApply(query); GetRetApplyResponseViewModel viewModel = Mapper.Map <GetRetApplyModel, GetRetApplyResponseViewModel>(dataModel); viewModel.ServiceFee = (dataModel.FlightList[0].ServiceFee ?? 0); return(viewModel); }
public SearchCityAirportResponseViewModel SearchAirport(SearchCityAirportRequestViewModel request) { List <string> requestList = new List <string>(); requestList.Add("N"); if (request.IsInter == "I") { requestList.Add("I"); } SearchCityAportModel cityAportModel = _getCityForFlightServiceBll.SearchAirport(requestList); SearchCityAirportResponseViewModel v = Mapper.Map <SearchCityAportModel, SearchCityAirportResponseViewModel>(cityAportModel); return(v); }
public TravelResponseViewModel GetTravel(TravelRequestViewModel request) { ContactInfoModel contactInfoModel = _getContactBll.GetCorpContactByCid(request.Cid); if (contactInfoModel == null) { throw new Exception("无法查询到对应的联系人信息"); } //1.查询机场信息 SearchCityAportModel aportModel = _getCityForFlightServiceBll.SearchAirport(new List <string>() { "N" }); TravelQueryModel query = Mapper.Map <TravelRequestViewModel, TravelQueryModel>(request); query.AportInfo = aportModel; query.ContactId = contactInfoModel.ContactId; TravelModel travelModel = _getTravelServiceBll.GetTravelList(query); TravelResponseViewModel viewModel = Mapper.Map <TravelModel, TravelResponseViewModel>(travelModel); return(viewModel); }
public QueryFltRetApplyListResponseViewModel QueryFltRetApplyList(QueryFltRetApplyListRequestViewModel request) { //1.查询机场信息 SearchCityAportModel aportModel = _getCityForFlightServiceBll.SearchAirport(new List <string>() { "N" }); //2.根据Cid查询客户信息 CustomerModel customerModel = _getCustomerServiceBll.GetCustomerByCid(request.Cid); QueryFlightRetApplyListDataQueryModel query = Mapper.Map <QueryFltRetApplyListRequestViewModel, QueryFlightRetApplyListDataQueryModel>(request); query.AportInfo = aportModel; query.CorpId = customerModel.CorpID; query.Customer = customerModel; //判断是否显示全部订单 if ((request.IsShowAllOrder ?? 0) == 1) { //判断用户是否有查看全部订单的权限 if ((customerModel.IsShowAllOrder ?? 0) == 1) { query.Cid = null; } } //3.1判断是否是administrator帐号,如果是则获取当前公司下所有订单 if (customerModel.UserID.ToLower() == "administrator") { query.Cid = null; } if (!string.IsNullOrEmpty(customerModel.CorpID)) { query.CorpCustomerList = _getCustomerServiceBll.GetCustomerByCorpId(customerModel.CorpID); } QueryFlightRetApplyListModel result = _queryFlightRetApplyListServiceBll.QueryFlightRetApplyList(query); if (result.ApplyDataList != null && result.ApplyDataList.Count > 0) { foreach (var order in result.ApplyDataList) { List <CorpAduitOrderInfoModel> corpAduitOrderInfoModels = _getCorpAduitOrderServiceBll.GetAduitOrderInfoByOrderId(order.Rmid); if (corpAduitOrderInfoModels != null && corpAduitOrderInfoModels.Count > 0) { order.AduitOrderStatus = corpAduitOrderInfoModels[0].Status; if (!string.IsNullOrEmpty(corpAduitOrderInfoModels[0].NextAduitName)) { order.AuditStatus = string.Format("待{0}审批", corpAduitOrderInfoModels[0].NextAduitName); } } } } QueryFltRetApplyListResponseViewModel viewModel = Mapper.Map <QueryFlightRetApplyListModel, QueryFltRetApplyListResponseViewModel>(result); SortedList <string, string> sortedList = EnumConvert.QueryEnumStr <FltRetApplyStatusEnum>(); viewModel.QueryOrderStatusList = (from status in sortedList select new SortedListViewModel() { Key = status.Key, Value = status.Value }).ToList(); return(viewModel); }
public GetAuditOrderListResponseViewModel GetAuditOrderList(GetAuditOrderListRequestViewModel request) { //1.根据Cid查询客户信息 CustomerModel customerModel = _getCustomerServiceBll.GetCustomerByCid(request.Cid); if (string.IsNullOrEmpty(customerModel.IsCheckPerson) || customerModel.IsCheckPerson.ToUpper() != "T") { throw new Exception("当前用户无权审批"); } AuditOrderListModel list = null; if (request.AuditType == 1)//待审批信息 { #region 待审批信息 list = _getCorpAduitOrderListServiceBll.GetWaitCorpAduitOrderList(new AuditOrderListQueryModel() { AuditCid = request.Cid, PageSize = request.PageSize, PageIndex = request.PageIndex, Customer = customerModel }); #endregion } else if (request.AuditType == 2)//审批通过 { #region 审批通过 list = _getCorpAduitOrderListServiceBll.GetPassCorpAduitOrderList(new AuditOrderListQueryModel() { AuditCid = request.Cid, PageSize = request.PageSize, PageIndex = request.PageIndex, Customer = customerModel }); #endregion } else if (request.AuditType == 3)//审批不通过 { #region 审批不通过 list = _getCorpAduitOrderListServiceBll.GetNoPassCorpAduitOrderList(new AuditOrderListQueryModel() { AuditCid = request.Cid, PageSize = request.PageSize, PageIndex = request.PageIndex, Customer = customerModel }); #endregion } #region 组装审批内容 if (list != null && list.DataList != null && list.DataList.Count > 0) { //查询机场信息 _getFltOrderBll.AportInfo = _getCityForFlightServiceBll.SearchAirport(new List <string>() { "N" }); _getFlightRetModApplyBll.AportInfo = _getCityForFlightServiceBll.SearchAirport(new List <string>() { "N" }); //调用查询该客户的差旅政策服务 List <ChoiceReasonModel> reasonModels = _getCustomerCorpPolicyServiceBll.GetCorpReasonByCorpId(customerModel.CorpID); _getFlightRetModApplyBll.PolicyReasonList = reasonModels; foreach (var data in list.DataList) { foreach (var detail in data.DetailList) { if (detail.OrderType == OrderSourceTypeEnum.Flt) { FltOrderInfoModel fltOrderInfoModel = _getFltOrderBll.GetFltOrderById(detail.OrderId); if (fltOrderInfoModel == null) { continue; } detail.ChoiceReason = fltOrderInfoModel.ChoiceReason; detail.CorpPolicy = fltOrderInfoModel.CorpPolicy; detail.OrderAmount = fltOrderInfoModel.Payamount; detail.PassengerNameList = fltOrderInfoModel.PassengerNameList; detail.TackOffTimeList = fltOrderInfoModel.TackOffTimeList; detail.TravelList = fltOrderInfoModel.TravelList; detail.OrderIdDes = fltOrderInfoModel.OrderId.ToString(); } else if (detail.OrderType == OrderSourceTypeEnum.FltModApply || detail.OrderType == OrderSourceTypeEnum.FltRetApply) { FltRetModApplyModel fltRetModApplyModel = _getFlightRetModApplyBll.GetRetModApply(detail.OrderId); if (fltRetModApplyModel == null) { continue; } detail.ChoiceReason = fltRetModApplyModel.ChoiceReason; detail.CorpPolicy = fltRetModApplyModel.CorpPolicy; detail.OrderAmount = fltRetModApplyModel.TotalAuditPrice; detail.PassengerNameList = fltRetModApplyModel.PassengerNameList; detail.TackOffTimeList = fltRetModApplyModel.TackOffTimeList; detail.TravelList = fltRetModApplyModel.TravelList; detail.OrderIdDes = fltRetModApplyModel.OrderId.ToString(); } else if (detail.OrderType == OrderSourceTypeEnum.Tra) { TraOrderInfoModel traOrderInfoModel = _getTraOrderServiceBll.GetTraOrderByOrderId(detail.OrderId); if (traOrderInfoModel == null) { continue; } detail.ChoiceReason = traOrderInfoModel.ChoiceReason; detail.CorpPolicy = traOrderInfoModel.CorpPolicy; detail.OrderAmount = traOrderInfoModel.Order.TotalMoney; detail.PassengerNameList = traOrderInfoModel.PassengerNameList; detail.TackOffTimeList = traOrderInfoModel.TackOffTimeList; detail.TravelList = traOrderInfoModel.TravelList; detail.OrderIdDes = traOrderInfoModel.Order.OrderId.ToString(); } } } } #endregion GetAuditOrderListResponseViewModel responseViewModel = Mapper.Map <AuditOrderListModel, GetAuditOrderListResponseViewModel>(list); return(responseViewModel); }
public QueryFlightModApplyResponseViewModel QueryFlightModApply(QueryFltRetModApplyRequestViewModel request) { if (!request.Rmid.HasValue) { throw new Exception("请传入Rmid参数"); } //1.查询机场信息 SearchCityAportModel aportModel = _getCityForFlightServiceBll.SearchAirport(new List <string>() { "N" }); //2.根据Cid查询客户信息 CustomerModel customerModel = _getCustomerServiceBll.GetCustomerByCid(request.Cid); //调用查询该客户的差旅政策服务 List <ChoiceReasonModel> reasonModels = _getCustomerCorpPolicyServiceBll.GetCorpReasonByCorpId(customerModel.CorpID)? .FindAll(n => n.PolicyType == "N"); QueryFlightModApplyQueryModel query = Mapper.Map <QueryFltRetModApplyRequestViewModel, QueryFlightModApplyQueryModel>(request); query.AportInfo = aportModel; query.CorpId = customerModel.CorpID; query.Customer = customerModel; if (!string.IsNullOrEmpty(query.CorpId)) { query.CorpCustomerList = _getCustomerServiceBll.GetCustomerByCorpId(query.CorpId); } query.PolicyReasonList = reasonModels; query.IsFromAduitQuery = _checkAduitOrderServiceBll.CheckAduitCidHasOrderId(request.Cid, request.Rmid ?? 0); QueryFlightModApplyDataModel queryFlightModApplyDataModel = _queryFlightModApplyServiceBll.QueryModApply(query); if (queryFlightModApplyDataModel != null && customerModel.Corporation != null && customerModel.Corporation.AllowShowDataBeginTime.HasValue) { if (customerModel.Corporation.AllowShowDataBeginTime > queryFlightModApplyDataModel.CreateTime) { throw new Exception("查无此改签申请"); } } List <CorpAduitOrderInfoModel> corpAduitOrderInfoModels = _getCorpAduitOrderServiceBll.GetAduitOrderInfoByOrderId(queryFlightModApplyDataModel.Rmid); if (corpAduitOrderInfoModels != null && corpAduitOrderInfoModels.Count > 0) { queryFlightModApplyDataModel.AduitOrderId = corpAduitOrderInfoModels[0].AduitOrderId; queryFlightModApplyDataModel.AduitOrderStatus = corpAduitOrderInfoModels[0].Status; if (!string.IsNullOrEmpty(corpAduitOrderInfoModels[0].NextAduitName)) { queryFlightModApplyDataModel.AuditStatus = string.Format("待{0}审批", corpAduitOrderInfoModels[0].NextAduitName); if (corpAduitOrderInfoModels[0].NextAduitCidList.Contains(request.Cid)) { queryFlightModApplyDataModel.IsCurrentCustomerAduitOrder = true; } } } QueryFlightModApplyResponseViewModel responseViewModel = Mapper .Map <QueryFlightModApplyDataModel, QueryFlightModApplyResponseViewModel>( queryFlightModApplyDataModel); responseViewModel.PolicyReason = (from n in reasonModels select new SortedListViewModel() { Key = n.Id, Value = n.Reason }).ToList(); return(responseViewModel); }
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); }