|
@@ -21,6 +21,28 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
this._mapper = mapper;
|
|
|
}
|
|
|
|
|
|
+ public async Task<Result> HotelConversionAmounts(HotelReservationsCNYDto dto)
|
|
|
+ {
|
|
|
+ Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ try
|
|
|
+ {
|
|
|
+ HotelReservationsView reservationsView=new HotelReservationsView();
|
|
|
+ if ((dto.CardPriceCurrency == dto.GovernmentRentCurrency || dto.GovernmentRent == 0)
|
|
|
+ && (dto.CardPriceCurrency == dto.CityTaxCurrency || dto.CityTax== 0))
|
|
|
+ {
|
|
|
+ reservationsView.CurrencyId = dto.CardPriceCurrency;
|
|
|
+ reservationsView.Price=Convert.ToDecimal((dto.CardPrice+dto.GovernmentRent+dto.CityTax).ToString("F2"));
|
|
|
+ reservationsView.CurrencyName = _sqlSugar.Queryable<Sys_SetData>().First(a => a.Id == dto.CardPriceCurrency).Name;
|
|
|
+ }
|
|
|
+ return result=new Result() { Code = 0, Msg = "查询成功",Data= reservationsView };
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public async Task<Result> HotelReservationsByDiId(HotelReservationsByDiIdDto dto)
|
|
|
{
|
|
|
Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
@@ -48,10 +70,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
string sql = string.Format(@"select h.Id,s1.Name as GuestType,h.ReservationsNo,h.HotelName,h.CheckInDate,
|
|
|
h.CheckOutDate,c.PayMoney,s.Name as PaymentCurrency,u.CnName as CreateUserName,c.IsAuditGM,h.CreateTime,h.Attachment
|
|
|
From Grp_HotelReservations h
|
|
|
- Join Grp_CreditCardPayment c on h.Id=c.CId and c.CTable=76 and c.IsDel=0
|
|
|
- left Join Sys_SetData s on c.PaymentCurrency=s.Id and s.IsDel=0
|
|
|
- left Join Sys_SetData s1 on h.GTId=s1.Id and s1.IsDel=0
|
|
|
- left Join Sys_Users u on u.Id=h.CreateUserId and u.isdel=0 {0}", sqlWhere);
|
|
|
+ Join Grp_CreditCardPayment c on h.Id=c.CId and c.CTable=76 and c.isdel=0
|
|
|
+ left Join Sys_SetData s on c.PaymentCurrency=s.Id
|
|
|
+ left Join Sys_SetData s1 on h.GTId=s1.Id
|
|
|
+ left Join Sys_Users u on u.Id=h.CreateUserId {0} order by c.IsAuditGM,c.PayPercentage desc", sqlWhere);
|
|
|
List<HotelReservationsByDiIdView> hotelDataList = _sqlSugar.SqlQueryable<HotelReservationsByDiIdView>(sql).ToList();
|
|
|
foreach (var item in hotelDataList)
|
|
|
{
|
|
@@ -66,13 +88,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
else if (dto.PortType == 2 || dto.PortType == 3)
|
|
|
{
|
|
|
string sql = string.Format(@"Select * From (
|
|
|
- Select row_number() over (order by h.Id Desc) as RowNumber,h.Id,s1.Name as GuestType,h.ReservationsNo,h.HotelName,h.CheckInDate,
|
|
|
+ Select row_number() over (order by c.IsAuditGM,c.PayPercentage desc) as RowNumber,h.Id,s1.Name as GuestType,h.ReservationsNo,h.HotelName,h.CheckInDate,
|
|
|
h.CheckOutDate,c.PayMoney,s.Name as PaymentCurrency,u.CnName as CreateUserName,c.IsAuditGM,h.CreateTime,h.Attachment
|
|
|
From Grp_HotelReservations h
|
|
|
- Join Grp_CreditCardPayment c on h.Id=c.CId and c.CTable=76 and c.IsDel=0
|
|
|
- left Join Sys_SetData s on c.PaymentCurrency=s.Id and s.IsDel=0
|
|
|
- left Join Sys_SetData s1 on h.GTId=s1.Id and s1.IsDel=0
|
|
|
- left Join Sys_Users u on u.Id=h.CreateUserId and u.isdel=0 {0}
|
|
|
+ Join Grp_CreditCardPayment c on h.Id=c.CId and c.CTable=76 and c.isdel=0
|
|
|
+ left Join Sys_SetData s on c.PaymentCurrency=s.Id
|
|
|
+ left Join Sys_SetData s1 on h.GTId=s1.Id
|
|
|
+ left Join Sys_Users u on u.Id=h.CreateUserId {0}
|
|
|
) temp Where RowNumber Between {1} and {2}", sqlWhere, startIndex, endIndex);
|
|
|
|
|
|
List<HotelReservationsByDiIdView> hotelDataList = _sqlSugar.SqlQueryable<HotelReservationsByDiIdView>(sql).ToList();
|
|
@@ -82,16 +104,15 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
else if (item.IsAuditGM == 1) item.IsAuditGMStr = "已通过";
|
|
|
else if (item.IsAuditGM == 2) item.IsAuditGMStr = "未通过";
|
|
|
else if (item.IsAuditGM == 3) item.IsAuditGMStr = "自动审核";
|
|
|
-
|
|
|
}
|
|
|
string CountSql = string.Format(@"Select COUNT(1) as Count From (
|
|
|
Select h.Id,s1.Name as GuestType,h.ReservationsNo,h.HotelName,h.CheckInDate,
|
|
|
h.CheckOutDate,c.PayMoney,s.Name as PaymentCurrency,u.CnName as CreateUserName,c.IsAuditGM,h.CreateTime,h.Attachment
|
|
|
From Grp_HotelReservations h
|
|
|
- Join Grp_CreditCardPayment c on h.Id=c.CId and c.CTable=76 and c.IsDel=0
|
|
|
- left Join Sys_SetData s on c.PaymentCurrency=s.Id and s.IsDel=0
|
|
|
- left Join Sys_SetData s1 on h.GTId=s1.Id and s1.IsDel=0
|
|
|
- left Join Sys_Users u on u.Id=h.CreateUserId and u.isdel=0 {0}
|
|
|
+ Join Grp_CreditCardPayment c on h.Id=c.CId and c.CTable=76 and c.isdel=0
|
|
|
+ left Join Sys_SetData s on c.PaymentCurrency=s.Id
|
|
|
+ left Join Sys_SetData s1 on h.GTId=s1.Id
|
|
|
+ left Join Sys_Users u on u.Id=h.CreateUserId {0}
|
|
|
) temp", sqlWhere);
|
|
|
DataCount dataCount = _sqlSugar.SqlQueryable<DataCount>(CountSql).First();
|
|
|
|
|
@@ -129,7 +150,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
HotelReservationsByIdView _hotelReservations = _mapper.Map<HotelReservationsByIdView>(hotelReservationsById);
|
|
|
if (_hotelReservations!=null)
|
|
|
{
|
|
|
-
|
|
|
Sys_SetData GTId = _sqlSugar.Queryable<Sys_SetData>().First(a => a.IsDel == 0 && a.Id == hotelReservationsById.GTId);
|
|
|
if (GTId != null) _hotelReservations.GtIdStr = GTId.Name;
|
|
|
|
|
@@ -240,7 +260,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public Task<Result> OpHotelReservations(OpHotelReservationsData dto)
|
|
|
+ public async Task<Result> OpHotelReservations(OpHotelReservationsData dto)
|
|
|
{
|
|
|
throw new NotImplementedException();
|
|
|
}
|