Browse Source

update

master
wanggang 1 year ago
parent
commit
7c56c196b7
  1. 5
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  2. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/log.js
  3. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

5
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js

@ -801,6 +801,11 @@ export default {
//
getSortModel(queryModel.value);
filterList.value = queryModel.value?.filters ?? [];
filterList.value.forEach((o) => {
if (o.default) {
o.value = o.default.constructor === Function ? o.default() : o.default;
}
});
getColumns(config.table.schema);
// if (props.query) {
// Object.assign(queryModel.value.query, props.query);

8
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/log.js

@ -1,4 +1,5 @@
import { useLogSchema } from "./vmi.js";
import { dayjs } from "element-plus";
const schema = useLogSchema();
@ -19,6 +20,7 @@ const importMethod = "POST";
const exportMethod = "POST";
export default function () {
console.log(dayjs);
return {
query: {
url: queryUrl,
@ -100,14 +102,18 @@ export default function () {
value: null,
readOnly: true,
title: "发运开始",
default: dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"),
clearable: false,
},
{
logic: "and",
column: "billTime",
action: "smallThanOrEqual",
action: "smallThan",
value: null,
readOnly: true,
title: "发运结束",
default: dayjs().add(1, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"),
clearable: false,
},
],
},

24
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
@ -22,8 +21,6 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Extensions;
using Omu.ValueInjecter;
using Polly;
using RestSharp.Extensions;
using SettleAccount.Job.SignalR;
using SqlSugar;
@ -36,7 +33,6 @@ using Volo.Abp.Validation;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.influxdb;
using Win.Sfs.Shared.Filter;
using Win.Sfs.Shared.RepositoryBase;
@ -216,8 +212,23 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
[HttpPost]
public async Task<PagedResultDto<VmiLog>> Log(LogRequestDto input)
{
var entities = await _logRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _logRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
using var scope = this._serviceProvider.CreateScope();
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);
}
@ -344,6 +355,7 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
return fileName;
}
private List<T> ImportInternal<T>(byte[] data)
{
var list = new List<T>();

Loading…
Cancel
Save