Browse Source

酒店预订
基础数据源 卡类型
增加 币种

leiy 1 year ago
parent
commit
6cd75a50a6

+ 3 - 2
OASystem/EntitySync/Program.cs

@@ -116,7 +116,8 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Grp_VisaInfo)
     //typeof(Grp_CarTouristGuideGroundReservations),
     //typeof(Grp_CarTouristGuideGroundReservationsContent),//
-    //typeof(Fin_PaymentRefundAndOtherMoney)
-    typeof(Grp_InsuranceCost)
+    //typeof(Fin_PaymentRefundAndOtherMoney),
+    //typeof(Grp_InsuranceCost),
+    typeof(Grp_TourClientList) //接团客户名单
 });
 Console.WriteLine("数据库结构同步完成!");

+ 19 - 12
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -2778,9 +2778,9 @@ namespace OASystem.API.Controllers
                         if (item.CrmCompanyId != 0)
                         {
                             Crm_CustomerCompany crm_Customer = await _sqlSugar.Queryable<Crm_CustomerCompany>().FirstAsync(a => a.Id == item.CrmCompanyId && a.IsDel == 0);
-                            if (!transDic.ContainsKey(crm_Customer.CompanyName))
+                            if (!transDic.ContainsKey(crm_Customer.CompanyFullName))
                             {
-                                texts.Add(crm_Customer.CompanyName);
+                                texts.Add(crm_Customer.CompanyFullName);
                             }
                         }
                     }
@@ -2820,7 +2820,7 @@ namespace OASystem.API.Controllers
                         }
                         guestList.DOB = dele.BirthDay.Replace('-', '.');
                         Crm_CustomerCompany crm_Customer = await _sqlSugar.Queryable<Crm_CustomerCompany>().FirstAsync(a => a.Id == dele.CrmCompanyId && a.IsDel == 0);
-                        string jobName = transDic.Where(s => s.Key == crm_Customer.CompanyName).FirstOrDefault().Value + " " + transDic.Where(s => s.Key == dele.Job).FirstOrDefault().Value;
+                        string jobName = transDic.Where(s => s.Key == crm_Customer.CompanyFullName).FirstOrDefault().Value + " " + transDic.Where(s => s.Key == dele.Job).FirstOrDefault().Value;
 
                         guestList.Job = jobName;
                         list.Add(guestList);
@@ -2972,21 +2972,25 @@ namespace OASystem.API.Controllers
             {
                 var groupNameData = await _groupRepository.GetGroupNameList(new GroupNameDto { PortType = dto.PortType });
 
-                string currencySql = string.Format("Select * From Sys_SetData Where STid = 66 And IsDel = 0");
-                var currencyData = await _sqlSugar.SqlQueryable<SetDataInfoView>(currencySql).ToListAsync();
+                string sql = string.Format("Select * From Sys_SetData Where IsDel = 0");
+                //SetDataInfoView
+                var dataSource = await _sqlSugar.SqlQueryable<Sys_SetData>(sql).ToListAsync();
 
+                var currencyData = dataSource.Where(it => it.STid == 66).ToList(); //所有币种
+                List<SetDataInfoView> _CurrencyData = _mapper.Map<List<SetDataInfoView>>(currencyData);
 
-                //string nationalTravelFeeSql = string.Format(@"Select ssd.Name as CurrencyCode, ssd.Remark as CurrencyName,su.CnName as LastUpdateUserName,gntf.* From Grp_NationalTravelFee gntf
-                //                                                Left Join Sys_SetData ssd On ssd.STid = 66 And gntf.Currency = ssd.Id
-                //                                                Left Join Sys_Users su On gntf.LastUpdateUserId = su.Id 
-                //                                                Where gntf.Isdel = 0");
-                //var nationalTravelFeeData = await _sqlSugar.SqlQueryable<NationalTravelFeeInfoView>(nationalTravelFeeSql).ToListAsync();
+                var wordTypeData = dataSource.Where(it => it.STid == 72).ToList();  //三公费用-Word明细类型
+                List<SetDataInfoView> _WordTypeData = _mapper.Map<List<SetDataInfoView>>(wordTypeData);
 
+                var excelTypeData = dataSource.Where(it => it.STid == 73).ToList(); //三公费用-Excel明细类型
+                List<SetDataInfoView> _ExcelTypeData = _mapper.Map<List<SetDataInfoView>>(excelTypeData);
 
                 return Ok(JsonView(true, "查询成功!", new
                 {
                     GroupNameData = groupNameData.Data,
-                    CurrencyData = currencyData,
+                    CurrencyData = _CurrencyData,
+                    WordTypeData = _WordTypeData,
+                    ExcelTypeData = _ExcelTypeData
                     //NationalTravelFeeData = nationalTravelFeeData
                 }));
             }
@@ -3072,6 +3076,9 @@ namespace OASystem.API.Controllers
             }
         }
 
+
+
+
         /// <summary>
         /// 团组模块 - 出入境费用 - 子项删除
         /// </summary>
@@ -4515,7 +4522,7 @@ namespace OASystem.API.Controllers
             }
             catch (Exception ex)
             {
-                return Ok(JsonView(false, ex.Message));
+                return Ok(JsonView(false, "Catch:"+ex.Message));
             }
         }
 

+ 2 - 2
OASystem/OASystem.Api/appsettings.json

@@ -1,7 +1,7 @@
 {
   "ConnectionStrings": {
-    "OA2023DB": "server=132.232.92.186;uid=sa;pwd=Yjx@158291;database=OA2023DB;",
-    "OA2014DB": "server=132.232.92.186;uid=sa;pwd=Yjx@158291;database=OA2014;"
+    "OA2023DB": "server=132.232.92.186;uid=sa;pwd=Yjx@158291;database=OA2023DB;MultipleActiveResultSets=True;",
+    "OA2014DB": "server=132.232.92.186;uid=sa;pwd=Yjx@158291;database=OA2014;MultipleActiveResultSets=True"
   },
   "JwtSecurityKey": "48d3f4fe770940a1068052f581536b81", //jwt密钥
   "UseSwagger": "true", //启用Swagger

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

@@ -44,6 +44,7 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<OperationSetDataTypeDto, Sys_SetDataType>();
             CreateMap<OperationSetDataDto, Sys_SetData>();
             CreateMap<Sys_SetData, SetDataInfoView>();
+            CreateMap<Sys_SetData, SetDataCurrencyInfoView>();
             #endregion
 
             #region 公司板块

+ 12 - 4
OASystem/OASystem.Domain/Entities/Customer/Crm_CustomerCompany.cs

@@ -9,26 +9,34 @@ namespace OASystem.Domain.Entities.Customer
     {
         /// <summary>
         /// 客户公司名称
+        /// 简称
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(40)")]
+        public string? CompanyAbbreviation { get; set; }
+
+        /// <summary>
+        /// 客户公司名称
+        /// 全称
         /// </summary>
         [SugarColumn(IsNullable =true,ColumnDataType = "varchar(80)")]
-        public string CompanyName { get; set; }
+        public string? CompanyFullName { get; set; }
         /// <summary>
         /// 公司地址
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]
-        public string Address { get; set; }
+        public string? Address { get; set; }
         /// <summary>
         /// 邮政编码
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(80)")]
-        public string PostCodes { get; set; }
+        public string? PostCodes { get; set; }
         /// <summary>
         /// 最后操作人
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
         public int LastedOpUserId { get; set; }
         /// <summary>
-        /// 客户公司名称
+        /// 最后操作时间
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "DateTime")]
         public DateTime LastedOpDt { get; set; }

+ 1 - 1
OASystem/OASystem.Domain/Entities/Customer/Crm_GroupCustomer.cs

@@ -13,7 +13,7 @@ namespace OASystem.Domain.Entities.Customer
     public class Crm_GroupCustomer:EntityBase
     {
         /// <summary>
-        ///  团组Id
+        ///  团组Id 保留
         /// </summary>
         [SugarColumn(IsNullable =true,ColumnDataType ="int")]
         public int DiId { get; set; }

+ 53 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_TourClientList.cs

@@ -0,0 +1,53 @@
+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_TourClientList")]
+    public class Grp_TourClientList : EntityBase
+    {
+        /// <summary>
+        /// 团组Id(团组信息表)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 客户Id(客户资料表)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ClientId { get; set; }
+
+        /// <summary>
+        /// 舱位类型Id (数据表Id)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ShippingSpaceTypeId { get; set; }
+
+        /// <summary>
+        /// 舱位特殊需求
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        public string? ShippingSpaceSpecialNeeds { get; set; }
+
+        /// <summary>
+        /// 酒店特殊需求
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        public string? HotelSpecialNeeds { get; set; }
+
+        /// <summary>
+        /// 酒店特殊需求
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        public string? MealSpecialNeeds { get; set; }
+    }
+}

+ 18 - 0
OASystem/OASystem.Domain/ViewModels/Groups/TourClientListView.cs

@@ -0,0 +1,18 @@
+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
+{
+    /// <summary>
+    /// 接团客户名单
+    /// </summary>
+    public class TourClientListView:Grp_TourClientList
+    {
+    }
+
+
+}

+ 30 - 0
OASystem/OASystem.Domain/ViewModels/System/SetDataView.cs

@@ -36,6 +36,36 @@ namespace OASystem.Domain.ViewModels.System
         public string Remark { get; set; }
     }
 
+    /// <summary>
+    /// 卡类型数据data
+    /// </summary>
+    public class SetDataCurrencyInfoView
+    {
+        public int Id { get; set; }
+        /// <summary>
+        /// 分类名称
+        /// </summary>
+        public string? Name { get; set; }
+
+        /// <summary>
+        /// 卡类型对应的币种
+        /// </summary>
+        public string? Currency { get {
+                string? currency = string.Empty;
+                if (Id == 74) currency = "USD"; //74	美元卡
+                else if (Id == 75) currency = "EUR"; //775	欧元卡
+                else if(Id == 86) currency = "CNY";  //86	招行卡
+                else if (Id == 346) currency = "CNY";  //346	中信卡
+                else if (Id == 363) currency = "CNY";  //363	交行卡
+                return currency;
+            } }
+
+        /// <summary>
+        /// 卡号
+        /// </summary>
+        public string? Remark { get; set; }
+    }
+
 
 
     public class SetDataAndPageInfoView

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/CRM/VisaDeleClientCompanyRepository.cs

@@ -88,7 +88,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                 {
                     bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Crm_CustomerCompany
                     {
-                        CompanyName=dto.CompanyName,
+                        CompanyFullName = dto.CompanyName,
                         Address = dto.Address,
                         PostCodes = dto.PostCodes,
                         LastedOpUserId = dto.LastedOpUserId,

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

@@ -367,7 +367,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                 //卡类型
                 List<Sys_SetData> BankCard = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 15 && a.IsDel == 0).ToList();
-                List<SetDataInfoView> _BankCard = _mapper.Map<List<SetDataInfoView>>(BankCard);
+                List<SetDataCurrencyInfoView> _BankCard = _mapper.Map<List<SetDataCurrencyInfoView>>(BankCard);
 
                 //预订网站
                 List<Sys_SetData> BookingWebsite = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 12 && a.IsDel == 0).ToList();
@@ -767,7 +767,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                 //卡类型
                 List<Sys_SetData> BankCard = _dataSouruce.Where(a => a.STid == 15).ToList();
-                List<SetDataInfoView> _BankCard = _mapper.Map<List<SetDataInfoView>>(BankCard);
+                List<SetDataCurrencyInfoView> _BankCard = _mapper.Map<List<SetDataCurrencyInfoView>>(BankCard);
 
                 //房间入住人类型 
                 List<Sys_SetData> CheckPerson = _dataSouruce.Where(a => a.STid == 71).ToList();

+ 40 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/TourClientListRepository.cs

@@ -0,0 +1,40 @@
+using AutoMapper;
+using OASystem.Domain;
+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
+{
+    /// <summary>
+    /// 接团客户名单 
+    /// 仓库
+    /// </summary>
+    public class TourClientListRepository :BaseRepository<Grp_TourClientList,TourClientListView>
+    {
+        private readonly Result _result;
+        private readonly IMapper _mapper;
+
+        public TourClientListRepository(SqlSugarClient sqlSugar, IMapper mapper)
+            : base(sqlSugar)
+        {
+            _result = new Result() { Code = -1, Msg = "操作失败!" };
+            _mapper = mapper;
+        }
+
+        /// <summary>
+        /// 根据团组Id获取
+        /// </summary>
+        /// <param name="portId"></param>
+        /// <param name="diId"></param>
+        /// <returns></returns>
+        public async Task<Result> _ItemByDiId(int portId, int diId)
+        {
+            return _result;
+        }
+    }
+}