Browse Source

更新版本

master
学 赵 12 months ago
parent
commit
55102ab4ea
  1. 39
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BalanceSumService .cs
  2. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs

39
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BalanceSumService .cs

@ -1,43 +1,66 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Security.Cryptography;
using EFCore.BulkExtensions; using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Excel;
using NPOI.OpenXmlFormats.Spreadsheet; using NPOI.OpenXmlFormats.Spreadsheet;
using SettleAccount.Bases; using SettleAccount.Bases;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Shouldly;
using TaskJob.EventArgs; using TaskJob.EventArgs;
using TaskJob.Interfaces; using TaskJob.Interfaces;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Emailing; using Volo.Abp.Emailing;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.Entities.CodeSettings; using Win.Sfs.SettleAccount.Entities.CodeSettings;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
{ {
public class BalanceSumService : ApplicationService, ITransientDependency, IExportJob public class BalanceSumService : BASE_SERVICE, ITransientDependency, IExportJob
{ {
//protected readonly SettleAccountDbContext _dbcontext; //protected readonly SettleAccountDbContext _dbcontext;
protected readonly BalanceSumDapperRepository _dapper; protected readonly BalanceSumDapperRepository _dapper;
public BalanceSumService( private readonly IBlobContainer<MyFileContainer> _fileContainer;
BalanceSumDapperRepository dapper
)
public BalanceSumService( IBlobContainer<MyFileContainer> fileContainer, BalanceSumDapperRepository dapper,IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager) : base(excelImportService, snowflakeIdGenerator, commonManager)
{ {
_dapper = dapper; _dapper = dapper;
_fileContainer = fileContainer;
//_dbcontext = dbcontext;
} }
[UnitOfWork(false)] [UnitOfWork(false)]
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
{ {
var _filename = exportName.FirstOrDefault();
var year = property.Where(p => p.Name == "Year").FirstOrDefault().Value; var year = property.Where(p => p.Name == "Year").FirstOrDefault().Value;
var list=_dapper.GetBalanceSum(year); var list=_dapper.GetBalanceSum(year);
ExcelExporter _exporter = new ExcelExporter();//导出Excel
var result = _exporter.Append(list.ToList(), "余额表")
//.SeparateBySheet()
//.Append(_reversels.ToList(), "有发货无结算对比")
.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(_filename, result.Result, true);
return id.ToString(); return id.ToString();
} }

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs

@ -207,6 +207,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
var invbills=p_ls.Select(p => p.BillNum).ToList();//发票号 var invbills=p_ls.Select(p => p.BillNum).ToList();//发票号
var invs=_dbcontext.Set<INVOICE_GRP>().Where(p => invbills.Contains(p.InvbillNum)).ToList();//所有发票 var invs=_dbcontext.Set<INVOICE_GRP>().Where(p => invbills.Contains(p.InvbillNum)).ToList();//所有发票
foreach (var inv in invs) foreach (var inv in invs)
{ {
var pdls= p_ls.Where(p => p.BillNum == inv.InvbillNum).ToList(); var pdls= p_ls.Where(p => p.BillNum == inv.InvbillNum).ToList();

Loading…
Cancel
Save