Browse Source

新增机票费用录入实体类,及查询方法,新增团组费用预算表

wangh 1 year ago
parent
commit
ff9f21a805

+ 3 - 1
OASystem/EntitySync/Program.cs

@@ -92,6 +92,8 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Res_MemoInfo),
     //typeof(Fin_DailyFeePayment), // 财务 - 日付申请
     //typeof(Fin_DailyFeePaymentContent)  // 财务 - 日付申请详细类
-    typeof(Grp_GroupsTaskAssignment)
+    //typeof(Grp_GroupsTaskAssignment)
+    //typeof(Grp_AirTicketReservations)
+    typeof(Grp_GroupCostParameter)
 });
 Console.WriteLine("数据库结构同步完成!");

+ 56 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -5,6 +5,7 @@ using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.Groups;
+using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 
 namespace OASystem.API.Controllers
 {
@@ -19,13 +20,15 @@ namespace OASystem.API.Controllers
         private readonly IMapper _mapper;
         private readonly DelegationInfoRepository _groupRepository;
         private readonly TaskAssignmentRepository _taskAssignmentRep;
+        private readonly AirTicketResRepository _airTicketResRep;
 
-        public GroupsController(IMapper mapper, GrpScheduleRepository grpScheduleRep, DelegationInfoRepository groupRepository, TaskAssignmentRepository taskAssignmentRep)
+        public GroupsController(IMapper mapper, GrpScheduleRepository grpScheduleRep, DelegationInfoRepository groupRepository, TaskAssignmentRepository taskAssignmentRep, AirTicketResRepository airTicketResRep)
         {
             _mapper = mapper;
             _grpScheduleRep = grpScheduleRep;
             _groupRepository = groupRepository;
             _taskAssignmentRep = taskAssignmentRep;
+            _airTicketResRep = airTicketResRep;
         }
 
         #region 流程管控
@@ -431,5 +434,57 @@ namespace OASystem.API.Controllers
             return Ok(JsonView(true, groupData.Msg, groupData.Data));
         }
         #endregion
+
+        #region 机票费用录入
+        /// <summary>
+        /// 机票录入当前登录人可操作团组
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> AirTicketResSelect(AirTicketResDto dto)
+        {
+            try
+            {
+                Result groupData = await _airTicketResRep.AirTicketResSelect(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, "程序错误!"));
+                throw;
+            }
+        }
+        /// <summary>
+        /// 机票费用录入列表
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> AirTicketResList(AirTicketResListDto dto)
+        {
+            try
+            {
+                Result groupData = await _airTicketResRep.AirTicketResList(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, "程序错误!"));
+                throw;
+            }
+        }
+
+        #endregion
     }
 }

+ 127 - 1
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -21,11 +21,12 @@ namespace OASystem.API.Controllers
         private readonly SetDataRepository _setDataRepository;
         private readonly CountryFeeRepository _countryFeeRep;
         private readonly SetDataTypeRepository _setDataTypeRep;
+        private readonly AirTicketAgentRepository _airTicketAgentRep;
 
         public ResourceController(IMapper mapper, IConfiguration config, CarDataRepository carDataRep,
             LocalGuideDataRepository localGuideDataRep, ThreeCodeRepository threeCodeRep,
             HotelDataRepository hotelDataRep, ResItemInfoRepository resItemInfoRep, SetDataRepository setDataRepository,
-            CountryFeeRepository countryFeeRep, SetDataTypeRepository setDataTypeRep)
+            CountryFeeRepository countryFeeRep, SetDataTypeRepository setDataTypeRep, AirTicketAgentRepository airTicketAgentRep)
         {
             _mapper = mapper;
             _config = config;
@@ -37,6 +38,7 @@ namespace OASystem.API.Controllers
             _setDataRepository = setDataRepository;
             _countryFeeRep = countryFeeRep;
             _setDataTypeRep = setDataTypeRep;
+            _airTicketAgentRep = airTicketAgentRep;
         }
 
 
@@ -498,6 +500,127 @@ namespace OASystem.API.Controllers
         }
         #endregion
 
+        #region 代理出票合作方资料
+        /// <summary>
+        /// 代理出票合作方资料
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> QueryAirTicketAgent(DtoBase dto)
+        {
+
+            try
+            {
+                List<Res_AirTicketAgent> res_AirTicketAgents = _airTicketAgentRep.Query<Res_AirTicketAgent>(a => a.IsDel == 0).ToList();
+                if (res_AirTicketAgents.Count != 0)
+                {
+                    res_AirTicketAgents = res_AirTicketAgents.OrderByDescending(a => a.CreateTime).ToList();
+                    if (dto.PageSize == 0 && dto.PageIndex == 0)
+                    {
+                        return Ok(JsonView(true, "查询成功!", res_AirTicketAgents));
+                    }
+                    else
+                    {
+                        int count = res_AirTicketAgents.Count;
+                        float totalPage = (float)count / dto.PageSize;//总页数
+                        if (totalPage == 0) totalPage = 1;
+                        else totalPage = (int)Math.Ceiling((double)totalPage);
+
+                        List<Res_AirTicketAgent> _AirTicketAgent = new List<Res_AirTicketAgent>();
+                        for (int i = 0; i < dto.PageSize; i++)
+                        {
+                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
+                            if (RowIndex < res_AirTicketAgents.Count)
+                            {
+                                _AirTicketAgent.Add(res_AirTicketAgents[RowIndex]);
+                            }
+                            else
+                            {
+                                break;
+                            }
+                        }
+                        return Ok(JsonView(true, "查询成功!",new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = _AirTicketAgent }));
+                       
+                    }
+                }
+                else
+                {
+                    return Ok(JsonView(false, "暂无数据!"));
+                }
+                
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+        /// <summary>
+        /// 代理出票合作方资料操作(Status:1.新增,2.修改)
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> OpAirTicketAgent(OpAirTicketAgentDto dto)
+        {
+            try
+            {
+                
+                if (dto.Account == "")
+                {
+                    return Ok(JsonView(false, "请检查代理商账户是否填写!"));
+                }
+                if (dto.Bank == "")
+                {
+                    return Ok(JsonView(false, "请检查代理商银行是否填写!"));
+                }
+                if (dto.Name == "")
+                {
+                    return Ok(JsonView(false, "请检查代理商名称是否填写正确!"));
+                }
+                Result result = await _airTicketAgentRep.OpAirTicketAgent(dto);
+                if (result.Code != 0)
+                {
+                    return Ok(JsonView(false, result.Msg));
+                }
+                return Ok(JsonView(true, result.Msg));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+
+        /// <summary>
+        /// 代理出票合作方资料操作(删除)
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> DelAirTicketAgent(DelBaseDto dto)
+        {
+            try
+            {
+                var res = await _airTicketAgentRep.SoftDeleteByIdAsync<Res_AirTicketAgent>(dto.Id.ToString(), dto.DeleteUserId);
+                if (!res)
+                {
+                    return Ok(JsonView(false, "删除失败"));
+                }
+                return Ok(JsonView(true, "删除成功!"));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+
+        #endregion
+
         #region 酒店资料数据
         /// <summary>
         /// 酒店信息查询
@@ -510,6 +633,7 @@ namespace OASystem.API.Controllers
         {
             try
             {
+
                 Result hotelData = await _hotelDataRep.QueryHotelData(dto);
                 if (hotelData.Code == 0)
                 {
@@ -1222,6 +1346,8 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         }
 
         #endregion
+
+       
     }
 
 

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

@@ -16,6 +16,7 @@ using OASystem.Domain.ViewModels.System;
 using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Entities.Financial;
 using static OASystem.Domain.Dtos.CRM.NewClientDataQueryDto;
+using OASystem.Domain.ViewModels.Groups;
 
 namespace OASystem.Domain.AutoMappers
 {
@@ -75,6 +76,7 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<Grp_ScheduleDetailUpdDto, Grp_ScheduleDetailInfo>();
             CreateMap<Grp_ScheduleDetailInsertDto, Grp_ScheduleDetailInfo>();
             CreateMap<TaskAssignmenDto, Grp_GroupsTaskAssignment>();
+            CreateMap<Grp_GroupCostParameter,AirGroupCostParameterView>();
             #endregion
 
             #region Resource
@@ -92,6 +94,9 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<Res_ThreeCode, ThreeCodeView>();
             CreateMap<ThreeCodeOperationDto, Res_ThreeCode>();
             #endregion
+            #region 代理商合作资料
+            CreateMap<OpAirTicketAgentDto, Res_AirTicketAgent>();
+            #endregion
             #region 酒店资料数据
             CreateMap<Res_HotelData, HotelDataView>();
             CreateMap<Res_HotelData, QueryHotelDataSelect>();

+ 18 - 0
OASystem/OASystem.Domain/Dtos/Groups/AirTicketResDto.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Groups
+{
+    public class AirTicketResDto
+    {
+        public int UserId { get; set; }
+    }
+
+    public class AirTicketResListDto
+    {
+        public int DiId { get; set; }
+    }
+}

+ 43 - 0
OASystem/OASystem.Domain/Dtos/Resource/OpAirTicketAgentDto.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Resource
+{
+    public class OpAirTicketAgentDto
+    {
+        /// <summary>
+        /// 操作状态
+        /// 1 添加 
+        /// 2 修改 
+        /// </summary>
+        public int Status { get; set; }
+        /// <summary>
+        /// 编号
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 代理商名称
+        /// </summary>
+        public string Name { get; set; }
+        /// <summary>
+        /// 代理商账户
+        /// </summary>
+        public string Account { get; set; }
+        /// <summary>
+        /// 代理商银行
+        /// </summary>
+        public string Bank { get; set; }
+        /// <summary>
+        /// 创建者Id
+        /// </summary>
+        public int CreateUserId { get; set; }
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+    }
+}

+ 130 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_AirTicketReservations.cs

@@ -0,0 +1,130 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Groups
+{
+
+    /// <summary>
+    /// 机票费用录入
+    /// </summary>
+    [SugarTable("Grp_AirTicketReservations")]
+    public class Grp_AirTicketReservations : EntityBase
+    {
+        /// <summary>
+        /// 团组外键编号
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int DIId { get; set; }
+        /// <summary>
+        /// 航班号
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        public string FlightsCode { get; set; }
+
+        /// <summary>
+        /// 航班日期
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(22)")]
+        public string FlightsDate { get; set; }
+
+        /// <summary>
+        /// 航班时间
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(22)")]
+        public string FlightsTime { get; set; }
+        /// <summary>
+        /// 抵达时间
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(22)")]
+        public string ArrivedTime { get; set; }
+        /// <summary>
+        /// 是否值机
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int IsCheckIn { get; set; }
+        /// <summary>
+        /// 是否选座
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int IsSetSeat { get; set; }
+
+        /// <summary>
+        /// 是否购买行李服务
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int IsPackage { get; set; }
+        /// <summary>
+        /// 是否行李直挂
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int IsBagHandle { get; set; }
+        /// <summary>
+        /// 是否火车票出票选座
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int IsTrain { get; set; }
+        /// <summary>
+        /// 城市A-B
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        public string FlightsCity { get; set; }
+        /// <summary>
+        /// 去程航班描述代码
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "text")]
+        public string LeaveDescription { get; set; }
+        /// /// <summary>
+        /// 内陆段航班描述
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "text")]
+        public string FlightsDescription { get; set; }
+        /// <summary>
+        /// 返程航班描述代码
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "text")]
+        public string ReturnDescription { get; set; }
+        /// <summary>
+        /// 客户人数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ClientNum { get; set; }
+        /// <summary>
+        /// 客人名称
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "text")]
+        public string ClientName { get; set; }
+        /// <summary>
+        /// 出票前报价
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal PrePrice { get; set; }
+        /// <summary>
+        /// 出票前报价币种
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int PreCurrency { get; set; }
+        /// <summary>
+        /// 机票全价
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Price { get; set; }
+        /// <summary>
+        /// 币种
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Currency { get; set; }
+        /// <summary>
+        /// 报价说明
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "text")]
+        public string PriceDescription { get; set; }
+        /// <summary>
+        /// 舱类型
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int CType { get; set; }
+    }
+}

+ 257 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_GroupCostParameter.cs

@@ -0,0 +1,257 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Groups
+{
+    /// <summary>
+    /// 团组成本预算表
+    /// </summary>
+    [SugarTable("Grp_GroupCostParameter")]
+    public class Grp_GroupCostParameter:EntityBase
+    {
+        /// <summary>
+        /// 团组ID
+        /// </summary>
+        [SugarColumn(IsNullable =true,ColumnDataType ="int")]
+        public int DiId { get; set; }
+        /// <summary>
+        /// 币种
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        public string Currency { get; set; }
+        /// <summary>
+        /// 汇率
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Rate { get; set; }
+        /// <summary>
+        /// 税率
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Tax { get; set; }
+        /// <summary>
+        /// 房费预算
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal FFYS { get; set; }
+        /// <summary>
+        /// 酒店系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal HotelXS { get; set; }
+        /// <summary>
+        /// 经济舱成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal JJCCB { get; set; }
+        /// <summary>
+        /// 经济舱系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal JJCXS { get; set; }
+        /// <summary>
+        /// 经济舱人数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int JJCRS { get; set; }
+        /// <summary>
+        /// 公务舱成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal GWCCB { get; set; }
+        /// <summary>
+        /// 公务舱系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal GWCXS { get; set; }
+        /// <summary>
+        /// 公务舱人数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int GWCRS { get; set; }
+        /// <summary>
+        /// 火车票成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal HCPCB { get; set; }
+        /// <summary>
+        /// 火车票系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal HCPXS { get; set; }
+        /// <summary>
+        /// 火车票人数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int HCPRS { get; set; }
+        /// <summary>
+        /// 船票成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal CPCB { get; set; }
+        /// <summary>
+        /// 船票系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal CPXS { get; set; }
+        /// <summary>
+        /// 船票人数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int CPRS { get; set; }
+        /// <summary>
+        /// 保险成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal BXCB { get; set; }
+        /// <summary>
+        /// 保险系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal BXXS { get; set; }
+        /// <summary>
+        /// 保险人数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int BXRS { get; set; }
+        /// <summary>
+        /// 核酸检测成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal HSCB { get; set; }
+        /// <summary>
+        /// 核酸检测系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal HSXS { get; set; }
+        /// <summary>
+        /// 核酸检测人数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int HSRS { get; set; }
+        /// <summary>
+        /// 签证成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal VisaCB { get; set; }
+        /// <summary>
+        /// 签证系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal VisaXS { get; set; }
+        /// <summary>
+        /// 签证人数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int VisaRS { get; set; }
+        /// <summary>
+        /// 公务成本 : 公杂费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal GWCB { get; set; }
+        /// <summary>
+        /// 公务系数: 公杂费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal GWXS { get; set; }
+        /// <summary>
+        /// 公务人数 : 公杂费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int GWRS { get; set; }
+        /// <summary>
+        /// 地接成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal DJCB { get; set; }
+        /// <summary>
+        /// 地接系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal DJXS { get; set; }
+        /// <summary>
+        /// 单间 单人成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal SGRCB { get; set; }
+        /// <summary>
+        /// 单间数量(人数)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int SGRNumber { get; set; }
+        /// <summary>
+        /// 单间 系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal SGRXS { get; set; }
+        /// <summary>
+        /// 1/2标间 单人成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal TBRCB { get; set; }
+        /// <summary>
+        /// 1/2标间数量(人数)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int TBRNumber { get; set; }
+        /// <summary>
+        /// 1/2标间  系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal TBRXS { get; set; }
+        /// <summary>
+        /// 小套房/豪华套房 单人成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal JSESCB { get; set; }
+        /// <summary>
+        /// 小套房/豪华套房数量(人数)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int JSESNumber { get; set; }
+        /// <summary>
+        /// 小套房/豪华套房 系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal JSESXS { get; set; }
+        /// <summary>
+        /// 套房  单人成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal SUITECB { get; set; }
+        /// <summary>
+        /// 套房数量(人数)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int SUITENumber { get; set; }
+        /// <summary>
+        /// 套房  单人成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal SUITEXS { get; set; }
+        /// <summary>
+        /// 零用金成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal LYJCB { get; set; }
+        /// <summary>
+        /// 零用金系数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal LYJXS { get; set; }
+        /// <summary>
+        /// 零用金人数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int LYJRS { get; set; }
+        /// <summary>
+        /// 成本完成标识  0:未完成 1:完成
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int IsShare { get; set; }
+        
+    }
+}

+ 53 - 0
OASystem/OASystem.Domain/ViewModels/Groups/AirTicketReservationsView.cs

@@ -0,0 +1,53 @@
+using OASystem.Domain.Entities.Groups;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Groups
+{
+    public class AirTicketReservationsView:Grp_AirTicketReservations
+    {
+        /// <summary>
+        /// 总经理是否审核
+        /// </summary>
+        public int IsAuditGM { get; set; }
+        /// <summary>
+        /// 舱类型
+        /// </summary>
+        public string CTypeName { get; set; }
+        public string PreCurrencyStr { get; set; }
+        public string CurrencyStr { get; set; }
+
+        public string FlightDescription { get; set; }
+    }
+
+    public class AirGroupCostParameterView
+    {
+        /// <summary>
+        /// 经济舱成本
+        /// </summary>
+        public decimal JJCCB { get; set; }
+        /// <summary>
+        /// 经济舱系数
+        /// </summary>
+        public decimal JJCXS { get; set; }
+        /// <summary>
+        /// 经济舱人数
+        /// </summary>
+        public int JJCRS { get; set; }
+        /// <summary>
+        /// 公务舱成本
+        /// </summary>
+        public decimal GWCCB { get; set; }
+        /// <summary>
+        /// 公务舱系数
+        /// </summary>
+        public decimal GWCXS { get; set; }
+        /// <summary>
+        /// 公务舱人数
+        /// </summary>
+        public int GWCRS { get; set; }
+    }
+}

+ 10 - 0
OASystem/OASystem.Infrastructure/Repositories/CRM/VisaDeleClientRepository.cs

@@ -154,6 +154,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
            Result result = new Result() { Code = -2, Msg = "未知错误" };
             try
             {
+                BeginTran();
                 int deleId = 0;
                 if (dto.Status==1)//添加
                 {
@@ -312,6 +313,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                             if (res==0)
                             {
                                 result = new Result() { Code = -1, Msg = "家庭成员信息保存失败!" };
+                                RollbackTran();
                             }
                         }
                         else if (item.Id == 0)//添加
@@ -320,6 +322,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                             if (sss == 0)
                             {
                                 result = new Result() { Code = -1, Msg = "家庭成员信息保存失败!" };
+                                RollbackTran();
                             }
                         }
                     }
@@ -348,6 +351,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                             if (res == 0)
                             {
                                 result = new Result() { Code = -1, Msg = "证件信息保存失败!" };
+                                RollbackTran();
                             }
                         }
                         else if (item.Id == 0)//添加
@@ -356,6 +360,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                             if (sss == 0)
                             {
                                 result = new Result() { Code = -1, Msg = "证件信息保存失败!" };
+                                RollbackTran();
                             }
                         }
                     }
@@ -383,6 +388,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                             if (res == 0)
                             {
                                 result = new Result() { Code = -1, Msg = "客户工作经历保存失败!" };
+                                RollbackTran();
                             }
                         }
                         else if (item.Id == 0)//添加
@@ -391,6 +397,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                             if (sss == 0)
                             {
                                 result = new Result() { Code = -1, Msg = "客户工作经历保存失败!" };
+                                RollbackTran();
                             }
                         }
                     }
@@ -417,6 +424,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                             if (res == 0)
                             {
                                 result = new Result() { Code = -1, Msg = "客户学历信息保存失败!" };
+                                RollbackTran();
                             }
                         }
                         else if (item.Id == 0)//添加
@@ -425,9 +433,11 @@ namespace OASystem.Infrastructure.Repositories.CRM
                             if (sss == 0)
                             {
                                 result = new Result() { Code = -1, Msg = "客户学历信息保存失败!" };
+                                RollbackTran();
                             }
                         }
                     }
+                    CommitTran();
                 }
             }
             catch (Exception ex)

+ 73 - 0
OASystem/OASystem.Infrastructure/Repositories/Resource/AirTicketAgentRepository.cs

@@ -0,0 +1,73 @@
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Dtos.Resource;
+using OASystem.Domain.Entities.Resource;
+using OASystem.Domain.ViewModels.Resource;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Infrastructure.Repositories.Resource
+{
+    public class AirTicketAgentRepository : BaseRepository<Res_AirTicketAgent, Res_AirTicketAgent>
+    {
+        private readonly IMapper _mapper;
+        public AirTicketAgentRepository(SqlSugarClient sqlSugar, IMapper mapper) : base(sqlSugar)
+        {
+            _mapper = mapper;
+        }
+
+        public async Task<Result> OpAirTicketAgent(OpAirTicketAgentDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                if (dto.Status == 1)//添加
+                {
+                   Res_AirTicketAgent res_AirTicket=await Query<Res_AirTicketAgent>(a=>a.IsDel==0 && a.Account==dto.Account && a.Name==dto.Name && a.Bank==dto.Bank).FirstAsync();
+                    if (res_AirTicket!=null)
+                    {
+                        return result = new Result() { Code = -1, Msg = "该代理商已存在,请勿重复添加!" };
+                    }
+                    else
+                    {
+                        Res_AirTicketAgent _AirTicketAgent = _mapper.Map<Res_AirTicketAgent>(dto);
+                        int id = await AddAsyncReturnId(_AirTicketAgent);
+                        if (id == 0)
+                        {
+                            return result = new Result() { Code = -1, Msg = "添加失败!" };
+
+                        }
+                        return result = new Result() { Code = 0, Msg = "添加成功!", Data = new { Id = id } };
+                    }
+                }
+                else if (dto.Status == 2)//修改
+                {
+                    bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Res_AirTicketAgent
+                    {
+                        Name = dto.Name,
+                        Bank = dto.Bank,
+                        Account = dto.Account,
+                        CreateUserId = dto.CreateUserId,
+                        Remark = dto.Remark,
+                    });
+                    if (!res)
+                    {
+                        return result = new Result() { Code = -1, Msg = "修改失败!" };
+                    }
+                    return result = new Result() { Code = 0, Msg = "修改成功!" };
+                }
+                else
+                {
+                    return result = new Result() { Code = -1, Msg = "请传入Status参数,1添加 2修改!" };
+                }
+            }
+            catch (Exception ex)
+            {
+                return result = new Result() { Code = -2, Msg = "程序错误!" };
+            }
+        }
+    }
+}

+ 226 - 0
OASystem/OASystem.Infrastructure/Repositories/Resource/AirTicketResRepository.cs

@@ -0,0 +1,226 @@
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.Entities.Resource;
+using OASystem.Domain.ViewModels.Groups;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml.Linq;
+
+namespace OASystem.Infrastructure.Repositories.Resource
+{
+    public class AirTicketResRepository : BaseRepository<Grp_AirTicketReservations, Grp_AirTicketReservations>
+    {
+        private readonly IMapper _mapper;
+        public AirTicketResRepository(SqlSugarClient sqlSugar, IMapper mapper) : base(sqlSugar)
+        {
+            _mapper = mapper;
+        }
+
+        public async Task<Result> AirTicketResList(AirTicketResListDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+
+            Grp_DelegationInfo _DelegationInfo = _sqlSugar.Queryable<Grp_DelegationInfo>().First(it => it.Id == dto.DiId);
+            if (_DelegationInfo != null)
+            {
+                string sql = string.Format(@"select a.*,c.IsAuditGM,(select Name from Sys_SetData where Id=a.cType) as 'CTypeName',(select Name from 
+                                                Sys_SetData where Id=a.PreCurrency) as 'PreCurrencyStr',(select Name from Sys_SetData where Id=a.Currency)
+                                                as 'CurrencyStr' from Grp_AirTicketReservations a,Grp_CreditCardPayment c where  a.id=c.CId  and a.isdel={1}
+                                                and a.DIId={0} Order By a.CreateTime desc", dto.DiId, 0);
+                List<AirTicketReservationsView> _AirTicketReservations = _sqlSugar.SqlQueryable<AirTicketReservationsView>(sql).ToList();
+
+                foreach (var item in _AirTicketReservations)
+                {
+                    if (item.FlightsDescription.Contains("\r\n"))
+                    {
+                        var spilitArr = Regex.Split(item.FlightsDescription, "\r\n");
+                        int rowindex = 1;
+                        foreach (var spilitItem in spilitArr)
+                        {
+                            try
+                            {
+                                var spDotandEmpty = spilitItem.Split('.')[1].Split(' ').Where(x => !string.IsNullOrEmpty(x)).ToList();
+                                var depCode = spDotandEmpty[3].Substring(0, 3);
+                                var arrCode = spDotandEmpty[3].Substring(3, 3);
+                                Res_ThreeCode depData = _sqlSugar.Queryable<Res_ThreeCode>().First(it => it.IsDel == 0 && it.Three == depCode);
+                                Res_ThreeCode arrData = _sqlSugar.Queryable<Res_ThreeCode>().First(it => it.IsDel == 0 && it.Three == arrCode);
+
+                                string day = spDotandEmpty[2].Substring(2, 2);//日
+                                string monthAbbreviations = spDotandEmpty[1].Substring(4, 3).ToUpper();//月份
+                                switch (monthAbbreviations)
+                                {
+                                    case "JAN":
+                                        monthAbbreviations = "1";
+                                        break;
+                                    case "FEB":
+                                        monthAbbreviations = "2";
+                                        break;
+                                    case "MAR":
+                                        monthAbbreviations = "3";
+                                        break;
+                                    case "APR":
+                                        monthAbbreviations = "4";
+                                        break;
+                                    case "MAY":
+                                        monthAbbreviations = "5";
+                                        break;
+                                    case "JUN":
+                                        monthAbbreviations = "6";
+                                        break;
+                                    case "JUL":
+                                        monthAbbreviations = "7";
+                                        break;
+                                    case "AUG":
+                                        monthAbbreviations = "8";
+                                        break;
+                                    case "SEP":
+                                        monthAbbreviations = "9";
+                                        break;
+                                    case "OCT":
+                                        monthAbbreviations = "10";
+                                        break;
+                                    case "NOV":
+                                        monthAbbreviations = "11";
+                                        break;
+                                    case "DEC":
+                                        monthAbbreviations = "12";
+                                        break;
+                                }
+                                string tate = $"{monthAbbreviations}月{day}日";
+                                item.FlightDescription += rowindex + ". " + depData.AirPort + " " + arrData.AirPort + "  (" + tate + ")\r\n";
+                            }
+                            catch (Exception)
+                            {
+                                item.FlightDescription = "录入数据不规范!请检查";
+                                break;
+                            }
+                            rowindex++;
+                        }
+                    }
+                    else
+                    {
+                        try
+                        {
+                            var spDotandEmpty = item.FlightsDescription.Split('.')[1].Split(' ').Where(x => !string.IsNullOrEmpty(x)).ToList();
+                            var depCode = spDotandEmpty[3].Substring(0, 3);
+                            var arrCode = spDotandEmpty[3].Substring(3, 3);
+                            Res_ThreeCode depData = _sqlSugar.Queryable<Res_ThreeCode>().First(it => it.IsDel == 0 && it.Three == depCode);
+                            Res_ThreeCode arrData = _sqlSugar.Queryable<Res_ThreeCode>().First(it => it.IsDel == 0 && it.Three == arrCode);
+                            string day = spDotandEmpty[2].Substring(2, 2);//日
+                            string monthAbbreviations = spDotandEmpty[2].Substring(4, 3).ToUpper();//月份
+                            switch (monthAbbreviations)
+                            {
+                                case "JAN":
+                                    monthAbbreviations = "1";
+                                    break;
+                                case "FEB":
+                                    monthAbbreviations = "2";
+                                    break;
+                                case "MAR":
+                                    monthAbbreviations = "3";
+                                    break;
+                                case "APR":
+                                    monthAbbreviations = "4";
+                                    break;
+                                case "MAY":
+                                    monthAbbreviations = "5";
+                                    break;
+                                case "JUN":
+                                    monthAbbreviations = "6";
+                                    break;
+                                case "JUL":
+                                    monthAbbreviations = "7";
+                                    break;
+                                case "AUG":
+                                    monthAbbreviations = "8";
+                                    break;
+                                case "SEP":
+                                    monthAbbreviations = "9";
+                                    break;
+                                case "OCT":
+                                    monthAbbreviations = "10";
+                                    break;
+                                case "NOV":
+                                    monthAbbreviations = "11";
+                                    break;
+                                case "DEC":
+                                    monthAbbreviations = "12";
+                                    break;
+                            }
+                            string tate = $"{monthAbbreviations}月{day}日";
+                            item.FlightDescription +=depData.AirPort + " " + arrData.AirPort + "  (" + tate + ")\r\n";
+                        }
+                        catch (Exception)
+                        {
+                            item.FlightDescription = "录入数据不规范!请检查";
+                        }
+                    }
+                }
+                //团组成本预算表查询
+                Grp_GroupCostParameter _GroupCostParameter = _sqlSugar.Queryable<Grp_GroupCostParameter>().First(a=>a.DiId==dto.DiId);
+
+                AirGroupCostParameterView _AirgroupCostParameter = _mapper.Map<AirGroupCostParameterView>(_GroupCostParameter);
+               
+                var data = new
+                {
+                    DelegationInfo = _DelegationInfo,
+                    AirTicketReservations = _AirTicketReservations,
+                    AirGroupCostParameter= _AirgroupCostParameter
+                };
+                return result = new Result() { Code = 0, Msg = "查询成功!", Data = data };
+            }
+            else
+            {
+                return result = new Result() { Code = -1, Msg = "暂无团组数据!" };
+            }
+
+        }
+
+        public async Task<Result> AirTicketResSelect(AirTicketResDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == 85).ToList();
+                if (grp_GroupsTaskAssignment.Count != 0)
+                {
+                    string DiId = "";
+                    foreach (var item in grp_GroupsTaskAssignment)
+                    {
+                        DiId += item.DIId + ",";
+                    }
+                    DiId = DiId.Substring(0, DiId.Length - 1);
+                    string sql = string.Format(@"select * from Grp_DelegationInfo where Id in({0}) and IsDel={1}", DiId, 0);
+                    List<Grp_DelegationInfo> grp_Delegations = _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).ToList();
+                    if (grp_Delegations.Count == 0)
+                    {
+                        return result = new Result() { Code = -1, Msg = "查询失败!" };
+                    }
+                    List<GroupNameView> grp_NameView = new List<GroupNameView>();
+                    foreach (var item in grp_Delegations)
+                    {
+                        GroupNameView groupNameView = new GroupNameView();
+                        groupNameView.Id = item.Id;
+                        groupNameView.GroupName = item.TeamName;
+                        grp_NameView.Add(groupNameView);
+                    }
+                    return result = new Result() { Code = 0, Msg = "查询成功!", Data = grp_NameView };
+                }
+                else
+                {
+                    return result = new Result() { Code = -1, Msg = "暂无可操作团组" };
+                }
+            }
+            catch (Exception ex)
+            {
+                return result = new Result() { Code = -2, Msg = "程序错误" };
+                throw;
+            }
+        }
+    }
+}

+ 147 - 7
OASystem/_Doc/OA2023数据字典.docx

@@ -2244,7 +2244,7 @@ Null
 业务人员查询时间
 
 
-8) 机票费用表:Grp_AirPrice(费用录入页面)
+8) 暂时没用--机票费用表:Grp_AirPrice(费用录入页面)
                                    字段名
                                  类型长度
                                  字段属性
@@ -2329,8 +2329,147 @@ Null
 
 报价说明
 
+9) 机票费用录入表:Grp_AirTicketReservations(挪用)
+                                   字段名
+                                 类型长度
+                                 字段属性
+                                 字段约束
+                                 字段描述
+                                    备注
+DIId
+int
+Null
+
+团组外键编号
+Grp_DelegationInfo.Id
+FlightsCode
+varchar(100)
+Null
+
+航班号
+
+FlightsDate
+varchar(22)
+Null
+
+航班日期
+
+FlightsTime
+varchar(22)
+Null
+
+航班时间
+
+ArrivedTime
+varchar(22)
+Null
+
+抵达时间
+
+IsCheckIn
+int
+Null
+
+是否值机
+
+IsSetSeat
+int
+Null
+
+是否选座
+
+IsPackage
+int
+Null
+
+是否购买行李服务
+
+IsBagHandle
+int
+Null
+
+是否行李直挂
+
+IsTrain
+int
+Null
+
+是否火车票出票选座
+
+FlightsCity
+varchar(100)
+Null
+
+城市A-B
+
+LeaveDescription
+text
+Null
+
+去程航班描述代码
+
+FlightsDescription
+text
+Null
+
+内陆段航班描述
+
+ReturnDescription
+text
+Null
+
+返程航班描述代码
+
+ClientNum
+int
+Null
+
+客户人数
+
+ClientName
+text
+Null
+
+客人名称
+
+PrePrice
+decimal(10,2)
+Null
+
+出票前报价
+
+PreCurrency
+int
+Null
+
+出票前报价币种
+SetData.id
+Price
+decimal(10,2)
+Null
+
+机票全价
+
+Currency
+int
+Null
+
+币种
+SetData.id
+PriceDescription
+text
+Null
+
+报价说明
+
+CType
+int
+Null
+
+舱类型
+
 
-9) 酒店表:Grp_HotelReservations(挪用)
+10) 酒店表:Grp_HotelReservations(挪用)
                                    字段名
                                  类型长度
                                  字段属性
@@ -2560,7 +2699,7 @@ Null
 是否住了其他房型
 0否1是
 
-10) 付款信息表:Grp_CreditCardPayment(挪用)
+11) 付款信息表:Grp_CreditCardPayment(挪用)
                                    字段名
                                  类型长度
                                  字段属性
@@ -2789,7 +2928,7 @@ Null
 
 超出预算比例
 
-11) 团组流程管控表:Grp_Schedule
+12) 团组流程管控表:Grp_Schedule
                                    字段名
                                  类型长度
                                  字段属性
@@ -2850,7 +2989,7 @@ Null
 
 异常标识
 
-12) 团组流程管控详细进度表:Grp_ScheduleDetail
+13) 团组流程管控详细进度表:Grp_ScheduleDetail
                                    字段名
                                  类型长度
                                  字段属性
@@ -2912,7 +3051,7 @@ Null
 异常标识
 
 
-13) 团组流程管控人员配置表:Grp_SchedulePerson
+14) 团组流程管控人员配置表:Grp_SchedulePerson
                                    字段名
                                  类型长度
                                  字段属性
@@ -2944,7 +3083,7 @@ Null
 负责工作
 
 
-14) 团组任务分配:Grp_GroupsTaskAssignment
+15) 团组任务分配:Grp_GroupsTaskAssignment
                                    字段名
                                  类型长度
                                  字段属性
@@ -3226,4 +3365,5 @@ Null
 
 签证地址
 
+1. 机票板块