Browse Source

酒店字段修改

wangh 1 year ago
parent
commit
3db88fff71

+ 30 - 2
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -56,6 +56,7 @@ namespace OASystem.API.Controllers
         private readonly VisaPriceRepository _visaPriceRep;
         private readonly CarTouristGuideGroundRepository _carTouristGuideGroundRep;
         private readonly HotelPriceRepository _hotelPriceRep;
+        private readonly CustomersRepository _customersRep;
         private readonly MessageRepository _message;
         private readonly SqlSugarClient _sqlSugar;
         #region 成本相关
@@ -73,7 +74,7 @@ namespace OASystem.API.Controllers
             TaskAssignmentRepository taskAssignmentRep, AirTicketResRepository airTicketResRep, DecreasePaymentsRepository decreasePaymentsRep,
             InvitationOfficialActivitiesRepository InvitationOfficialActivitiesRep, DelegationEnDataRepository delegationEnDataRep, EnterExitCostRepository enterExitCostRep
             , DelegationVisaRepository delegationVisaRep, MessageRepository message, VisaPriceRepository visaPriceRep, CarTouristGuideGroundRepository carTouristGuideGroundRep, CheckBoxsRepository checkBoxs, GroupCostRepository GroupCostRepository, CostTypeHotelNumberRepository CostTypeHotelNumberRepository,
-            GroupCostParameterRepository GroupCostParameterRepository, HotelPriceRepository hotelPriceRep)
+            GroupCostParameterRepository GroupCostParameterRepository, HotelPriceRepository hotelPriceRep, CustomersRepository customersRep)
         {
             _mapper = mapper;
             _grpScheduleRep = grpScheduleRep;
@@ -100,6 +101,7 @@ namespace OASystem.API.Controllers
             _CostTypeHotelNumberRepository = CostTypeHotelNumberRepository;
             _GroupCostParameterRepository = GroupCostParameterRepository;
             _hotelPriceRep = hotelPriceRep;
+            _customersRep=customersRep;
         }
 
 
@@ -4090,7 +4092,33 @@ namespace OASystem.API.Controllers
 
         }
 
-        
+
+        #endregion
+
+        #region 保险费用录入
+        /// <summary>
+        /// 根据团组Id查询费用列表
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> CustomersByDiId(CustomersByDiIdDto dto)
+        {
+            try
+            {
+                Result groupData = await _customersRep.CustomersByDiId(dto);
+                if (groupData.Code != 0)
+                {
+                    return Ok(JsonView(false, groupData.Msg));
+                }
+                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, ex.Message));
+            }
+        }
         #endregion
     }
 }

+ 13 - 0
OASystem/OASystem.Domain/Dtos/Groups/CustomersDto.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Groups
+{
+    public class CustomersByDiIdDto : DtoBase
+    {
+        public int DiId { get; set; }
+    }
+}

+ 5 - 0
OASystem/OASystem.Domain/Dtos/Groups/HotelReservationsDto.cs

@@ -135,6 +135,11 @@ namespace OASystem.Domain.Dtos.Groups
         /// 附件地址
         /// </summary>
         public string Attachment { get; set; }
+       
+        /// <summary>
+        /// 信用卡刷卡类型
+        /// </summary>
+        public int CardPriceCurrency { get; set; }
         /// <summary>
         /// 信用卡金额
         /// </summary>

+ 6 - 5
OASystem/OASystem.Domain/Entities/Groups/Grp_Customers.cs

@@ -17,6 +17,11 @@ namespace OASystem.Domain.Entities.Groups
         /// </summary>
         [SugarColumn(IsNullable =true, ColumnDataType="int")]
         public int DiId{get; set;}
+        /// <summary>
+        /// 保险名称
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Iid { get; set; }
 
         /// <summary>
         /// 客户名称
@@ -41,11 +46,7 @@ namespace OASystem.Domain.Entities.Groups
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]
         public string Attachment { get; set; }
-        /// <summary>
-        /// 保险名称
-        /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
-        public int Iid { get; set; }
+        
 
     }
 }

+ 5 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_HotelReservations.cs

@@ -163,6 +163,11 @@ namespace OASystem.Domain.Entities.Groups
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(18,2)")]
         public decimal CardPrice { get; set; }
         /// <summary>
+        /// 信用卡刷卡类型
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int CardPriceCurrency { get; set; }
+        /// <summary>
         /// 确认标识   信用卡金额
         /// 0:未刷(红色)  1:已刷(绿色)
         /// </summary>

+ 4 - 0
OASystem/OASystem.Domain/ViewModels/Groups/HotelReservationsByDiIdView.cs

@@ -181,6 +181,10 @@ namespace OASystem.Domain.ViewModels.Groups
         /// </summary>
         public decimal CardPrice { get; set; }
         /// <summary>
+        /// 信用卡币种
+        /// </summary>
+        public int CardPriceCurrency { get; set; }
+        /// <summary>
         /// 确认标识   信用卡金额
         /// 0:未刷(红色)  1:已刷(绿色)
         /// </summary>

+ 138 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/CustomersRepository.cs

@@ -0,0 +1,138 @@
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.ViewModels.Groups;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Infrastructure.Repositories.Groups
+{
+    public class CustomersRepository:BaseRepository<Grp_Customers, Grp_Ommission>
+    {
+        private readonly IMapper _mapper;
+    public CustomersRepository(SqlSugarClient sqlSugar, IMapper mapper) : base(sqlSugar)
+    {
+        _mapper = mapper;
+    }
+
+        public async Task<Result> CustomersByDiId(CustomersByDiIdDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                string UserId = "";
+                List<Grp_GroupsTaskAssignment> gtaUIdList = _sqlSugar.Queryable<Grp_GroupsTaskAssignment>().Where(a => a.DIId == dto.DiId && a.IsDel == 0 && a.CTId == 76).ToList();
+                foreach (Grp_GroupsTaskAssignment gta in gtaUIdList)
+                    UserId += gta.UId + ",";
+
+                if (!string.IsNullOrWhiteSpace(UserId))
+                {
+                    UserId = UserId.Substring(0, UserId.Length - 1);
+                }
+                else
+                {
+                    UserId = "0";
+                }
+                string sqlWhere = string.Format(@"Where h.DiId={0} and h.IsDel={1} And h.CreateUserId in ({2})", dto.DiId, 0, UserId);
+
+                int startIndex = (dto.PageIndex - 1) * dto.PageSize + 1;
+                int endIndex = startIndex + dto.PageSize - 1;
+                if (dto.PortType == 1)
+                {
+                    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  
+                                                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)
+                    {
+                        if (item.IsAuditGM == 0) item.IsAuditGMStr = "未审核";
+                        else if (item.IsAuditGM == 1) item.IsAuditGMStr = "已通过";
+                        else if (item.IsAuditGM == 2) item.IsAuditGMStr = "未通过";
+                        else if (item.IsAuditGM == 3) item.IsAuditGMStr = "自动审核";
+                        if (!string.IsNullOrWhiteSpace(item.CheckInDate))
+                        {
+                            item.CheckInDate = DateTime.Parse(item.CheckInDate).ToString("yyyy-MM-dd");
+                        }
+                        if (!string.IsNullOrWhiteSpace(item.CheckOutDate))
+                        {
+                            item.CheckOutDate = DateTime.Parse(item.CheckOutDate).ToString("yyyy-MM-dd");
+                        }
+
+
+
+                    }
+                    return result = new Result() { Code = 0, Msg = "查询成功!", Data = hotelDataList };
+                }
+                else if (dto.PortType == 2 || dto.PortType == 3)
+                {
+                    string sql = string.Format(@"Select * From (	
+                                                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 
+                                                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();
+                    foreach (var item in hotelDataList)
+                    {
+                        if (item.IsAuditGM == 0) item.IsAuditGMStr = "未审核";
+                        else if (item.IsAuditGM == 1) item.IsAuditGMStr = "已通过";
+                        else if (item.IsAuditGM == 2) item.IsAuditGMStr = "未通过";
+                        else if (item.IsAuditGM == 3) item.IsAuditGMStr = "自动审核";
+                        if (!string.IsNullOrWhiteSpace(item.CheckInDate))
+                        {
+                            item.CheckInDate = DateTime.Parse(item.CheckInDate).ToString("yyyy-MM-dd");
+                        }
+                        if (!string.IsNullOrWhiteSpace(item.CheckOutDate))
+                        {
+                            item.CheckOutDate = DateTime.Parse(item.CheckOutDate).ToString("yyyy-MM-dd");
+                        }
+                    }
+                    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 
+                                                        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();
+
+                    int count = dataCount.Count;
+                    float totalPage = (float)count / dto.PageSize;//总页数
+                    if (totalPage == 0) totalPage = 1;
+                    else totalPage = (int)Math.Ceiling((double)totalPage);
+
+                    ListViewBase<HotelReservationsByDiIdView> rst = new ListViewBase<HotelReservationsByDiIdView>();
+                    rst.DataList = hotelDataList;
+                    rst.DataCount = count;
+                    rst.CurrPageIndex = dto.PageIndex;
+                    rst.CurrPageSize = dto.PageSize;
+                    return result = new Result() { Code = 0, Msg = "查询成功!", Data = rst };
+
+                }
+                else
+                {
+                    return result = new Result() { Code = -2, Msg = "请传入PortType参数,1 Web 2 Android 3 IOS" };
+                }
+            }
+            catch (Exception ex)
+            {
+                return result = new Result() { Code = -2, Msg = "未知错误" };
+                throw;
+            }
+        }
+    }
+}

+ 2 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/HotelPriceRepository.cs

@@ -502,7 +502,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         RoomExplanation=hotelPrice.RoomExplanation,
                         Attachment=hotelPrice.Attachment,
                         CardPrice=hotelPrice.CardPrice,
-                        IsCardPrice=hotelPrice.IsCardPrice,
+                        CardPriceCurrency=hotelPrice.CardPriceCurrency,
+                        IsCardPrice =hotelPrice.IsCardPrice,
                         PredictSingleRoom=hotelPrice.PredictSingleRoom,
                         PredictDoubleRoom=hotelPrice.PredictDoubleRoom,
                         PredictSuiteRoom=hotelPrice.PredictSuiteRoom,