Browse Source

接团客户信息
新增Info ,Item

leiy 1 year ago
parent
commit
aace472ccc

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

@@ -65,6 +65,8 @@ namespace OASystem.API.Controllers
         private readonly CustomersRepository _customersRep;
         private readonly MessageRepository _message;
         private readonly SqlSugarClient _sqlSugar;
+        private readonly TourClientListRepository _tourClientListRep;
+
         #region 成本相关
         private readonly CheckBoxsRepository _checkBoxs;
         private readonly GroupCostRepository _GroupCostRepository;
@@ -83,7 +85,8 @@ namespace OASystem.API.Controllers
             InvitationOfficialActivitiesRepository InvitationOfficialActivitiesRep, DelegationEnDataRepository delegationEnDataRep, EnterExitCostRepository enterExitCostRep
             , DelegationVisaRepository delegationVisaRep, MessageRepository message, VisaPriceRepository visaPriceRep, CarTouristGuideGroundRepository carTouristGuideGroundRep,
             CheckBoxsRepository checkBoxs, GroupCostRepository GroupCostRepository, CostTypeHotelNumberRepository CostTypeHotelNumberRepository,
-            GroupCostParameterRepository GroupCostParameterRepository, HotelPriceRepository hotelPriceRep, CustomersRepository customersRep, SetDataRepository setDataRep)
+            GroupCostParameterRepository GroupCostParameterRepository, HotelPriceRepository hotelPriceRep, CustomersRepository customersRep, SetDataRepository setDataRep,
+            TourClientListRepository tourClientListRep)
         {
             _mapper = mapper;
             _grpScheduleRep = grpScheduleRep;
@@ -112,6 +115,7 @@ namespace OASystem.API.Controllers
             _hotelPriceRep = hotelPriceRep;
             _customersRep = customersRep;
             _setDataRep = setDataRep;
+            _tourClientListRep = tourClientListRep;
         }
 
         #region 流程管控
@@ -5405,5 +5409,76 @@ namespace OASystem.API.Controllers
             }
         }
         #endregion
+
+        #region 接团客户名单 PageId 104
+
+        /// <summary>
+        /// 接团客户名单
+        /// 根据团组Id查询List
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<IActionResult> TourClientListByDiId(TourClientListByDiIdDto _dto)
+        {
+            #region  参数验证
+            if (_dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId"));
+            if (_dto.PageId < 1) _dto.PageId = 104; //接团客户名单PageId
+            if (_dto.DiId < 1) return Ok(JsonView(false, "请传入有效的DiId!"));
+
+            PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
+
+            #region 页面操作权限验证
+            pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
+
+            if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限!"));
+            #endregion
+
+            #endregion
+
+            var viewData = await _tourClientListRep._ItemByDiId(_dto.PortType,_dto.DiId);
+            if (viewData.Code != 0)
+            {
+                return Ok(JsonView(false, viewData.Msg));
+            }
+
+            return Ok(JsonView(viewData.Data));
+        }
+
+        /// <summary>
+        /// 接团客户名单
+        /// 根据 Id查询 Details
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<IActionResult> TourClientListDetails(TourClientListDetailsDto _dto)
+        {
+
+            #region  参数验证
+            if (_dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数"));
+            if (_dto.PageId < 1) _dto.PageId = 104; //接团客户名单PageId
+            if (_dto.Id < 1) return Ok(JsonView(false, "请传入有效的Id参数!"));
+
+            PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
+
+            #region 页面操作权限验证
+            pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
+
+            if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限!"));
+            #endregion
+
+            #endregion
+
+            var viewData = await _tourClientListRep._Details(_dto.PortType, _dto.Id);
+            if (viewData.Code != 0)
+            {
+                return Ok(JsonView(false, viewData.Msg));
+            }
+
+            return Ok(JsonView(viewData.Data));
+        }
+
+        #endregion
     }
 }

+ 3 - 1
OASystem/OASystem.Api/OAMethodLib/JsonConvertOverride.cs

@@ -5,7 +5,7 @@ using System.Text.Json.Serialization;
 namespace OASystem.API.OAMethodLib
 {
 
-    #region 日期格式转换
+    #region 日期格式转换("yyyy-MM-dd HH;mm:ss")
 
     public class DateTimeJsonConverter : System.Text.Json.Serialization.JsonConverter<DateTime>
     {
@@ -36,6 +36,8 @@ namespace OASystem.API.OAMethodLib
     }
     #endregion
 
+
+
     #region String null值转换(读/写)
 
 

+ 30 - 0
OASystem/OASystem.Domain/DateOnlyConverter.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.Json.Serialization;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain
+{
+    /// <summary>
+    /// datetime 返回日期 格式 yyyy-MM-dd
+    /// </summary>
+    public class DateOnlyConverter : JsonConverter<DateTime>
+    {
+        public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+        {
+            throw new NotImplementedException();
+        }
+
+        public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options)
+        {
+            writer.WriteStringValue(value.ToString("yyyy-MM-dd"));
+        }
+    }
+
+
+
+}
+

+ 34 - 0
OASystem/OASystem.Domain/Dtos/Groups/TourClientListDto.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Groups
+{
+    /// <summary>
+    /// 接团客户名单
+    /// </summary>
+    public class TourClientListDto
+    {
+    }
+
+
+    /// <summary>
+    /// 接团客户名单
+    /// 根据团组Id查询List
+    /// </summary>
+    public class TourClientListByDiIdDto : UserPageFuncDtoBase
+    {
+        public int DiId { get; set; }
+    }
+
+    /// <summary>
+    /// 接团客户名单
+    /// 根据Id 查询 Details
+    /// </summary>
+    public class TourClientListDetailsDto : UserPageFuncDtoBase
+    {
+        public int Id { get; set; }
+    }
+}

+ 9 - 0
OASystem/OASystem.Domain/Entities/Customer/Crm_CustomerCert.cs

@@ -17,11 +17,20 @@ namespace OASystem.Domain.Entities.Customer
         /// </summary>
         [SugarColumn(IsNullable =true,ColumnDataType ="int")]
         public int DcId { get; set; }
+
         /// <summary>
         /// 证件类型表Id
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
         public int SdId { get; set; }
+
+        /// <summary>
+        /// 护照类型 Id(数据类型表Id)
+        /// SdId == 74 该字段有值
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int PassportType { get; set; }
+
         /// <summary>
         /// 证件号
         /// </summary>

+ 182 - 1
OASystem/OASystem.Domain/ViewModels/Groups/TourClientListView.cs

@@ -1,7 +1,10 @@
-using OASystem.Domain.Entities.Groups;
+using Google.Protobuf;
+using Newtonsoft.Json;
+using OASystem.Domain.Entities.Groups;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.Serialization;
 using System.Text;
 using System.Threading.Tasks;
 
@@ -14,5 +17,183 @@ namespace OASystem.Domain.ViewModels.Groups
     {
     }
 
+    /// <summary>
+    /// 接团客户名单
+    /// 根据团组Id查询List
+    /// View
+    /// </summary>
+    public class TourClientListByDiIdView
+    {
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 姓
+        /// </summary>
+        public string? LastName { get; set; }
+
+        /// <summary>
+        /// 名
+        /// </summary>
+        public string? FirstName { get; set; }
+
+        /// <summary>
+        /// 公司名全称
+        /// </summary>
+        public string? CompanyFullName { get; set; }
+
+        /// <summary>
+        /// 职位
+        /// </summary>
+        public string? Job { get; set; }
+
+        /// <summary>
+        /// 身份证No
+        /// </summary>
+        public string? IDCardNo { get; set; }
+
+        /// <summary>
+        /// 性别
+        /// 0 男1 女 其他值 未设置
+        /// </summary>
+        public int Sex { get; set; }
+
+
+        /// <summary>
+        /// 性别
+        /// 0 男1 女 其他值 未设置
+        /// </summary>
+        public string? SexStr
+        {
+            get
+            {
+                string str = "未设置";
+                if (Sex == 0) str = "男";
+                else if (Sex == 1) str = "女";
+                return str;
+            }
+        }
+    }
+
+    /// <summary>
+    /// 接团客户名单
+    /// 根据团组Id查询List
+    /// View
+    /// </summary>
+    public class TourClientListDetailsView
+    {
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 姓
+        /// </summary>
+        public string? LastName { get; set; }
 
+        /// <summary>
+        /// 名
+        /// </summary>
+        public string? FirstName { get; set; }
+
+        /// <summary>
+        /// 姓名拼音
+        /// 姓/名 eg: LEI/YI
+        /// </summary>
+        public string? Pinyin { get; set; }
+
+        /// <summary>
+        /// 性别
+        /// 0 男1 女 其他值 未设置
+        /// </summary>
+        public int Sex { get; set; }
+
+        /// <summary>
+        /// 性别
+        /// 0 男1 女 其他值 未设置
+        /// </summary>
+        public string? SexStr
+        {
+            get
+            {
+                string str = "未设置";
+                if (Sex == 0) str = "男";
+                else if (Sex == 1) str = "女";
+                return str;
+            }
+        }
+
+        /// <summary>
+        /// 公司名全称
+        /// </summary>
+        public string? CompanyFullName { get; set; }
+
+        /// <summary>
+        /// 职位
+        /// </summary>
+        public string? Job { get; set; }
+
+        /// <summary>
+        /// 身份证No
+        /// </summary>
+        public string? IDCardNo { get; set; }
+
+        /// <summary>
+        /// 生日
+        /// </summary>
+        [JsonConverter(typeof(DateOnlyConverter))]
+        public DateTime BirthDay { get; set; }
+
+        /// <summary>
+        /// 护照类型Id(数据类型表Id)
+        /// </summary>
+        public int PassportType { get; set; }
+
+        /// <summary>
+        /// 护照No
+        /// </summary>
+        public string? PassportNo { get; set; }
+
+        /// <summary>
+        /// 签发国
+        /// </summary>
+        public string? Country { get; set; }
+
+        /// <summary>
+        /// 签发地区
+        /// </summary>
+        public string? Area { get; set; }
+
+        /// <summary>
+        /// 签发时间
+        /// </summary>
+        public DateTime? IssueDt { get; set; }
+
+        /// <summary>
+        /// 有效期限
+        /// </summary>
+        public DateTime? ExpiryDt { get; set; }
+
+        /// <summary>
+        /// 舱位类型(数据类型表Id)
+        /// </summary>
+        public int ShippingSpaceTypeId { get; set; }
+
+        /// <summary>
+        /// 舱位特殊需求
+        /// </summary>
+        public string? ShippingSpaceSpecialNeeds { get; set; }
+
+        /// <summary>
+        /// 酒店特殊需求
+        /// </summary>
+        public string? HotelSpecialNeeds { get; set; }
+
+        /// <summary>
+        /// 餐食特殊需求
+        /// </summary>
+        public string? MealSpecialNeeds { get; set; }
+
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string? Remark { get; set; }
+    }
 }

+ 56 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/TourClientListRepository.cs

@@ -27,14 +27,69 @@ namespace OASystem.Infrastructure.Repositories.Groups
         }
 
         /// <summary>
-        /// 根据团组Id获取
+        /// 根据团组Id查询List
         /// </summary>
         /// <param name="portId"></param>
         /// <param name="diId"></param>
         /// <returns></returns>
         public async Task<Result> _ItemByDiId(int portId, int diId)
         {
+            if (portId == 1 || portId == 2 || portId == 3 ) // 1 web 2 Android 3 ios
+            {
+                string sql = string.Format(@"Select tcl.Id,tcl.DiId,temp.* From Grp_TourClientList tcl
+                                                 Left Join 
+	                                                 (Select dc.Id As DcId,dc.LastName,dc.FirstName,ccom.CompanyFullName,dc.Job,cc.CertNo As IDCardNo,dc.Sex 
+	                                                 From Crm_DeleClient dc
+	                                                 Left Join Crm_CustomerCompany ccom On dc.CrmCompanyId = ccom.Id  And ccom.IsDel = 0
+	                                                 Left Join Crm_CustomerCert cc On dc.Id = cc.DcId And cc.SdId = 773 And cc.IsDel = 0
+	                                                 Where dc.IsDel = 0) temp 
+                                                 On temp.DcId =tcl.ClientId  
+                                                 Where tcl.IsDel = 0 And tcl.DiId = {0}", diId);
+                var data = await _sqlSugar.SqlQueryable<TourClientListByDiIdView>(sql).ToListAsync();
+                _result.Code = 0;
+                _result.Data = data;
+            }
+            else
+            {
+                _result.Msg = "请传入有效的PortType参数,1 Web 2 Android 3 IOS!";
+            }
             return _result;
         }
+
+        /// <summary>
+        /// 根据Id查询Details
+        /// </summary>
+        /// <param name="portId"></param>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        public async Task<Result> _Details(int portId, int id)
+        {
+            if (portId == 1 || portId == 2 || portId == 3) // 1 web 2 Android 3 ios
+            {
+                string sql = string.Format(@"Select tcl.Id,tcl.DiId,temp.*,tcl.ShippingSpaceTypeId,tcl.ShippingSpaceSpecialNeeds,
+                                             tcl.HotelSpecialNeeds,tcl.MealSpecialNeeds,tcl.Remark
+                                             From Grp_TourClientList tcl
+                                             Left Join 
+	                                             (Select dc.Id As DcId,dc.LastName,dc.FirstName,dc.Pinyin,dc.Sex,ccom.CompanyFullName,dc.Job,
+	                                                 cc1.CertNo As IDCardNo,dc.Phone,dc.BirthDay,cc2.PassportType,cc2.CertNo As PassportNo,cc2.Country,
+	                                                 cc2.Area,cc2.IssueDt,cc2.ExpiryDt
+	                                                 From Crm_DeleClient dc
+	                                                 Left Join Crm_CustomerCompany ccom On dc.CrmCompanyId = ccom.Id  And ccom.IsDel = 0
+	                                                 Left Join Crm_CustomerCert cc1 On dc.Id = cc1.DcId And cc1.SdId = 773 And cc1.IsDel = 0
+	                                                 Left Join Crm_CustomerCert cc2 On dc.Id = cc2.DcId And cc2.SdId = 774 And cc2.IsDel = 0
+	                                                 Where dc.IsDel = 0) temp 
+                                             On temp.DcId =tcl.ClientId  
+                                             Where tcl.IsDel = 0 And tcl.Id = {0}", id);
+                var data = await _sqlSugar.SqlQueryable<TourClientListDetailsView>(sql).FirstAsync();
+                _result.Code = 0;
+                _result.Data = data;
+            }
+            else
+            {
+                _result.Msg = "请传入有效的PortType参数,1 Web 2 Android 3 IOS!";
+            }
+            return _result;
+        }
+
     }
 }