|
@@ -10,6 +10,7 @@ using OASystem.Domain.ViewModels.Financial;
|
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
|
using OASystem.Infrastructure.Tools;
|
|
|
using SqlSugar;
|
|
|
+using StackExchange.Redis;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
@@ -744,93 +745,104 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// </summary>
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<Result> _BasicsDataInit(HotelReservationBasicsDataInit dto)
|
|
|
+ public async Task<Result> _BasicsDataInit(int portType, int diId)
|
|
|
{
|
|
|
- try
|
|
|
- {
|
|
|
- if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- _result.Msg = "请传入正确的PortType参数,1 Web 2 Android 3 IOS";
|
|
|
- }
|
|
|
-
|
|
|
- List<Sys_SetData> _dataSouruce = await _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0).ToListAsync();
|
|
|
-
|
|
|
+ List<Sys_SetData> _dataSouruce = await _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0).ToListAsync();
|
|
|
|
|
|
+ if (portType == 1 || portType == 2 || portType == 3)
|
|
|
+ {
|
|
|
//客人类型
|
|
|
- List<Sys_SetData> GuestType = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0 && a.STid == 11).ToList();
|
|
|
+ List<Sys_SetData> GuestType = _dataSouruce.Where(a => a.STid == 11).ToList();
|
|
|
List<SetDataInfoView> _GuestType = _mapper.Map<List<SetDataInfoView>>(GuestType);
|
|
|
|
|
|
+ //预订网站
|
|
|
+ List<Sys_SetData> BookingWebsite = _dataSouruce.Where(a => a.STid == 12).ToList();
|
|
|
+ List<SetDataInfoView> _BookingWebsite = _mapper.Map<List<SetDataInfoView>>(BookingWebsite);
|
|
|
+
|
|
|
//支付方式
|
|
|
- List<Sys_SetData> Payment = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 14 && a.IsDel == 0).ToList();
|
|
|
+ List<Sys_SetData> Payment = _dataSouruce.Where(a => a.STid == 14).ToList();
|
|
|
List<SetDataInfoView> _Payment = _mapper.Map<List<SetDataInfoView>>(Payment);
|
|
|
|
|
|
- //币种
|
|
|
- List<Sys_SetData> CurrencyList = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 66 && a.IsDel == 0).ToList();
|
|
|
- List<SetDataInfoView> _CurrencyList = _mapper.Map<List<SetDataInfoView>>(CurrencyList);
|
|
|
-
|
|
|
//卡类型
|
|
|
- List<Sys_SetData> BankCard = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 15 && a.IsDel == 0).ToList();
|
|
|
+ List<Sys_SetData> BankCard = _dataSouruce.Where(a => a.STid == 15).ToList();
|
|
|
List<SetDataInfoView> _BankCard = _mapper.Map<List<SetDataInfoView>>(BankCard);
|
|
|
|
|
|
- //预订网站
|
|
|
- List<Sys_SetData> BookingWebsite = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 12 && a.IsDel == 0).ToList();
|
|
|
- List<SetDataInfoView> _BookingWebsite = _mapper.Map<List<SetDataInfoView>>(BookingWebsite);
|
|
|
|
|
|
- if (dto.PortType == 2 || dto.PortType == 3)
|
|
|
+ GeneralTeamRateInfoDto postGroupTeamRatedto = new GeneralTeamRateInfoDto()
|
|
|
{
|
|
|
- GeneralTeamRateInfoDto PostGroupTeamRatedto = new GeneralTeamRateInfoDto();
|
|
|
- PostGroupTeamRatedto.DiId = dto.DiId;
|
|
|
- PostGroupTeamRatedto.CTable = 76;
|
|
|
- PostGroupTeamRatedto.PortType = dto.PortType;
|
|
|
- Result teamRateDescAddCurrencyIdViews = PostGroupTeamRateByDiIdAndCTableId(PostGroupTeamRatedto);
|
|
|
- List<TeamRateDescAddCurrencyIdView> Currency = new List<TeamRateDescAddCurrencyIdView>();
|
|
|
- if (teamRateDescAddCurrencyIdViews.Code == 0)
|
|
|
- {
|
|
|
- Currency = teamRateDescAddCurrencyIdViews.Data;
|
|
|
- }
|
|
|
- var data = new
|
|
|
- {
|
|
|
- GuestType = _GuestType,
|
|
|
- Payment = _Payment,
|
|
|
- CurrencyList = Currency,
|
|
|
- BankCard = _BankCard,
|
|
|
- BookingWebsite = _BookingWebsite,
|
|
|
- };
|
|
|
-
|
|
|
- _result.Code = 0;
|
|
|
- _result.Data = data;
|
|
|
- _result.Msg = "操作成功!";
|
|
|
- return _result ;
|
|
|
+ DiId = diId,
|
|
|
+ CTable = 76, //酒店预定
|
|
|
+ PortType = portType
|
|
|
+ };
|
|
|
+ Result teamRateDescAddCurrencyIdViews = PostGroupTeamRateByDiIdAndCTableId(postGroupTeamRatedto);
|
|
|
+ List<TeamRateDescAddCurrencyIdView> TeamCurrencyRate = new List<TeamRateDescAddCurrencyIdView>();
|
|
|
+ if (teamRateDescAddCurrencyIdViews.Code == 0)
|
|
|
+ {
|
|
|
+ TeamCurrencyRate = teamRateDescAddCurrencyIdViews.Data;
|
|
|
}
|
|
|
- else
|
|
|
+ var data = new
|
|
|
{
|
|
|
- var data = new
|
|
|
- {
|
|
|
- GuestType = _GuestType,
|
|
|
- Payment = _Payment,
|
|
|
- CurrencyList = _CurrencyList,
|
|
|
- BankCard = _BankCard,
|
|
|
- BookingWebsite = _BookingWebsite,
|
|
|
- };
|
|
|
+ GuestType = _GuestType,
|
|
|
+ Payment = _Payment,
|
|
|
+ CurrencyList = TeamCurrencyRate,
|
|
|
+ BankCard = _BankCard,
|
|
|
+ BookingWebsite = _BookingWebsite,
|
|
|
+ };
|
|
|
|
|
|
+ _result.Code = 0;
|
|
|
+ _result.Data = data;
|
|
|
+ _result.Msg = "操作成功!";
|
|
|
|
|
|
- _result.Code = 0;
|
|
|
- _result.Data = data;
|
|
|
- _result.Msg = "操作成功!";
|
|
|
- return _result;
|
|
|
- }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _result.Msg = "请传入正确的PortType参数,1 Web 2 Android 3 IOS!";
|
|
|
+
|
|
|
+ }
|
|
|
+ return _result;
|
|
|
+ }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 酒店预定
|
|
|
+ /// details
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<Result> _Details(int portType, int id)
|
|
|
+ {
|
|
|
|
|
|
+ if (id < 0 )
|
|
|
+ {
|
|
|
+ _result.Msg = string.Format(@"请输入正确的Id!");
|
|
|
+ return _result;
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
+
|
|
|
+ string sql = string.Format(@"Select hr.Id,hr.DiId,hr.GTId,hr.CardPriceCurrency,hr.CheckNumber,hr.ReservationsWebsite,hr.ReservationsNo,
|
|
|
+ hr.City,hr.HotelName,hr.HotelTel,hr.HotelAddress,hr.GuestName,hr.CheckInDate,hr.CheckOutDate,hr.CheckType,
|
|
|
+ hr.RoomExplanation,hr.Remark As HotelRemark,hr.SingleRoomPrice,hr.SingleRoomCount,hr.DoubleRoomPrice,
|
|
|
+ hr.DoubleRoomCount,hr.SuiteRoomPrice,hr.SuiteRoomCount,hr.OtherRoomPrice,hr.OtherRoomCount,hr.CardPrice,
|
|
|
+ hr.BreakfastPrice,hr.BreakfastCurrency,hr.GovernmentRent,hr.GovernmentRentCurrency,hr.CityTax,hr.CityTaxCurrency,
|
|
|
+ ccp.PayDId,ccp.ConsumptionPatterns,ccp.ConsumptionDate,ccp.PayMoney,ccp.PaymentCurrency,ccp.OtherBankName,
|
|
|
+ ccp.OtherSideNo,ccp.OtherSideName,ccp.Payee,ccp.OrbitalPrivateTransfer,ccp.Remark As CcpRemark
|
|
|
+ From Grp_HotelReservations hr
|
|
|
+ Inner Join Grp_CreditCardPayment ccp On hr.DiId = ccp.DIId And hr.Id = ccp.CId And ccp.CTable = 76
|
|
|
+ Where hr.IsDel = 0 And ccp.IsDel = 0 And hr.Id = {0}",id);
|
|
|
+
|
|
|
+ if (portType == 1 || portType == 2 || portType == 3)
|
|
|
+ {
|
|
|
+ var info = await _sqlSugar.SqlQueryable<HotelReservationsDetailsView>(sql).FirstAsync();
|
|
|
+ if (info != null) _result.Msg = "操作成功!";
|
|
|
+ else _result.Msg = "暂无数据";
|
|
|
+
|
|
|
+ _result.Code = 0;
|
|
|
+ _result.Data = info;
|
|
|
+ return _result;
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- return _result ;
|
|
|
+ _result.Msg = "请传入正确的PortType参数,1 Web 2 Android 3 IOS";
|
|
|
+ return _result;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|