From e748469bb8927d25bbeba75b3438567697eb9cca Mon Sep 17 00:00:00 2001 From: mol2028 <9648159+mol2028@user.noreply.gitee.com> Date: Thu, 30 Nov 2023 07:00:42 +0000 Subject: [PATCH] update backend/Magic.FlowCenter/Service/Flowinstance/FlcFlowinstanceService.cs. Signed-off-by: mol2028 <9648159+mol2028@user.noreply.gitee.com> --- .../Service/Flowinstance/FlcFlowinstanceService.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/Magic.FlowCenter/Service/Flowinstance/FlcFlowinstanceService.cs b/backend/Magic.FlowCenter/Service/Flowinstance/FlcFlowinstanceService.cs index ad9bf30..5601e68 100644 --- a/backend/Magic.FlowCenter/Service/Flowinstance/FlcFlowinstanceService.cs +++ b/backend/Magic.FlowCenter/Service/Flowinstance/FlcFlowinstanceService.cs @@ -1,4 +1,4 @@ -using Furion; +using Furion; using Furion.DependencyInjection; using Furion.DynamicApiController; using Furion.FriendlyException; @@ -48,7 +48,8 @@ public class FlcFlowinstanceService : IFlcFlowinstanceService .WhereIF(!string.IsNullOrWhiteSpace(input.ActivityId), u => u.ActivityId == input.ActivityId) .WhereIF(!string.IsNullOrWhiteSpace(input.ActivityName), u => u.ActivityName == input.ActivityName) .WhereIF(!string.IsNullOrWhiteSpace(input.PreviousId), u => u.PreviousId == input.PreviousId) - .Where(u => u.IsDeleted == false); + .Where(u => u.IsDeleted == false) + .OrderByDescending(u => u.CreatedTime); if (input.LookType == 1) //待办事项 { query = query.Where(a => (a.MakerList == "1" || a.MakerList.Contains(userId.ToString())) && (a.IsFinish == 0 || a.IsFinish == 4) && a.ActivityType < 3); @@ -80,7 +81,10 @@ public class FlcFlowinstanceService : IFlcFlowinstanceService { entity.WebId = entity.DbName.Substring(0, 1).ToLower() + entity.DbName.Substring(1); } - entity.hisList = await _rep.Change().Where(a => a.InstanceId == id).OrderBy(a => a.CreatedTime).ToListAsync(); + entity.hisList = await _rep.Change() + .Where(a => a.InstanceId == id) + .OrderByDescending(a => a.CreatedTime) + .ToListAsync(); return entity; } -- Gitee