Pārlūkot izejas kodu

优化客户和机票费用提示查询逻辑

在 `GroupsController.cs` 中,更新了客户列表查询,增加了对 `Crm_DeleClient` 和 `Crm_CustomerCompany` 的左连接,并解密 `CompanyFullName`。调整了舱位人数计算逻辑,排除陪同人员和特定公司。

修改了机票费用提示的获取逻辑,使用 `GeneralMethod` 中的 `EntryAndExitTips` 方法。

更新了 `appsettings.json` 中的 `KiMiSetting` 的 `Key` 值。

在 `GeneralMethod.cs` 中新增了处理机票费用提示和行程代码识别的逻辑。

新增 `groupClints` 类以表示客户信息,并在 `AirTicketReservationsView.cs` 中更新了 `EntryAndExitTipsView` 类,增加了 `tdcCurrentRate` 和 `TripDesc` 属性。

在 `GoodsRepository.cs` 中增加了对“全部团组”的处理逻辑,并在查询条件中引入了 `isAllGroups` 变量。

删除了 `TicketBlackCodeRepository.cs` 中的原有 `EntryAndExitTips` 方法,改为使用新的逻辑处理机票费用提示。
LEIYI 3 mēneši atpakaļ
vecāks
revīzija
5cc4012b97

+ 20 - 14
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -2123,21 +2123,27 @@ FROM
                 subTDC = otherFeeTotal + groupEnterExitCost.OutsideTDPay;
             }
 
-
             var groupClints = await _sqlSugar.Queryable<Grp_TourClientList>()
-                                             .LeftJoin<Sys_SetData>((x,s) => s.Id == x.ShippingSpaceTypeId && s.IsDel == 0 )
-                                             .Where((x, s) => x.DiId == dto.GroupId && x.IsDel == 0)
-                                             .Select((x, s) => new
-                                             {
-                                                 x.Id,
-                                                 s.Name,
-                                             })
-                                             .ToListAsync();
+                .LeftJoin<Sys_SetData>((x, s) => s.Id == x.ShippingSpaceTypeId && s.IsDel == 0)
+                .LeftJoin<Crm_DeleClient>((x, s, dc) => x.ClientId == dc.Id && dc.IsDel == 0)
+                .LeftJoin<Crm_CustomerCompany>((x, s, dc,cc) => dc.CrmCompanyId == cc.Id && cc.IsDel == 0)
+                .Where((x, s, dc, cc) => x.DiId == dto.GroupId && x.IsDel == 0)
+                .Select((x, s, dc, cc) => new groupClints
+                {
+                    Id =x.Id,
+                    Name =s.Name,
+                    IsAccompany =x.IsAccompany,
+                    CompanyFullName =cc.CompanyFullName
+                })
+                .ToListAsync();
+
+            groupClints.ForEach(x => x.CompanyFullName = AesEncryptionHelper.Decrypt(x.CompanyFullName));
 
             //获取舱位人数
-            var cabinCount = groupClints.GroupBy(x => x.Name)
-                                        .Select(x => new { Cabin = x.Key, Count = x.Count() })
-                                        .ToList();
+            var cabinCount = groupClints.Where(x => x.IsAccompany != 2 && !x.CompanyFullName.Contains("泛美国际"))
+                .GroupBy(x => x.Name)
+                .Select(x => new { Cabin = x.Key, Count = x.Count() })
+                .ToList();
 
             string cityPath = string.Empty;
             string startCity = string.Empty;
@@ -6750,7 +6756,7 @@ FROM
             //默认币种显示
             var reteInfos = await GeneralMethod.EnterExitCostLiveRate();
             var visaData = await _visaFeeInfoRep.EnterExitCostVisaTips(dto.DiId);
-            var airData = await _ticketBlackCodeRep.EntryAndExitTips(dto.DiId);
+            var airData = await GeneralMethod.EntryAndExitTips(dto.DiId);
             return Ok(JsonView(true, "查询成功!", new
             {
                 //GroupNameData = groupNameData.Data,
@@ -10614,7 +10620,7 @@ FROM
             }
             else if (dto.TipsType == 3)
             {
-                var airData = await _ticketBlackCodeRep.EntryAndExitTips(dto.GroupId);
+                var airData = await GeneralMethod.EntryAndExitTips(dto.GroupId);
                 return Ok(JsonView(true, "查询成功!", airData));
             }
             return Ok(JsonView(false));

+ 1 - 0
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -1840,6 +1840,7 @@ WHERE
             countyDatas.Insert(0, new { id = 0, name = "其他物资(公司内部物资)"});
             countyDatas.Insert(0, new { id = -1, name = "拜访客户所使用的物资" });
             countyDatas.Insert(0, new { id = -2, name = "库存调整" });
+            countyDatas.Insert(0, new { id = -3, name = "全部团组" });
             var total = countyDatas.Count;
             countyDatas = countyDatas.WhereIF(!string.IsNullOrEmpty(dto.Search), x => x.name.Contains(dto.Search)).ToList();
             countyDatas = countyDatas

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 87 - 3
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs


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

@@ -450,7 +450,8 @@
   "KiMiSetting": {
     "Model": "moonshot-v1-8k",
     "BaseUrl": "https://api.moonshot.cn/v1",
-    "Key": "sk-AY1Sv4rLnSUgGGHcC8SGSWYYKzGID7leZJcFfxAYozLC8dIc"
+    //"Key": "sk-AY1Sv4rLnSUgGGHcC8SGSWYYKzGID7leZJcFfxAYozLC8dIc
+    "Key": "sk-b6jgRbgU4ZtIFLkgMSjtHeU67q8OHzPTqIVuKuNLG50zd5IY" //leiyi kimi key
   },
   "OverspendAuditUser": [
     {

+ 13 - 0
OASystem/OASystem.Domain/Entities/Customer/Crm_DeleClient.cs

@@ -478,4 +478,17 @@ namespace OASystem.Domain.Entities.Customer
         public string PhD { get; set; }
     }
 
+
+    public class groupClints {
+        public int Id { get; set; }
+        public string Name { get; set; }
+        /// <summary>
+        /// 是否陪同
+        /// 1 否 2 是
+        /// 默认:1
+        /// </summary>
+        public int IsAccompany { get; set; }
+        [Encrypted]
+        public string CompanyFullName { get; set; }
+    }
 }

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

@@ -246,6 +246,8 @@ namespace OASystem.Domain.ViewModels.Groups
     {
         public decimal jjcCurrentRate { get; set; }
         public decimal gwcCurrentRate { get; set; }
+        public decimal tdcCurrentRate { get; set; }
         public string remark { get; set; }
+        public string TripDesc { get; set; }
     }
 }

+ 7 - 1
OASystem/OASystem.Infrastructure/Repositories/PersonnelModule/GoodsRepository.cs

@@ -1162,6 +1162,11 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                     .ToArray();
             }
 
+            //全部团组
+            bool isAllGroups = false;
+            if (groupLabel.Contains(-3)) isAllGroups = true;
+
+
             //物品ID和物品名称只能传一个
             if (dto.GoodsId > 0) dto.GoodsName = string.Empty;
             if (!string.IsNullOrEmpty(dto.GoodsName)) dto.GoodsId = 0;
@@ -1192,7 +1197,8 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                 .WhereIF(auditLabel.Length > 0, (gr, gi, sd, u1, u2, di) => auditLabel.Contains((int)gr.AuditStatus))
                 .WhereIF(typeLabel.Length > 0, (gr, gi, sd, u1, u2, di) => typeLabel.Contains(gi.Type))
                 .WhereIF(userLabel.Length > 0, (gr, gi, sd, u1, u2, di) => userLabel.Contains(gr.CreateUserId))
-                .WhereIF(groupLabel.Length > 0, (gr, gi, sd, u1, u2, di) => groupLabel.Contains(gr.GroupId))
+                .WhereIF(isAllGroups, (gr, gi, sd, u1, u2, di) => gr.GroupId > 0)
+                .WhereIF(!isAllGroups && groupLabel.Length > 0, (gr, gi, sd, u1, u2, di) => groupLabel.Contains(gr.GroupId))
                 .WhereIF(beginBool && endBool, (gr, gi, sd, u1, u2, di) => gr.CreateTime >= begin && gr.CreateTime <= end)
                 .WhereIF(hrAuditPer, (gr, gi, sd, u1, u2, di) => _goodsTypeIds.Contains(gi.Type))
                 .Select((gr, gi, sd, u1, u2, di) => new GoodsReceiveListMobileView

+ 1 - 24
OASystem/OASystem.Infrastructure/Repositories/Resource/TicketBlackCodeRepository.cs

@@ -173,30 +173,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
             }
         }
 
-        /// <summary>
-        /// 三公费用提示
-        /// 使用
-        /// </summary>
-        /// <param name="diId"></param>
-        /// <returns></returns>
-        public async Task<EntryAndExitTipsView[]> EntryAndExitTips(int diId)
-        {
-            if (diId < 1) return  Array.Empty<EntryAndExitTipsView>();
-
-            var airFees = await _sqlSugar.Queryable<Air_TicketBlackCode>().Where(a => a.IsDel == 0 && a.DiId == diId).ToListAsync();
-
-            if (airFees.Any())
-            {
-                return airFees.OrderByDescending(x => x.ECPrice + x.BCPrice).Select(x => new EntryAndExitTipsView
-                {
-                    jjcCurrentRate = x.ECPrice,
-                    gwcCurrentRate = x.BCPrice,
-                    remark = $"经济舱全价:{x.ECPrice.ToString("#0.00")} 元/人 公务舱全价:{x.BCPrice.ToString("#0.00")} 元/人"
-                }).ToArray();
-            }
-
-            return Array.Empty<EntryAndExitTipsView>();
-        }
+        
 
         public Result DescBlackToVisa(int diid)
         {