|
@@ -304,10 +304,23 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
it.CreateUserId = _dto.UserId;
|
|
|
it.DiId = _dto.DiId;
|
|
|
it.IsPay = 0;
|
|
|
+ it.HrId = _HotelReservations.Id;
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(it.ConsumptionDate))
|
|
|
+ {
|
|
|
+ if (DateTime.TryParse(it.ConsumptionDate, out DateTime dt))
|
|
|
+ {
|
|
|
+ it.ConsumptionDate = dt.ToString("yyyy-MM-dd");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//var currCode = currData.Find(x => x.Id == it.Currency)?.Name;
|
|
|
//decimal? currRate = teamRateDescViews.Find(x => x.CurrencyCode == currCode)?.Rate;
|
|
|
//it.Rate = currRate ?? 0.00M;
|
|
|
});
|
|
|
+ _HotelReservationsContents = _HotelReservationsContents.OrderBy(x => x.PriceType).ToList();
|
|
|
+
|
|
|
|
|
|
if (portType == 2 || portType == 3)
|
|
|
{
|
|
@@ -443,18 +456,33 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
return _view;
|
|
|
}
|
|
|
|
|
|
- int hotelSubStatus = await _sqlSugar.Updateable<Grp_HotelReservationsContent>(_HotelReservationsContents)
|
|
|
+ var hotelSubStatus = false;
|
|
|
+ var addHotelSubData = _HotelReservationsContents.Where(it => it.Id == 0).ToList();
|
|
|
+ var updateHotelSubData = _HotelReservationsContents.Where(it => it.Id != 0).ToList();
|
|
|
+
|
|
|
+ if (addHotelSubData.Count > 0)
|
|
|
+ {
|
|
|
+ int hotelSubAdd = await _sqlSugar.Insertable<Grp_HotelReservationsContent>(addHotelSubData).ExecuteCommandAsync();
|
|
|
+ if (hotelSubAdd > 0) hotelSubStatus = true;
|
|
|
+
|
|
|
+ }
|
|
|
+ if (updateHotelSubData.Count > 0)
|
|
|
+ {
|
|
|
+ int hotelSubUpdate = await _sqlSugar.Updateable<Grp_HotelReservationsContent>(updateHotelSubData)
|
|
|
.IgnoreColumns(it => new {
|
|
|
- it.DiId,
|
|
|
- it.HrId,
|
|
|
- it.CreateUserId,
|
|
|
- it.CreateTime,
|
|
|
- it.DeleteUserId,
|
|
|
- it.DeleteTime
|
|
|
+ it.DiId,
|
|
|
+ it.HrId,
|
|
|
+ it.CreateUserId,
|
|
|
+ it.CreateTime,
|
|
|
+ it.DeleteUserId,
|
|
|
+ it.DeleteTime
|
|
|
})
|
|
|
.WhereColumns(it => it.Id)
|
|
|
.ExecuteCommandAsync();
|
|
|
- if (hotelSubStatus < 1)
|
|
|
+ if (hotelSubUpdate > 0) hotelSubStatus = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!hotelSubStatus)
|
|
|
{
|
|
|
_view.Msg = "酒店预定子表信息修改失败!";
|
|
|
_sqlSugar.RollbackTran(); //回滚
|