Browse Source

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

jiangjc 10 months ago
parent
commit
19c7d6a319

+ 8 - 0
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -2130,6 +2130,14 @@ namespace OASystem.API.Controllers
                         decimal countCost = 0;
                         foreach (var item in AirTicketReservations)
                         {
+                            #region 处理客人姓名
+
+                            string clientNames = _tourClientListRep._ResolveCustomerName(item.ClientName);
+                            item.ClientName = clientNames;
+
+
+                            #endregion
+
                             if (item.BankType == "其他")
                             {
                                 item.BankNo = "--";

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/AirTicketResRepository.cs

@@ -887,7 +887,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                              Left Join Sys_SetData sd1 On sd1.Id = atr.ctype
                                              Left Join Sys_SetData sd2 On sd2.Id = atr.PreCurrency
                                              Left Join Sys_SetData sd3 On sd3.Id = atr.Currency
-                                             Where atr.IsDel = 0 And atr.DIId={0} And atr.CreateUserId = {1}
+                                             Where atr.IsDel = 0 And atr.DIId={0}
                                              Order By atr.FlightsDate Asc", dto.DiId);
                 List<AirTicketReservationsPayView> _AirTicketReservations = _sqlSugar.SqlQueryable<AirTicketReservationsPayView>(sql).ToList();
                 if (_AirTicketReservations.Count != 0)

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

@@ -1,5 +1,7 @@
 using AutoMapper;
 using MathNet.Numerics.Distributions;
+using NPOI.SS.Formula.PTG;
+using NPOI.Util;
 using OASystem.Domain;
 using OASystem.Domain.Dtos.CRM;
 using OASystem.Domain.Dtos.Groups;
@@ -957,5 +959,55 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
             return _result;
         }
+
+
+        /// <summary>
+        /// 分割客户名称
+        /// </summary>
+        /// <param name="ids"></param>
+        /// <returns></returns>
+        public string _ResolveCustomerName(string ids)
+        {
+            string clientStr = "";
+            if (string.IsNullOrEmpty(ids)) return clientStr;
+            List<int> intList = new List<int>();
+
+            //if (ids.Contains(","))
+            //{
+            //    string[] numbers = ids.Split(',');
+            //    foreach (string numberStr in numbers)
+            //    {
+            //        if (int.TryParse(numberStr.Trim(), out int number))
+            //        {
+            //            intList.Add(number);
+            //        }
+            //    }
+            //}
+            //else
+            //{
+            //    if (int.TryParse(ids.Trim(), out int number))
+            //    {
+            //        intList.Add(number);
+            //    }
+            //}
+
+            string sql = string.Format(@$"Select * From Crm_GroupCustomer Where IsDel = 0 And Id  In ({ids})");
+
+            var infos = _sqlSugar.SqlQueryable<Crm_GroupCustomer>(sql).ToList();
+
+            if (infos.Count > 0)
+            {
+                var infos1 = infos.Select(it => it.LastName + it.FirstName).ToList();
+                clientStr = string.Join(",", infos1);
+            }
+            return clientStr;
+        }
+
+        private class CustomerNameInfo
+        {
+            public int Id { get; set; }
+
+            public string  Name { get; set; }
+        }
     }
 }