From 15eb82df2d6ec539e9d4245bfe08d531e8eb6379 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期日, 27 四月 2025 14:33:26 +0800 Subject: [PATCH] 修改培训订单占多个座位 --- zhengcaioa/Services/ExpertTestTopicService.cs | 37 +++++++++++++++++++++++++++++-------- 1 files changed, 29 insertions(+), 8 deletions(-) diff --git a/zhengcaioa/Services/ExpertTestTopicService.cs b/zhengcaioa/Services/ExpertTestTopicService.cs index 2b69280..2b227c6 100644 --- a/zhengcaioa/Services/ExpertTestTopicService.cs +++ b/zhengcaioa/Services/ExpertTestTopicService.cs @@ -186,8 +186,7 @@ var listCode = (from a in _context.SysCodeDtls join b in _context.SysCodes on a.CodeId equals b.Id - where a.RecStatus == "A" - && b.RecStatus == "A" + where b.RecStatus == "A" select new CodeDataEntity() { CodeId = b.Id, @@ -281,7 +280,7 @@ && (string.IsNullOrWhiteSpace(searchEntity.Falv) || lll.Falv == searchEntity.Falv.Trim()) - + && (string.IsNullOrWhiteSpace(searchEntity.shanchuzhishitype) || a.Zhishitype == searchEntity.shanchuzhishitype.Trim()) select new ExpertTestTopicDTO @@ -408,9 +407,31 @@ /// <returns></returns> public List<ExpertTestTopicDTO> GetList() { + var listCode = (from a in _context.SysCodeDtls + join b in _context.SysCodes + on a.CodeId equals b.Id + where a.RecStatus == "A" && b.RecStatus == "A" + select new CodeDataEntity() + { + CodeId = b.Id, + CodeTable = b.CodeTable, + CodeField = b.CodeField, + CodeSn = a.CodeSn, + Comments = a.Comments, + Contents = a.Contents, + RecStatus = a.RecStatus, + Sort = a.Sort + } + ); - - var listRole = _context.ExpertTestTopics.Where(r => r.RecStatus == "A").ToList(); + var listRole = + ( from a in _context.ExpertTestTopics.Where(r => r.RecStatus == "A") + join f in listCode.Where(x => x.CodeTable == "expert_test_topic" && x.CodeField == "zhishitype") + on a.Zhishitype equals f.CodeSn + + + + select a ).ToList(); var list = _mapper.Map<List<ExpertTestTopicDTO>>(listRole); @@ -837,8 +858,8 @@ join f in listCode.Where(x => x.CodeTable == "expert_test_topic" && x.CodeField == "zhishitype") on a.Zhishitype equals f.CodeSn - into fsssss - from fff in fsssss.DefaultIfEmpty() + //into fsssss + // from fff in fsssss.DefaultIfEmpty() where a.RecStatus == "A" @@ -850,7 +871,7 @@ Topictype = a.Topictype, TopictypeName = eee.Comments, Zhishitype = a.Zhishitype, - ZhishitypeName = fff.Comments, + ZhishitypeName = f.Comments, Fenshu = a.Fenshu ?? 0, Fenzhi = a.Fenzhi??0, FenshuName = (a.Fenshu ?? 0).ToString("0.##"), -- Gitblit v1.9.1