任务大厅--已完成任务修改

FileMonitor
洁 任 2024-11-14 10:08:17 +08:00
parent ee6f3ed143
commit 743560d306
3 changed files with 32 additions and 9 deletions

View File

@ -14,6 +14,7 @@ using DocumentFormat.OpenXml.Office2010.CustomUI;
using NPOI.OpenXmlFormats.Dml;
using Infrastructure.Extensions;
using Moq;
using OpenAuth.App.ServiceApp.InsTaskHallManager.Response;
namespace OpenAuth.App.ServiceApp.InsTaskHallManager
{
@ -54,16 +55,23 @@ namespace OpenAuth.App.ServiceApp.InsTaskHallManager
/// 完成任务
/// </summary>
/// <returns></returns>
public async Task<List<dynamic>> GetCompleteTaskList()
public async Task<List<InsTaskRes>> GetCompleteTaskList()
{
var query = await client.Queryable<InsTask>().Where(r => r.IsCompleted == true&&r.CompleteTime!=null)
.OrderByDescending(r => r.CompleteTime)
.GroupBy(r=>r.CompleteTime.ToString("yyyy-MM-dd"))
.Select<dynamic>(r => new
.Select(r => new
{
count = SqlFunc.AggregateCount(r.Id),
time= r.CompleteTime.ToString("yyyy-MM-dd")
}).ToListAsync();
id=r.Id,
datetime= r.CompleteTime.Value.Date
})
.MergeTable()
.GroupBy(r=>r.datetime)
.Select(r => new InsTaskRes
{
count = SqlFunc.AggregateCount(r.id),
time= r.datetime
})
.MergeTable().OrderBy(r => r.time)
.ToListAsync();
return query;
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenAuth.App.ServiceApp.InsTaskHallManager.Response
{
public class InsTaskRes
{
public int count { get; set; }
public DateTime time { get; set; }
}
}

View File

@ -1,6 +1,7 @@
using Infrastructure;
using Microsoft.AspNetCore.Mvc;
using OpenAuth.App.ServiceApp.InsTaskHallManager;
using OpenAuth.App.ServiceApp.InsTaskHallManager.Response;
using OpenAuth.App.SysDatabaseLink;
namespace OpenAuth.WebApi.Controllers.ServiceControllers
@ -43,9 +44,9 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<Response<List<dynamic>>> GetCompleteTaskList()
public async Task<Response<List<InsTaskRes>>> GetCompleteTaskList()
{
var result = new Response<List<dynamic>>();
var result = new Response<List<InsTaskRes>>();
try
{
result.Result = await _app.GetCompleteTaskList();