diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs index 4902863f..eef50a86 100644 --- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs @@ -5155,7 +5155,7 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("CP5A") .HasColumnType("datetime2"); - b.Property("CP7") + b.Property("CP7") .HasColumnType("datetime2"); b.Property("ChassisNumber") @@ -6252,14 +6252,14 @@ namespace Win.Sfs.SettleAccount.Migrations .HasColumnType("nvarchar(50)"); b.Property("Version") - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(450)"); b.Property("Year") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); - b.HasIndex("Kanban", "MaterialCode") + b.HasIndex("Version", "Kanban", "MaterialCode") .IsUnique() .HasFilter("IsDeleted=0"); @@ -6685,7 +6685,11 @@ namespace Win.Sfs.SettleAccount.Migrations b.HasKey("Id"); - b.ToTable("Set_SparePart"); + b.HasIndex("Version", "PurchaseOrderNo", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_WMSSparePart"); }); modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWSparePart.SparePartVersion", b => @@ -6768,7 +6772,224 @@ namespace Win.Sfs.SettleAccount.Migrations .IsUnique() .HasFilter("IsDeleted=0"); - b.ToTable("Set_SparePart_Version"); + b.ToTable("Set_WMSSparePart_Version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_KanBan.WMSKanBanSettle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Batch") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Extend") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Flag") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("Kanban") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PartType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Period") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Relation") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("SettleInputDate") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("nvarchar(450)"); + + b.Property("WMSDeliverGoodsState") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSDeliveryNote") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSKanBanState") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Version", "Kanban", "MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_WMSKanBanSettle"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_KanBan.WMSKanBanVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_WMSKanBanSettle_Version"); }); modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedInventories.EstimatedInventoryDetail", b => @@ -7108,6 +7329,9 @@ namespace Win.Sfs.SettleAccount.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("AccountDate") + .HasColumnType("datetime2"); + b.Property("BeginTime") .HasColumnType("datetime2"); @@ -7229,11 +7453,20 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("State") .HasColumnType("int"); + b.Property("UnSettleVersion") + .HasColumnType("nvarchar(max)"); + b.Property("Version") .IsRequired() .HasMaxLength(36) .HasColumnType("nvarchar(36)"); + b.Property("WMSBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("WMSState") + .HasColumnType("nvarchar(max)"); + b.Property("Year") .HasMaxLength(36) .HasColumnType("nvarchar(36)"); @@ -8180,6 +8413,12 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("BranchId") .HasColumnType("uniqueidentifier"); + b.Property("CP7ScrapQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ClaimQty") + .HasColumnType("decimal(18,2)"); + b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasMaxLength(40) @@ -8202,6 +8441,9 @@ namespace Win.Sfs.SettleAccount.Migrations .HasColumnType("datetime2") .HasColumnName("DeletionTime"); + b.Property("DiffPrice") + .HasColumnType("decimal(18,2)"); + b.Property("DiffQty") .HasColumnType("decimal(18,2)"); @@ -8212,6 +8454,15 @@ namespace Win.Sfs.SettleAccount.Migrations .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("InvoiceAmt") + .HasColumnType("decimal(18,2)"); + + b.Property("InvoicePrice") + .HasColumnType("decimal(18,2)"); + b.Property("InvoiceQty") .HasColumnType("decimal(18,2)"); @@ -8233,12 +8484,21 @@ namespace Win.Sfs.SettleAccount.Migrations .HasMaxLength(50) .HasColumnType("nvarchar(50)"); - b.Property("ParentId") - .HasColumnType("uniqueidentifier"); + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); b.Property("Remark") .HasColumnType("nvarchar(max)"); + b.Property("SalePrice") + .HasColumnType("decimal(18,2)"); + + b.Property("SapMaterialCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SapMaterialGroup") + .HasColumnType("nvarchar(max)"); + b.Property("SettleQty") .HasColumnType("decimal(18,2)"); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSKanBan/WMSVWKanBanDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSKanBan/WMSVWKanBanDto.cs index a79b1353..983820a7 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSKanBan/WMSVWKanBanDto.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSKanBan/WMSVWKanBanDto.cs @@ -71,6 +71,22 @@ namespace Win.Sfs.SettleAccount.Entities.WMSKanBan /// public virtual DateTime SettleDate { get; set; } + + /// + /// WMS交货单 + /// + public string WMSDeliveryNote { set; get; } + + /// + /// WMS发货状态 + /// + public string WMSDeliverGoodsState { set; get; } + + /// + /// 看板结算状态 + /// + public string WMSKanBanState { set; get; } + /// /// 结算状态 /// diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSSparePart/WMSSparePartDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSSparePart/WMSSparePartDto.cs index 7d45b460..d6a6d2e8 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSSparePart/WMSSparePartDto.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSSparePart/WMSSparePartDto.cs @@ -118,5 +118,20 @@ namespace Win.Sfs.SettleAccount.Entities.WMSSparePart /// 备注 /// public string Extend { set; get; } + + /// + /// WMS交货单 + /// + public string WMSDeliveryNote { set; get; } + + /// + /// WMS发货状态 + /// + public string WMSDeliverGoodsState { set; get; } + + /// + /// 看板结算状态 + /// + public string WMSKanBanState { set; get; } } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWScrapClaims/ScrapClaimsAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWScrapClaims/ScrapClaimsAppService.cs index a2f3aa3c..b56a6d1b 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWScrapClaims/ScrapClaimsAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWScrapClaims/ScrapClaimsAppService.cs @@ -159,9 +159,9 @@ namespace Win.Sfs.SettleAccount.Entities.VWScrapClaims IExporter _csv = new CsvExporter(); IExporter _excel = new ExcelExporter(); - if (input.ParentId != Guid.Empty) + if (!string.IsNullOrEmpty(input.Version)) { - input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); + input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); } var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, 0, true); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs index 1559a11a..fbc3356e 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs @@ -76,7 +76,46 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices _service = service; } + #region 派格结算报表 + /// + /// 有条码看板结算核对 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [HttpGet] + [Route("SettleKanBan-WithCode")] + [DisableRequestSizeLimit] + + public async Task SettledKanBanWithCode(string year, string period, string version, string customerCode, string factory, string matialCode, + string state, DateTime begin, DateTime end) + { + + List customConditionList = new List(); + customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty }); + customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty }); + customConditionList.Add(new CustomCondition() { Name = "Factory", Value = factory ?? string.Empty }); + customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" }); + customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? "0" }); + customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "有条码看板结算核对" }); + customConditionList.Add(new CustomCondition() { Name = "Year", Value = year ?? string.Empty }); + customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() }); + customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() }); + + var _taskid = await _service.ExportEnqueueAsync("未结算对比", ExportExtentsion.Excel, CurrentUser, typeof(UnSettledExportService), customConditionList, (rs) => + { + }); + return _taskid; + } + #endregion diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index f8c0f600..eee8cf69 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -351,7 +351,7 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.FactoryName).HasMaxLength(50); b.Property(x => x.Extend).HasMaxLength(250); //创建索引(没有版本一说) - b.HasIndex(x => new { x.PurchaseOrderNo, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); + b.HasIndex(x => new { x.Version,x.PurchaseOrderNo, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); }); } @@ -399,7 +399,7 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.Batch).HasMaxLength(50); b.Property(x => x.Flag).HasMaxLength(50); //创建组合索引 - b.HasIndex(x => new { x.Kanban, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); + b.HasIndex(x => new { x.Version,x.Kanban, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); }); } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs new file mode 100644 index 00000000..31a9b7b7 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs @@ -0,0 +1,114 @@ +using Dapper; +using Magicodes.ExporterAndImporter.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Repositories.Dapper; +using Volo.Abp.EntityFrameworkCore; + +namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report +{ + public class SettleKBWithCodeDapperReportRepository : DapperRepository, ITransientDependency + { + public SettleKBWithCodeDapperReportRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { } + + public virtual List GetSettleKBWithCodeReportList(string state, string version, string year,string customcode, string begintime, string endtime) + { + string sqlString = " select " + string.Format(" {0} as Version , ", version) + " r1.ErpMaterialCode, r2.Price, r1.SumPrice , r1.MaterialDesc, (isnull(r2.Price,0)-isnull(r1.SumPrice,0)) as diffPrice from \n" + + "( select ErpMaterialCode, MaterialDesc, SUM(Price) as SumPrice from(\n" + + "select a.ErpMaterialCode, b.SettlementPartCode, a.MaterialDesc, (a.Qty * b.Price) as Price from\n" + + "(SELECT ErpMaterialCode, MaterialDesc, SettleMaterialCode, Qty, Version ,CustomerCode \n" + + "FROM [Set_MaterialRelationshipDetail] mdetail \n" + + + " where mdetail.Version='{0}' and mdetail.CustomerCode='{1}' \n" + + ") a \n" + + "inner join Set_settlement_part b on a.Version = b.Version and a.SettleMaterialCode = b.SettlementPartCode and a.CustomerCode = b.CustomerCode) temp group by ErpMaterialCode, MaterialDesc) r1 left join set_pricelist r2 " + + " on r2.MaterialCode=r1.ErpMaterialCode and r2.Version='{0}'\n"; + + string _sql = string.Format(sqlString, version, customcode); + + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); + return _query.ToList(); + + } + + } + + /// + /// 大众看板有条码报表 + /// + //[ExcelExporter(Name = "未结明细", AutoFitAllColumn = true, MaxRowNumberOnASheet = 500000)] + public class SettleKBWithCode + { + [ExporterHeader(DisplayName = "交货单号")] + public string WMSDeliveryNote { set; get; } + + [ExporterHeader(DisplayName = "实际发货日期")] + public string ActualGoodsDate { set; get; } + + [ExporterHeader(DisplayName = "条码号")] + public string Kanban { set; get; } + + [ExporterHeader(DisplayName = "物料号")] + public string MaterialCode { set; get; } + + [ExporterHeader(DisplayName = "物料描述")] + public string MaterialDesc { set; get; } + + [ExporterHeader(DisplayName = "客户物料")] + public string CustomerMaterial { set; get; } + + [ExporterHeader(DisplayName = "物料组(车型)")] + public string Model { set; get; } + + [ExporterHeader(DisplayName = "交货数量")] + public decimal WMSBillNum { set; get; } + + [ExporterHeader(DisplayName = "定价")] + public decimal Price { set; get; } + + [ExporterHeader(DisplayName = "金额")] + public decimal Amount { set; get; } + + [ExporterHeader(DisplayName = "结算数量")] + public decimal SettleNumber { set; get; } + + [ExporterHeader(DisplayName = "结算日期")] + public DateTime SettleDate { set; get; } + + [ExporterHeader(DisplayName = "结算金额")] + public decimal SettleQty { set; get; } + + [ExporterHeader(DisplayName = "结算与发货差异")] + public decimal SettleWMSDiffQty { set; get; } + + [ExporterHeader(DisplayName = "结算与开票差异")] + public decimal SettleInvoiceDiffQty { set; get; } + + [ExporterHeader(DisplayName = "开票差量")] + public decimal InvoiceDiffQty { set; get; } + + [ExporterHeader(DisplayName = "开票单价")] + public decimal InvoicePrice { set; get; } + + [ExporterHeader(DisplayName = "开票金额")] + public decimal InvoiceMoney { set; get; } + + [ExporterHeader(DisplayName = "单价差异")] + public decimal InvoiceDiffPrice { set; get; } + + [ExporterHeader(DisplayName = "总金额差异")] + public decimal SumDiffMoney { set; get; } + + [ExporterHeader(DisplayName = "出库单号")] + public decimal DeliveryOrderNo { set; get; } + + + } + +} diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs new file mode 100644 index 00000000..757cb604 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TaskJob.EventArgs; +using TaskJob.Interfaces; +using Volo.Abp.DependencyInjection; +using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; + +namespace SettleAccount.Job.Services.Report +{ + public class SettleKBWithCodeExportService : ITransientDependency, IExportJob + { + private readonly SettleKBWithCodeDapperReportRepository _dapper; + private readonly OutputService _outputService; + + public SettleKBWithCodeExportService(SettleKBWithCodeDapperReportRepository dapper, OutputService outputService) + { + _dapper = dapper; + _outputService = outputService; + } + + + public string ExportFile(Guid id, List exportName, List p_list) + { + var year = p_list.Where(p => p.Name == "Year").FirstOrDefault().Value; + var state = p_list.Where(p => p.Name == "State").FirstOrDefault().Value; + var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; + var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value; + var beginTime = p_list.Where(p => p.Name == "BegingTime").FirstOrDefault().Value; + var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; + + var _list = _dapper.GetSettleKBWithCodeReportList(state, version, year, customerCode, beginTime, endTime); + + _outputService.Export(id, string.Format("大众看板结算与交货核对明细表_{0}.xlsx", Guid.NewGuid().ToString()), _list); + + return id.ToString(); + } + + + } +}