mahao 1 year ago
parent
commit
59a87ef4c6
  1. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Controllers/HomeController.cs
  2. 13
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj
  3. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs
  4. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs
  5. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  6. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs
  7. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_PD_MNG.cs

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Controllers/HomeController.cs

@ -1,4 +1,4 @@
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
@ -19,12 +19,12 @@ namespace Win.Sfs.SettleAccount.Controllers
[ResponseCache(NoStore = true)]
public ActionResult Index()
{
return File("~/index.html", "text/html");
return File(System.IO.File.ReadAllBytes(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "index.html")), "text/html");
}
public async Task<string> Test(int seconds)
{
await Task.Delay(seconds*1000).ConfigureAwait(false);
await Task.Delay(seconds * 1000).ConfigureAwait(false);
return "ok";
}
}

13
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" />
@ -13,7 +13,15 @@
<SatelliteResourceLanguages>en;zh-Hans</SatelliteResourceLanguages>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
<BeautySharedRuntimeMode>False</BeautySharedRuntimeMode>
<BeautyLibsDir Condition="$(BeautySharedRuntimeMode) == 'True'">../libraries</BeautyLibsDir>
<BeautyLibsDir Condition="$(BeautySharedRuntimeMode) != 'True'">./libraries</BeautyLibsDir>
<DisableBeauty>False</DisableBeauty>
<BeautyOnPublishOnly>False</BeautyOnPublishOnly>
<BeautyEnableDebugging>False</BeautyEnableDebugging>
<BeautyUsePatch>True</BeautyUsePatch>
<BeautyLogLevel>Info</BeautyLogLevel>
<GitCDN>https://gitee.com/liesauer/HostFXRPatcher</GitCDN>
</PropertyGroup>
@ -29,6 +37,7 @@
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.14" />
<PackageReference Include="nulastudio.NetCoreBeauty" Version="1.2.9.5" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<!-- <PackageReference Include="Serilog.Sinks.Elasticsearch" Version="8.2.0" /> -->

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs

@ -17,6 +17,7 @@ using SettleAccount.Job.SignalR;
//using ShardingCore;
using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using Win.Sfs.SettleAccount.ExcelImporter;
namespace Win.Sfs.SettleAccount;
@ -73,6 +74,7 @@ public class Startup
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
ExportImporter.ServiceProvider = app.ApplicationServices;
app.UseCors("Default");
app.UseResponseCompression();
app.UseRouting();

4
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs

@ -179,12 +179,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public decimal Tax { get; set; }
[ImporterHeader(Name = "客户", FixAllSpace = true)]
[ImporterHeader(Name = "客户编码", FixAllSpace = true)]
[Required(ErrorMessage = "{0}是必填项")]
public string ClientCode { get; set; }
[ImporterHeader(Name = "金税发票金额", FixAllSpace = true)]
[ImporterHeader(Name = "税后金额", FixAllSpace = true)]
[Required(ErrorMessage = "{0}是必填项")]
public decimal RealAmt { get; set; }

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

@ -162,7 +162,7 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran
public async Task<string> BalanceExport(RequestDto input)
{
var entities = await _balanceRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false);
var fileName = $"库存余额_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx";
var fileName = $"库存余额_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx";
var content = this.GetContent(entities, "库存备份");
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
return fileName;
@ -296,7 +296,7 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran
public async Task<string> LogExport(RequestDto input)
{
var entities = await _logRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false);
var fileName = $"库存事务_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx";
var fileName = $"库存事务_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx";
var content = this.GetContent(entities, "库存事务_");
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
return fileName;
@ -310,7 +310,7 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran
{
var entities = await _logRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false);
//IQueryable<VmiLog> query = _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda<VmiLog>());
var fileName = $"补货数据_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx";
var fileName = $"补货数据_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx";
var content = this.GetContent(entities, "补货数据_");
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
return fileName;

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs

@ -36,13 +36,14 @@ using Magicodes.ExporterAndImporter.Core.Filters;
using OfficeOpenXml.Attributes;
using Win.Sfs.SettleAccount.Attributes;
using Magicodes.ExporterAndImporter.Core.Extension;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.BlobStoring;
namespace Win.Sfs.SettleAccount.ExcelImporter
{
public class ExportImporter
{
public static IServiceProvider ServiceProvider { get; set; }
private readonly IExporter _csvExporter = new Magicodes.ExporterAndImporter.Csv.CsvExporter();//导出CSV
private readonly IExcelImporter _importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter();//导入Excel
@ -51,6 +52,8 @@ namespace Win.Sfs.SettleAccount.ExcelImporter
public virtual async Task<List<T>> UploadExcelImport<T>([FromForm] IFormFileCollection files, IExcelImportAppService _excelImportService)
where T : class, new()
{
using var fs = ServiceProvider.CreateScope();
var fc = fs.ServiceProvider.GetRequiredService<IBlobContainer<MyFileContainer>>();
Type type = typeof(T).GetType();
var ImportList = new List<T>();
ExcelImportResult returnResult = new ExcelImportResult();

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_PD_MNG.cs

@ -13,16 +13,10 @@ using Volo.Abp.Domain.Services;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Managers;
public class BBAC_PD_MNG:DomainService
public class BBAC_PD_MNG:DomainService
{
private readonly INormalEfCoreRepository<BBAC_PD, Guid> _repository;
private readonly INormalEfCoreRepository<BBAC_PD_DETAIL, Guid> _detailRepository;
protected BBAC_PD_MNG(
INormalEfCoreRepository<BBAC_PD, Guid> repository,

Loading…
Cancel
Save