|
@ -1,7 +1,6 @@ |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.ComponentModel.DataAnnotations; |
|
|
using System.ComponentModel.DataAnnotations; |
|
|
using System.Diagnostics; |
|
|
|
|
|
using System.Globalization; |
|
|
using System.Globalization; |
|
|
using System.IO; |
|
|
using System.IO; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
@ -22,8 +21,6 @@ using Microsoft.EntityFrameworkCore; |
|
|
using Microsoft.Extensions.Configuration; |
|
|
using Microsoft.Extensions.Configuration; |
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
using Microsoft.OpenApi.Extensions; |
|
|
using Microsoft.OpenApi.Extensions; |
|
|
using Omu.ValueInjecter; |
|
|
|
|
|
using Polly; |
|
|
|
|
|
using RestSharp.Extensions; |
|
|
using RestSharp.Extensions; |
|
|
using SettleAccount.Job.SignalR; |
|
|
using SettleAccount.Job.SignalR; |
|
|
using SqlSugar; |
|
|
using SqlSugar; |
|
@ -36,7 +33,6 @@ using Volo.Abp.Validation; |
|
|
using Win.Sfs.BaseData.ImportExcelCommon; |
|
|
using Win.Sfs.BaseData.ImportExcelCommon; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; |
|
|
using Win.Sfs.SettleAccount.influxdb; |
|
|
|
|
|
using Win.Sfs.Shared.Filter; |
|
|
using Win.Sfs.Shared.Filter; |
|
|
using Win.Sfs.Shared.RepositoryBase; |
|
|
using Win.Sfs.Shared.RepositoryBase; |
|
|
|
|
|
|
|
@ -216,8 +212,23 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen |
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
public async Task<PagedResultDto<VmiLog>> Log(LogRequestDto input) |
|
|
public async Task<PagedResultDto<VmiLog>> Log(LogRequestDto input) |
|
|
{ |
|
|
{ |
|
|
var entities = await _logRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); |
|
|
using var scope = this._serviceProvider.CreateScope(); |
|
|
var totalCount = await _logRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); |
|
|
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>(); |
|
|
|
|
|
var format = "yyyy-MM-dd HH:mm:ssT"; |
|
|
|
|
|
var startValue = input.Filters.FirstOrDefault(o => o.Column == "billTime" && o.Action == EnumFilterAction.BiggerThanOrEqual).Value; |
|
|
|
|
|
var endValue = input.Filters.FirstOrDefault(o => o.Column == "billTime" && o.Action == EnumFilterAction.BiggerThanOrEqual).Value; |
|
|
|
|
|
var start = DateTime.Parse(startValue); |
|
|
|
|
|
var end = DateTime.Parse(endValue); |
|
|
|
|
|
var sql = $"select * from Set_VmiLog"; |
|
|
|
|
|
var query = db.Set<VmiLog>().FromSqlRaw(sql); |
|
|
|
|
|
var filters = input.Filters.ToLambda<VmiLog>(); |
|
|
|
|
|
if (input.Filters.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
query = query.Where(input.Filters.ToLambda<VmiLog>()); |
|
|
|
|
|
} |
|
|
|
|
|
var totalCount = query.Count(); |
|
|
|
|
|
query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting); |
|
|
|
|
|
var entities = await query.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false); |
|
|
return new PagedResultDto<VmiLog>(totalCount, entities); |
|
|
return new PagedResultDto<VmiLog>(totalCount, entities); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -344,6 +355,7 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen |
|
|
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); |
|
|
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); |
|
|
return fileName; |
|
|
return fileName; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private List<T> ImportInternal<T>(byte[] data) |
|
|
private List<T> ImportInternal<T>(byte[] data) |
|
|
{ |
|
|
{ |
|
|
var list = new List<T>(); |
|
|
var list = new List<T>(); |
|
|