From aaee68302597e7bf22d200062f7c787b836af292 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Thu, 29 Jun 2023 14:04:04 +0800 Subject: [PATCH] bug --- system/Tnb.Systems/System/PrintDevService.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/system/Tnb.Systems/System/PrintDevService.cs b/system/Tnb.Systems/System/PrintDevService.cs index 9af13070..98c3d510 100644 --- a/system/Tnb.Systems/System/PrintDevService.cs +++ b/system/Tnb.Systems/System/PrintDevService.cs @@ -90,9 +90,10 @@ public class PrintDevService : IDynamicApiController, ITransient [HttpGet("")] public async Task GetList_Api([FromQuery] PrintDevListInput input) { - var list = await _repository.AsSugarClient().Queryable((a, b, c, d) => - new JoinQueryInfos(JoinType.Left, b.Id == a.CreatorUserId, JoinType.Left, c.Id == a.LastModifyUserId, JoinType.Left, a.Category == d.EnCode)) - .Where((a, b, c, d) => a.DeleteMark == null && d.DictionaryTypeId == "202931027482510597").WhereIF(input.category.IsNotEmptyOrNull(), a => a.Category == input.category) + var list = await _repository.AsSugarClient().Queryable((a, b, c, d,e) => + new JoinQueryInfos(JoinType.Left, b.Id == a.CreatorUserId, JoinType.Left, c.Id == a.LastModifyUserId,JoinType.Left,d.EnCode=="printDev", JoinType.Left, a.Category == e.EnCode && d.Id==e.DictionaryTypeId)) + .Where((a, b, c, d,e) => a.DeleteMark == null ) + .WhereIF(input.category.IsNotEmptyOrNull(), a => a.Category == input.category) .WhereIF(input.keyword.IsNotEmptyOrNull(), a => a.FullName.Contains(input.keyword) || a.EnCode.Contains(input.keyword)) .OrderBy(a => a.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc) .Select((a, b, c, d) => new PrintDevListOutput @@ -119,10 +120,10 @@ public class PrintDevService : IDynamicApiController, ITransient [HttpGet("Selector")] public async Task GetList_Api([FromQuery] string type) { - var list = await _repository.AsSugarClient().Queryable((a, b, c, d) => new JoinQueryInfos(JoinType.Left, b.Id == a.CreatorUserId, JoinType.Left, c.Id == a.LastModifyUserId, JoinType.Left, a.Category == d.EnCode)) - .Where((a, b, c, d) => a.DeleteMark == null && d.DictionaryTypeId == "202931027482510597" && a.EnabledMark == 1).OrderBy(a => a.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc) + var list = await _repository.AsSugarClient().Queryable((a, b, c, d,e) => new JoinQueryInfos(JoinType.Left, b.Id == a.CreatorUserId, JoinType.Left, c.Id == a.LastModifyUserId, JoinType.Left, d.EnCode=="printDev", JoinType.Left, a.Category == e.EnCode && d.Id==e.DictionaryTypeId)) + .Where((a, b, c, d) => a.DeleteMark == null && a.EnabledMark == 1).OrderBy(a => a.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc) .WhereIF(type.IsNotEmptyOrNull(), (a) => a.Type == type.ParseToInt()) - .Select((a, b, c, d) => new PrintDevListOutput + .Select((a, b, c, d,e) => new PrintDevListOutput { category = a.Category, id = a.Id, @@ -135,7 +136,7 @@ public class PrintDevService : IDynamicApiController, ITransient lastModifyUser = SqlFunc.MergeString(c.RealName, "/", c.Account), sortCode = a.SortCode, type = a.Type, - parentId = d.Id, + parentId = e.Id, }).ToListAsync(); // 数据库分类