From 5a6fd7eaaa8673f5cf47c57778bb29111bff453f Mon Sep 17 00:00:00 2001 From: marvinhong Date: Wed, 13 Oct 2021 18:24:27 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=B5=81=E7=A8=8B=E8=A7=84?= =?UTF-8?q?=E5=88=99=E7=9A=84=E8=B5=84=E6=96=99=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AMESCoreStudio.WebApi/Controllers/BAS/RulesController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AMESCoreStudio.WebApi/Controllers/BAS/RulesController.cs b/AMESCoreStudio.WebApi/Controllers/BAS/RulesController.cs index e886b68b..21a51d96 100644 --- a/AMESCoreStudio.WebApi/Controllers/BAS/RulesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BAS/RulesController.cs @@ -73,7 +73,7 @@ namespace AMESCoreStudio.WebApi.Controllers.BAS CurrStationId = q2.StationID, NextStationId = q3.StationID }; - query.OrderBy(p => p.RuleStationID + p.RuleSeq); + query = query.OrderBy(p => p.RuleStationID + p.RuleSeq); var qdata = await query.ToListAsync(); int[] list = new int[qdata.Count]; @@ -92,7 +92,7 @@ namespace AMESCoreStudio.WebApi.Controllers.BAS IQueryable q = _context.Ruleses; //q = q.Where(p => list.Contains(p.RuleStationID) && status1.Contains(p.RuleStatus)); q = q.Where(p => list.Contains(p.RuleStationID)); - q = q.OrderBy(o => o.RuleSeq); + q = q.OrderBy(o => o.RuleStationID + o.RuleSeq); var rules = await q.ToListAsync(); @@ -100,7 +100,7 @@ namespace AMESCoreStudio.WebApi.Controllers.BAS { //rules[j].CurrStation = _context.Stationses.Where(p1 => p1.StationID.Equals(list1[j])).FirstOrDefault(); rules[j].RuleDesc = _context.Stationses.Where(p1 => p1.StationID.Equals(list1[j])).FirstOrDefault().StationName; - rules[j].NextStation = _context.Stationses.Where(p1 => p1.StationID.Equals(list2[j])).FirstOrDefault(); + rules[j].NextStation = _context.Stationses.Where(p2 => p2.StationID.Equals(list2[j])).FirstOrDefault(); } if (rules == null)