Browse Source

酒店预订 PostHotelReservationsAddOrEdit
添加酒店预定信息时添加酒店基础信息

leiy 11 months ago
parent
commit
2488bf9456

+ 173 - 163
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -217,42 +217,45 @@ namespace OASystem.API.Controllers
 
                 List<Gsd_ExtraCostsView> _ExtraCostsViews = await _sqlSugar.SqlQueryable<Gsd_ExtraCostsView>(_ecSql).ToListAsync();
 
-                //模拟数据
-                if (_ExtraCostsViews.Count < 1)
-                {
-                    _ExtraCostsViews.Add(new Gsd_ExtraCostsView()
-                    {
-                        GECId = 0,
-                        GECDiId = 2334,
-                        PriceName = "模拟数据-超支费用名称",
-                        PayMoney = 1000.00M,
-                        PaymentCurrency = "CNY",
-                        DayRate = 1.0000M,
-                        CNYPrice = 1000.00M,
-                        Payee = "模拟数据-超支费用收款方",
-                        OrbitalPrivateTransfer = 1,
-                        PayWay = "刷卡",
-                        CardType = "招行卡",
-                        IsPay = 1,
-                        Applicant = "刘华举"
-                    });
-                    _ExtraCostsViews.Add(new Gsd_ExtraCostsView()
-                    {
-                        GECId = 0,
-                        GECDiId = 2334,
-                        PriceName = "模拟数据-超支费用名称",
-                        PayMoney = 1000.00M,
-                        PaymentCurrency = "CNY",
-                        DayRate = 1.0000M,
-                        CNYPrice = 1000.00M,
-                        Payee = "模拟数据-超支费用收款方",
-                        OrbitalPrivateTransfer = 1,
-                        PayWay = "刷卡",
-                        CardType = "招行卡",
-                        IsPay = 1,
-                        Applicant = "刘华举"
-                    });
-                }
+                #region 模拟数据
+
+                //if (_ExtraCostsViews.Count < 1)
+                //{
+                //    _ExtraCostsViews.Add(new Gsd_ExtraCostsView()
+                //    {
+                //        GECId = 0,
+                //        GECDiId = 2334,
+                //        PriceName = "模拟数据-超支费用名称",
+                //        PayMoney = 1000.00M,
+                //        PaymentCurrency = "CNY",
+                //        DayRate = 1.0000M,
+                //        CNYPrice = 1000.00M,
+                //        Payee = "模拟数据-超支费用收款方",
+                //        OrbitalPrivateTransfer = 1,
+                //        PayWay = "刷卡",
+                //        CardType = "招行卡",
+                //        IsPay = 1,
+                //        Applicant = "刘华举"
+                //    });
+                //    _ExtraCostsViews.Add(new Gsd_ExtraCostsView()
+                //    {
+                //        GECId = 0,
+                //        GECDiId = 2334,
+                //        PriceName = "模拟数据-超支费用名称",
+                //        PayMoney = 1000.00M,
+                //        PaymentCurrency = "CNY",
+                //        DayRate = 1.0000M,
+                //        CNYPrice = 1000.00M,
+                //        Payee = "模拟数据-超支费用收款方",
+                //        OrbitalPrivateTransfer = 1,
+                //        PayWay = "刷卡",
+                //        CardType = "招行卡",
+                //        IsPay = 1,
+                //        Applicant = "刘华举"
+                //    });
+                //}
+                #endregion
+
 
                 exTotalAmount = _ExtraCostsViews.Sum(it => it.CNYPrice);
 
@@ -323,43 +326,46 @@ namespace OASystem.API.Controllers
                     _promView.Add(gsd_PaymentRefund);
                 }
 
-                //模拟数据
-                if (_promView.Count < 1)
-                {
-                    _promView.Add(new Gsd_PaymentRefundAndOtherMoneyView() {
-                        Id = 0,
-                        DiId = 2334,
-                        PriceName = "模拟数据-费用名称",
-                        PayCurrencyCode ="CNY",
-                        PayCurrencyName = "人名币",
-                        Price = 1000.00M,
-                        CNYPrice = 1000.00M,
-                        ThisRate = 1.00M,
-                        Payee="模拟数据-收款方",
-                        PayTime = "2023-01-01 15:20:01",
-                        OrbitalPrivateTransfer = 1,
-                        PayType = "刷卡",
-                        IsPay = 1,
-                        Applicant = "刘华举"
-                    });
-                    _promView.Add(new Gsd_PaymentRefundAndOtherMoneyView()
-                    {
-                        Id = 0,
-                        DiId = 2334,
-                        PriceName = "模拟数据-费用名称",
-                        PayCurrencyCode = "CNY",
-                        PayCurrencyName = "人名币",
-                        Price = 1000.00M,
-                        CNYPrice = 1000.00M,
-                        ThisRate = 1.00M,
-                        Payee = "模拟数据-收款方",
-                        PayTime = "2023-01-01 15:20:01",
-                        OrbitalPrivateTransfer = 1,
-                        PayType = "刷卡",
-                        IsPay = 1,
-                        Applicant = "刘华举"
-                    });
-                }
+                #region 模拟数据
+
+                //if (_promView.Count < 1)
+                //{
+                //    _promView.Add(new Gsd_PaymentRefundAndOtherMoneyView()
+                //    {
+                //        Id = 0,
+                //        DiId = 2334,
+                //        PriceName = "模拟数据-费用名称",
+                //        PayCurrencyCode = "CNY",
+                //        PayCurrencyName = "人名币",
+                //        Price = 1000.00M,
+                //        CNYPrice = 1000.00M,
+                //        ThisRate = 1.00M,
+                //        Payee = "模拟数据-收款方",
+                //        PayTime = "2023-01-01 15:20:01",
+                //        OrbitalPrivateTransfer = 1,
+                //        PayType = "刷卡",
+                //        IsPay = 1,
+                //        Applicant = "刘华举"
+                //    });
+                //    _promView.Add(new Gsd_PaymentRefundAndOtherMoneyView()
+                //    {
+                //        Id = 0,
+                //        DiId = 2334,
+                //        PriceName = "模拟数据-费用名称",
+                //        PayCurrencyCode = "CNY",
+                //        PayCurrencyName = "人名币",
+                //        Price = 1000.00M,
+                //        CNYPrice = 1000.00M,
+                //        ThisRate = 1.00M,
+                //        Payee = "模拟数据-收款方",
+                //        PayTime = "2023-01-01 15:20:01",
+                //        OrbitalPrivateTransfer = 1,
+                //        PayType = "刷卡",
+                //        IsPay = 1,
+                //        Applicant = "刘华举"
+                //    });
+                //}
+                #endregion
 
                 promTotalAmount = _promView.Sum(it => it.CNYPrice);
                 _giView.PaymentRefundAndOtherMoneyViews = _promView;
@@ -736,60 +742,61 @@ namespace OASystem.API.Controllers
 
                 groupInvitationalFeeViews = await _sqlSugar.SqlQueryable<GroupInvitationalFeeView>(groupInvitationalFeeSql).ToListAsync();
 
-                //模拟数据
-                if (groupInvitationalFeeViews.Count < 1)
-                {
-                    groupInvitationalFeeViews.Add(new GroupInvitationalFeeView()
-                    {
-                        IOAId = 0,
-                        IOADiId = 2334,
-                        InviterArea = "模拟数据-邀请方地区",
-                        Inviter = "模拟数据-邀请方",
-                        InviteTime = "2023-10-10",
-                        InviteCost = 100.00M,
-                        InviteCurrency = "EUR",
-                        SendCost = 100.00M,
-                        SendCurrency = "EUR",
-                        EventsCost = 10000.00M,
-                        EventsCurrency = "EUR",
-                        TranslateCost = 300.00M,
-                        TranslateCurrency = "EUR",
-                        PayMoney = 10500.00M,
-                        PaymentCurrency = "EUR",
-                        CNYPrice = 76765.50M,
-                        Payee = "模拟数据-收款方",
-                        AuditGMDate = "2023-12-05",
-                        OrbitalPrivateTransfer = 1,
-                        PayWay = "刷卡",
-                        IsPay = 1,
-                        Applicant = "刘华举"
-                    });
-                    groupInvitationalFeeViews.Add(new GroupInvitationalFeeView()
-                    {
-                        IOAId = 0,
-                        IOADiId = 2334,
-                        InviterArea = "模拟数据-邀请方地区",
-                        Inviter = "模拟数据-邀请方",
-                        InviteTime = "2023-10-10",
-                        InviteCost = 100.00M,
-                        InviteCurrency = "EUR",
-                        SendCost = 100.00M,
-                        SendCurrency = "EUR",
-                        EventsCost = 10000.00M,
-                        EventsCurrency = "EUR",
-                        TranslateCost = 300.00M,
-                        TranslateCurrency = "EUR",
-                        PayMoney = 10500.00M,
-                        PaymentCurrency = "EUR",
-                        CNYPrice = 76765.50M,
-                        Payee = "模拟数据-收款方",
-                        AuditGMDate = "2023-12-05",
-                        OrbitalPrivateTransfer = 1,
-                        PayWay = "刷卡",
-                        IsPay = 1,
-                        Applicant = "刘华举"
-                    });
-                }
+                #region 模拟数据
+                //if (groupInvitationalFeeViews.Count < 1)
+                //{
+                //    groupInvitationalFeeViews.Add(new GroupInvitationalFeeView()
+                //    {
+                //        IOAId = 0,
+                //        IOADiId = 2334,
+                //        InviterArea = "模拟数据-邀请方地区",
+                //        Inviter = "模拟数据-邀请方",
+                //        InviteTime = "2023-10-10",
+                //        InviteCost = 100.00M,
+                //        InviteCurrency = "EUR",
+                //        SendCost = 100.00M,
+                //        SendCurrency = "EUR",
+                //        EventsCost = 10000.00M,
+                //        EventsCurrency = "EUR",
+                //        TranslateCost = 300.00M,
+                //        TranslateCurrency = "EUR",
+                //        PayMoney = 10500.00M,
+                //        PaymentCurrency = "EUR",
+                //        CNYPrice = 76765.50M,
+                //        Payee = "模拟数据-收款方",
+                //        AuditGMDate = "2023-12-05",
+                //        OrbitalPrivateTransfer = 1,
+                //        PayWay = "刷卡",
+                //        IsPay = 1,
+                //        Applicant = "刘华举"
+                //    });
+                //    groupInvitationalFeeViews.Add(new GroupInvitationalFeeView()
+                //    {
+                //        IOAId = 0,
+                //        IOADiId = 2334,
+                //        InviterArea = "模拟数据-邀请方地区",
+                //        Inviter = "模拟数据-邀请方",
+                //        InviteTime = "2023-10-10",
+                //        InviteCost = 100.00M,
+                //        InviteCurrency = "EUR",
+                //        SendCost = 100.00M,
+                //        SendCurrency = "EUR",
+                //        EventsCost = 10000.00M,
+                //        EventsCurrency = "EUR",
+                //        TranslateCost = 300.00M,
+                //        TranslateCurrency = "EUR",
+                //        PayMoney = 10500.00M,
+                //        PaymentCurrency = "EUR",
+                //        CNYPrice = 76765.50M,
+                //        Payee = "模拟数据-收款方",
+                //        AuditGMDate = "2023-12-05",
+                //        OrbitalPrivateTransfer = 1,
+                //        PayWay = "刷卡",
+                //        IsPay = 1,
+                //        Applicant = "刘华举"
+                //    });
+                //}
+                #endregion
 
                 decimal InvitationalCNYTotalPrice = 0.00M;
 
@@ -907,42 +914,45 @@ namespace OASystem.API.Controllers
                                                              Where dp.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And dp.Diid = {0}",_dto.DiId);
                 groupDecreaseFeeViews = await _sqlSugar.SqlQueryable<GroupDecreaseFeeView>(groupDecreaseFeeSql).ToListAsync();
 
-                //模拟数据
-                if (groupDecreaseFeeViews.Count < 1)
-                {
-                    groupDecreaseFeeViews.Add(new GroupDecreaseFeeView()
-                    {
-                        DPId = 0,
-                        DPDiId = 2334,
-                        PriceName = "模拟数据-费用名称",
-                        PayMoney = 1000.00M,
-                        PayMoneyCurrency = "CNY",
-                        DayRate = 1.0000M,
-                        CNYPrice = 1.0000M,
-                        AuditGMDate = "2023-12-10 12:13:00",
-                        Payee = "模拟数据-付款方",
-                        OrbitalPrivateTransfer = 1,
-                        PayWay = "现金",
-                        IsPay = 1,
-                        Applicant = "刘华举"
-                    });
-                    groupDecreaseFeeViews.Add(new GroupDecreaseFeeView()
-                    {
-                        DPId = 0,
-                        DPDiId = 2334,
-                        PriceName = "模拟数据-费用名称",
-                        PayMoney = 1000.00M,
-                        PayMoneyCurrency = "CNY",
-                        DayRate = 1.0000M,
-                        CNYPrice = 1.0000M,
-                        AuditGMDate = "2023-12-10 12:13:00",
-                        Payee = "模拟数据-付款方",
-                        OrbitalPrivateTransfer = 1,
-                        PayWay = "现金",
-                        IsPay = 1,
-                        Applicant = "刘华举"
-                    });
-                }
+                #region 模拟数据
+
+                //if (groupDecreaseFeeViews.Count < 1)
+                //{
+                //    groupDecreaseFeeViews.Add(new GroupDecreaseFeeView()
+                //    {
+                //        DPId = 0,
+                //        DPDiId = 2334,
+                //        PriceName = "模拟数据-费用名称",
+                //        PayMoney = 1000.00M,
+                //        PayMoneyCurrency = "CNY",
+                //        DayRate = 1.0000M,
+                //        CNYPrice = 1.0000M,
+                //        AuditGMDate = "2023-12-10 12:13:00",
+                //        Payee = "模拟数据-付款方",
+                //        OrbitalPrivateTransfer = 1,
+                //        PayWay = "现金",
+                //        IsPay = 1,
+                //        Applicant = "刘华举"
+                //    });
+                //    groupDecreaseFeeViews.Add(new GroupDecreaseFeeView()
+                //    {
+                //        DPId = 0,
+                //        DPDiId = 2334,
+                //        PriceName = "模拟数据-费用名称",
+                //        PayMoney = 1000.00M,
+                //        PayMoneyCurrency = "CNY",
+                //        DayRate = 1.0000M,
+                //        CNYPrice = 1.0000M,
+                //        AuditGMDate = "2023-12-10 12:13:00",
+                //        Payee = "模拟数据-付款方",
+                //        OrbitalPrivateTransfer = 1,
+                //        PayWay = "现金",
+                //        IsPay = 1,
+                //        Applicant = "刘华举"
+                //    });
+                //}
+
+                #endregion
 
                 decimal DecreaseCNYTotalPrice = 0.00M;
                 foreach (var item in groupDecreaseFeeViews)

+ 5 - 2
OASystem/OASystem.Api/Program.cs

@@ -25,6 +25,7 @@ using Microsoft.Extensions.DependencyInjection.Extensions;
 using OASystem.API.OAMethodLib.SignalR.HubService;
 using OASystem.API.OAMethodLib.Auth;
 using OASystem.API.OAMethodLib.Hub.HubClients;
+using Microsoft.Extensions.Options;
 
     var builder = WebApplication.CreateBuilder(args);
 var basePath = AppContext.BaseDirectory;
@@ -328,8 +329,6 @@ builder.Services.AddSingleton<IJobFactory, IOCJobFactory>();
 
 #endregion
 
-
-
 #region SignalR
 builder.Services.AddSignalR()
                 .AddJsonProtocol(options =>
@@ -372,6 +371,10 @@ if (AppSettingsHelper.Get("UseSwagger").ToBool())
         c.RoutePrefix = string.Empty;
         c.DocExpansion(Swashbuckle.AspNetCore.SwaggerUI.DocExpansion.None);
         c.DefaultModelsExpandDepth(-1);
+
+        // Ìí¼ÓËÑË÷¹¦ÄÜ
+        c.EnableFilter();
+        c.EnableDeepLinking();
     });
 }
 #endregion

+ 21 - 3
OASystem/OASystem.Infrastructure/Repositories/Groups/HotelPriceRepository.cs

@@ -1,13 +1,16 @@
 using AutoMapper;
 using MathNet.Numerics.Statistics.Mcmc;
 using MySqlX.XDevAPI.Common;
+using NPOI.SS.Formula.Functions;
 using OASystem.Domain;
 using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Dtos.Resource;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Financial;
 using OASystem.Domain.ViewModels.Groups;
+using OASystem.Infrastructure.Repositories.Resource;
 using OASystem.Infrastructure.Tools;
 using SqlSugar;
 using StackExchange.Redis;
@@ -16,6 +19,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using static NPOI.HSSF.Util.HSSFColor;
 using Result = OASystem.Domain.Result;
 
 namespace OASystem.Infrastructure.Repositories.Groups
@@ -26,13 +30,15 @@ namespace OASystem.Infrastructure.Repositories.Groups
         private readonly Result _result;
         private readonly TeamRateRepository _teamRateRep;
         private readonly TourClientListRepository _tourClientListRep;
-        public HotelPriceRepository(SqlSugarClient sqlSugar, IMapper mapper, TeamRateRepository teamRateRep, TourClientListRepository tourClientListRep) 
+        private readonly HotelDataRepository _hotelDataRep;
+        public HotelPriceRepository(SqlSugarClient sqlSugar, IMapper mapper, TeamRateRepository teamRateRep, TourClientListRepository tourClientListRep, HotelDataRepository hotelDataRep) 
             :base(sqlSugar)
         {
             this._mapper = mapper;
             _result = new Result() { Code = -1, Msg = "操作失败!" };
             _teamRateRep = teamRateRep;
             _tourClientListRep = tourClientListRep;
+            _hotelDataRep = hotelDataRep;
         }
 
         #region 保留
@@ -800,8 +806,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 _HotelReservations = _mapper.Map<Grp_HotelReservations>(_dto);
                 _CreditCardPayment = _mapper.Map<Grp_CreditCardPayment>(_dto);
 
-                
-
                 _HotelReservations.DiId = _dto.DiId;
                 _HotelReservations.CardPriceCurrency = _dto.CTDId;
                 _HotelReservations.CreateUserId = _dto.UserId;
@@ -918,6 +922,20 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         _sqlSugar.RollbackTran(); //回滚
                         return _result;
                     }
+
+                    #region 酒店基础数据 添加
+
+                    var hotelDataReq = new OperationHotelDto() {
+                        Status = 1,
+                        City = _dto.City,
+                        Name = _dto.HotelName,
+                        Tel = _dto.HotelTel,
+                        Address = _dto.HotelAddress
+                    };
+                     await _hotelDataRep.OperationHotelData(hotelDataReq);
+
+                    #endregion
+
                     _result.Msg = "操作成功!";
                     _result.Code = 0;
                     _sqlSugar.CommitTran(); // 提交