任务大厅--已完成任务修改
parent
ee6f3ed143
commit
743560d306
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue