diff --git a/backend/Magic.FlowCenter/Service/Flowinstance/FlcFlowinstanceService.cs b/backend/Magic.FlowCenter/Service/Flowinstance/FlcFlowinstanceService.cs index ad9bf30f4c6fecca4951f94835f4213c69705715..5601e6816ae21005f81039a91799c7d25060da59 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; }