Explorar o código

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

LEIYI hai 3 meses
pai
achega
38f6d7e2dd

+ 21 - 9
OASystem/OASystem.Api/Controllers/MarketCustomerResourcesController.cs

@@ -3,6 +3,7 @@ using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Dtos.CRM;
 using OASystem.Domain.Entities.Customer;
 using OASystem.Infrastructure.Repositories.CRM;
+using System.Collections;
 using System.Diagnostics;
 
 namespace OASystem.API.Controllers
@@ -340,19 +341,30 @@ namespace OASystem.API.Controllers
             keyValuePairs.Add(625, new List<int>() { 617, 618, 619, 620, 621, 622, 622, 623, 624, 754 }); // 甘肃
             keyValuePairs.Add(634, new List<int>() { 455, 630, 631, 632, 633, 754 }); // 新疆
 
-
-            if (keyValuePairs.Keys.Contains(Dto.SetDataId))
+            ArrayList arr = new ArrayList();
+            var ids = new List<int>();
+            foreach (var item in Dto.SetDataIdArr)
             {
-                jw.Data = _sqlSugar.Queryable<Sys_SetData>()
-                    .Where(u => keyValuePairs[Dto.SetDataId].Contains(u.Id) && u.IsDel == 0 )
-                    .Select(x => new { x.Id, x.Name }).ToList();
+                if (keyValuePairs.Keys.Contains(item))
+                {
+                    ids.AddRange(keyValuePairs[item]);
+                }
             }
-            else
+
+            arr.AddRange(_sqlSugar.Queryable<Sys_SetData>()
+                       .Where(u => ids.Contains(u.Id) && u.IsDel == 0)
+                       .Select(x => new { x.Id, x.Name })
+                       .ToList());
+
+            if (arr.Count == 0)
             {
-                jw.Data = _sqlSugar.Queryable<Sys_SetData>()
-                    .Where(u => u.STid == 37 && u.IsDel == 0)
-                    .Select(x => new { x.Id, x.Name }).ToList(); 
+                arr.AddRange(_sqlSugar.Queryable<Sys_SetData>()
+                        .Where(u => u.STid == 37 && u.IsDel == 0)
+                        .Select(x => new { x.Id, x.Name }).ToList());
             }
+
+            jw.Data = arr;
+            
             return Ok(jw);
         }
     }

+ 1 - 1
OASystem/OASystem.Domain/Dtos/CRM/NewClientDataQueryDto.cs

@@ -225,6 +225,6 @@ namespace OASystem.Domain.Dtos.CRM
 
     public class QueryClientTypeDto
     {
-        public int SetDataId { get; set; }
+        public List<int> SetDataIdArr { get; set; }
     }
 }