From 5adbb97c5c0d33761565352bba83b3978d157a9f Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 23 Sep 2024 11:45:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9C=BA=E6=9E=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/Sys/Dtos/ApiSelectViewModel.cs | 17 +++++++++++++++++ .../DS.WMS.Core/Sys/Interface/ICommonService.cs | 2 +- .../DS.WMS.Core/Sys/Method/CommonService.cs | 8 ++++---- .../Controllers/CommonController.cs | 2 +- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Sys/Dtos/ApiSelectViewModel.cs b/ds-wms-service/DS.WMS.Core/Sys/Dtos/ApiSelectViewModel.cs index 6c77616a..42871cb9 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Dtos/ApiSelectViewModel.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Dtos/ApiSelectViewModel.cs @@ -14,4 +14,21 @@ public class ApiSelectViewModel /// /// public long Value { get; set; } +} + + +/// +/// 机构远程Api 下拉选项 +/// +public class OrgApiSelectViewModel +{ + /// + /// + /// + public string Label { get; set; } + + /// + /// + /// + public long Id { get; set; } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs index 9757c685..6366d7e5 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs @@ -101,7 +101,7 @@ public interface ICommonService /// 获取机构下拉列表 /// /// - DataResult> GetOrgList(string queryKey = ""); + DataResult> GetOrgList(string queryKey = ""); /// /// 获取商品类型下拉列表 /// diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs index 0d9140ae..8f56e044 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs @@ -967,19 +967,19 @@ public class CommonService : ICommonService /// 获取机构下拉列表 /// /// - public DataResult> GetOrgList(string queryKey = "") + public DataResult> GetOrgList(string queryKey = "") { var list = db.Queryable().Where(a => a.Status == StatusEnum.Enable && a.IsDepartment == false) .WhereIF(!string.IsNullOrEmpty(queryKey), a => (a.OrgName.Contains(queryKey) || a.OrgFullName.Contains(queryKey) || a.OrgEnName.Contains(queryKey))) - .Select(a => new ApiSelectViewModel + .Select(a => new OrgApiSelectViewModel { Label = a.OrgName, - Value = a.Id, + Id = a.Id, }) .Take(20) .WithCache($"{SqlSugarCacheConst.Org}{user.TenantId}") .ToList(); - return DataResult>.Success("获取数据成功!", list); + return DataResult>.Success("获取数据成功!", list); } #endregion 获取机构下拉列表 diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/CommonController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/CommonController.cs index cab90aa1..9250e254 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/CommonController.cs +++ b/ds-wms-service/DS.WMS.MainApi/Controllers/CommonController.cs @@ -164,7 +164,7 @@ public class CommonController : ApiController /// [HttpGet] [Route("GetOrgList")] - public DataResult> GetOrgList([FromQuery] string queryKey = "") + public DataResult> GetOrgList([FromQuery] string queryKey = "") { var res = _invokeService.GetOrgList(queryKey); return res;