Browse Source

New 酒店预定
Add Or Edit ing....

leiy 1 year ago
parent
commit
84c3775123

+ 5 - 5
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -4494,7 +4494,7 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostHotelReservationsBasicsDataInit(HotelReservationBasicsDataInit _dto)
+        public async Task<IActionResult> PostHotelReservationsBasicsDataInit(HotelReservationBasicsDataInitDto _dto)
         {
             try
             {
@@ -4541,7 +4541,7 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostHotelReservationsDetails(HotelReservationsDetails _dto)
+        public async Task<IActionResult> PostHotelReservationsDetails(HotelReservationsDetailsDto _dto)
         {
             try
             {
@@ -4586,7 +4586,7 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostHotelReservationsAddOrEdit(HotelReservationsDetails _dto)
+        public async Task<IActionResult> PostHotelReservationsAddOrEdit(HotelReservationsAddOrEditDto _dto)
         {
             try
             {
@@ -4609,13 +4609,13 @@ namespace OASystem.API.Controllers
                     if (pageFunAuthView.AddAuth == 0) return Ok(JsonView(false, "您没有添加权限!"));
                 else if (_dto.Id > 0) // Edit
                     if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
-                        else return Ok(JsonView(false, "请输入正确的数据Id!"));
+                else return Ok(JsonView(false, "请输入正确的数据Id!"));
 
                 #endregion
 
                 #endregion
 
-                Result data = await _hotelPriceRep._Details(_dto.PortType, _dto.Id);
+                Result data = await _hotelPriceRep._AddOrEdit(_dto);
                 if (data.Code != 0)
                 {
                     return Ok(JsonView(false, data.Msg));

+ 6 - 0
OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs

@@ -146,6 +146,12 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<OpHotelReservationsData, Grp_HotelReservations>();
             CreateMap<OpHotelReservationsData, Grp_CreditCardPayment>();
             #endregion
+
+            #region 酒店预订-New 2024-01-02 09:32
+            CreateMap<HotelReservationsAddOrEditDto, Grp_HotelReservations>();
+            CreateMap<HotelReservationsAddOrEditDto, Grp_CreditCardPayment>();
+            #endregion
+
             CreateMap<Grp_Customers, CustomersByIdView>();
             CreateMap<Grp_CreditCardPayment, CreditCardView>();
             CreateMap<OpCustomersDto, Grp_Customers>();

+ 214 - 3
OASystem/OASystem.Domain/Dtos/Groups/HotelReservationsDto.cs

@@ -19,7 +19,7 @@ namespace OASystem.Domain.Dtos.Groups
     /// 酒店预定
     /// BasicsData Dto
     /// </summary>
-    public class HotelReservationBasicsDataInit : UserPageFuncDtoBase
+    public class HotelReservationBasicsDataInitDto : UserPageFuncDtoBase
     {
         public int DiId { get; set; }
     }
@@ -28,7 +28,7 @@ namespace OASystem.Domain.Dtos.Groups
     /// 酒店预定
     /// Details Dto
     /// </summary>
-    public class HotelReservationsDetails : UserPageFuncDtoBase
+    public class HotelReservationsDetailsDto : UserPageFuncDtoBase
     {
        public  int DiId { get; set; }
         public int Id { get; set; }
@@ -38,7 +38,7 @@ namespace OASystem.Domain.Dtos.Groups
     /// 酒店预定
     /// Add Or Edit
     /// </summary>
-    public class HotelReservationsAddOrEdit : UserPageFuncDtoBase
+    public class HotelReservationsAddOrEditDto : UserPageFuncDtoBase
     {
         /// <summary>
         /// Id
@@ -50,6 +50,217 @@ namespace OASystem.Domain.Dtos.Groups
         /// 团组Id
         /// </summary>
         public int DiId { get; set; }
+
+        /// <summary>
+        /// 客人类型 Id (设置数据外键编号)
+        /// </summary>
+        public int GTId { get; set; }
+
+        /// <summary>
+        /// 信用卡类型 (设置数据外键编号)
+        /// </summary>
+        public int CardPriceCurrency { get; set; }
+
+        /// <summary>
+        /// 入住卷号
+        /// </summary>
+        public string? CheckNumber { get; set; }
+
+        /// <summary>
+        /// 预订网站(设置数据外键编号)
+        /// </summary>
+        public int ReservationsWebsite { get; set; }
+
+        /// <summary>
+        /// 预订号码
+        /// </summary>
+        public string? ReservationsNo { get; set; }
+
+        /// <summary>
+        /// 城市
+        /// </summary>
+        public string? City { get; set; }
+
+        /// <summary>
+        /// 酒店名称
+        /// </summary>
+        public string? HotelName { get; set; }
+
+        /// <summary>
+        /// 酒店名称
+        /// </summary>
+        public string? HotelTel { get; set; }
+
+        /// <summary>
+        /// 酒店地址
+        /// </summary>
+        public string? HotelAddress { get; set; }
+
+        /// <summary>
+        /// 客户名称
+        /// </summary>
+        public string? GuestName { get; set; }
+
+        /// <summary>
+        /// 入住时间
+        /// </summary>
+        public string? CheckInDate { get; set; }
+
+        /// <summary>
+        /// 离店时间
+        /// </summary>
+        public string? CheckOutDate { get; set; }
+
+        /// <summary>
+        /// 房间入住人类型(设置数据外键编号)
+        /// </summary>
+        public int CheckType { get; set; }
+
+        /// <summary>
+        /// 房间说明
+        /// </summary>
+        public string? RoomExplanation { get; set; }
+
+        /// <summary>
+        /// 酒店备注
+        /// </summary>
+        public string? HotelRemark { get; set; }
+
+        /// <summary>
+        /// 单间价格
+        /// </summary>
+        public decimal SingleRoomPrice { get; set; }
+
+        /// <summary>
+        /// 单间数量
+        /// </summary>
+        public int SingleRoomCount { get; set; }
+
+        /// <summary>
+        /// 双间价格
+        /// </summary>
+        public decimal DoubleRoomPrice { get; set; }
+
+        /// <summary>
+        /// 双间数量
+        /// </summary>
+        public int DoubleRoomCount { get; set; }
+
+        /// <summary>
+        /// 套房价格
+        /// </summary>
+        public decimal SuiteRoomPrice { get; set; }
+
+        /// <summary>
+        /// 套房数量
+        /// </summary>
+        public int SuiteRoomCount { get; set; }
+
+        /// <summary>
+        /// 其他房间价格
+        /// </summary>
+        public decimal OtherRoomPrice { get; set; }
+
+        /// <summary>
+        /// 其他房间数量
+        /// </summary>
+        public int OtherRoomCount { get; set; }
+
+        /// <summary>
+        /// 信用卡金额
+        /// </summary>
+        public decimal CardPrice { get; set; }
+
+        /// <summary>
+        /// 是否由地接支付
+        /// 0 否 1 是
+        /// </summary>
+        public int Isoppay { get; set; }
+
+        /// <summary>
+        /// 早餐价格
+        /// </summary>
+        public decimal BreakfastPrice { get; set; }
+
+        /// <summary>
+        /// 早餐币种 (设置数据外键编号)
+        /// </summary>
+        public int BreakfastCurrency { get; set; }
+
+        /// <summary>
+        /// 地税
+        /// </summary>
+        public decimal GovernmentRent { get; set; }
+
+        /// <summary> 
+        /// 地税币种 (设置数据外键编号)
+        /// </summary>
+        public int GovernmentRentCurrency { get; set; }
+
+        /// <summary>
+        /// 城市税
+        /// </summary>
+        public decimal CityTax { get; set; }
+
+        /// <summary>
+        /// 城市税币种 (设置数据外键编号)
+        /// </summary>
+        public int CityTaxCurrency { get; set; }
+
+        /// <summary>
+        /// 支付方式 (设置数据外键编号)
+        /// </summary>
+        public int PayDId { get; set; }
+
+        /// <summary>
+        /// 消费方式
+        /// </summary>
+        public string? ConsumptionPatterns { get; set; }
+
+        /// <summary>
+        /// 消费日期
+        /// </summary>
+        public string? ConsumptionDate { get; set; }
+
+        /// <summary>
+        /// 付款金额
+        /// </summary>
+        public decimal PayMoney { get; set; }
+
+        /// <summary>
+        /// 付款币种 (设置数据外键编号)
+        /// </summary>
+        public int PaymentCurrency { get; set; }
+
+        /// <summary>
+        /// 对方开户行
+        /// </summary>
+        public string? OtherBankName { get; set; }
+
+        /// <summary>
+        /// 对方银行账号
+        /// </summary>
+        public string? OtherSideNo { get; set; }
+
+        /// <summary>
+        /// 对方姓名
+        /// </summary>
+        public string? OtherSideName { get; set; }
+
+        /// <summary>
+        /// 收款方
+        /// </summary>
+        public string? Payee { get; set; }
+
+        /// <summary>
+        /// 费用标识 (设置数据外键编号)
+        /// </summary>
+        public int OrbitalPrivateTransfer { get; set; }
+
+        /// <summary>
+        /// C表付款信息 备注
+        /// </summary>
+        public string? CcpRemark { get; set; }
     }
 
 

+ 87 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/HotelPriceRepository.cs

@@ -845,5 +845,92 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 return _result;
             }
         }
+
+        /// <summary>
+        /// 酒店预定
+        /// Add Or Edit
+        /// </summary>
+        /// <returns></returns>
+        public async Task<Result> _AddOrEdit(HotelReservationsAddOrEditDto _dto)
+        {
+            int portType = _dto.PortType;
+            if (portType == 1 || portType == 2 || portType == 3)
+            {
+                Grp_HotelReservations _HotelReservations = new Grp_HotelReservations();
+                Grp_CreditCardPayment _CreditCardPayment = new Grp_CreditCardPayment();
+
+                #region 参数处理
+                _HotelReservations = _mapper.Map<Grp_HotelReservations>(_dto);
+                _CreditCardPayment = _mapper.Map<Grp_CreditCardPayment>(_dto);
+                #endregion
+
+                if (_dto.Id == 0) // Add
+                {
+                    _sqlSugar.BeginTran();
+
+                    int hotelId = await _sqlSugar.Insertable<Grp_HotelReservations>(_HotelReservations).ExecuteReturnIdentityAsync();
+                    if (hotelId < 0)
+                    {
+                        _result.Msg = "酒店预定信息添加失败!";
+                        _sqlSugar.RollbackTran(); //回滚
+                        return _result;
+                    }
+                    _CreditCardPayment.CId = hotelId;
+                    _CreditCardPayment.CTable = 76; //酒店预定模块
+
+                    int ccpId = await _sqlSugar.Insertable<Grp_CreditCardPayment>(_CreditCardPayment).ExecuteReturnIdentityAsync();
+                    if (ccpId < 0)
+                    {
+                        _result.Msg = "付款信息添加失败!";
+                        _sqlSugar.RollbackTran(); //回滚
+                        return _result;
+                    }
+                    _result.Msg = "操作成功!";
+                    _sqlSugar.CommitTran(); // 提交
+                }
+                else if (_dto.Id > 0) //Edit
+                {
+                    _sqlSugar.BeginTran();
+
+                    int hotelStatus = await _sqlSugar.Updateable<Grp_HotelReservations>(_HotelReservations)
+                                                     .UpdateColumns(it => new
+                                                     {
+                                                         it.GTId,
+                                                         it.CheckNumber,
+                                                         it.ReservationsWebsite,
+                                                         it.ReservationsNo,
+                                                         it.City,
+                                                         it.HotelName,
+                                                         it.HotelTel,
+                                                         it.HotelAddress,
+                                                         it.GuestName,
+                                                         it.CheckInDate,
+                                                         it.CheckOutDate,
+
+                                                     })
+                                                     .WhereColumns(it => it.Id)
+                                                     .ExecuteCommandAsync();
+
+                    var hotelInfo = await _sqlSugar.Queryable<Grp_HotelReservations>().FirstAsync();
+
+
+
+                    _sqlSugar.CommitTran();
+                    _sqlSugar.RollbackTran();
+                }
+                else if (_dto.Id < 0) //不正确的Id
+                {
+                    _result.Msg = "请输入正确的数据Id!";
+                }
+
+
+            }
+            else
+            {
+                _result.Msg = "请传入正确的PortType参数,1 Web 2 Android 3 IOS";
+            }
+
+            return _result;
+        }
     }
 }