From 784c5e2b768293f77dffdf94c1475c297d083513 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 15 Apr 2022 13:38:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/Wms/WmsDetailReportDto.cs | 61 ++++++++++++++++ .../WMS/WMSCusomerKanbanAppService.cs | 2 +- .../Entities/WMS/WmsDetailCancelInterface.cs | 20 +++--- ...ttleAccountApplicationAutoMapperProfile.cs | 7 +- .../Entities/WmsDetailReport.cs | 71 +++++++++++++++++++ ...AccountDbContextModelCreatingExtensions.cs | 31 ++++++++ 6 files changed, 180 insertions(+), 12 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs index b81f9c00..659bfe37 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs @@ -184,6 +184,67 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput } + public class WmsDetailCancelReportDto + { + public WmsDetailCancelReportDto() + { + } + + + + [Display(Name = "版本号")] + public string Version { set; get; } + + [Display(Name = "客户")] + public string Client { set; get; } + [Display(Name = "出库类型")] + public string Type { set; get; } + //[Display(Name = "结算编码")] + //public string SettleCode { set; get; } + //[Display(Name = "销售渠道")] + //public string SaleCode { set; get; } + //[Display(Name = "客户代码")] + //public string ClientCode { set; get; } + [Display(Name = "结算单")] + public string BillNum { set; get; } + [Display(Name = "交货编码")] + public string SwitchCode { set; get; } + + [Display(Name = "物料号")] + public string MaterialCode { set; get; } + //[Display(Name = "寄售类别")] + //public string SaleType { set; get; } + [Display(Name = "结算数量")] + public decimal Qty { set; get; } + [Display(Name = "实际出库数量")] + public decimal OutputQty { set; get; } + [Display(Name = "差异数量")] + public decimal DiffQty { set; get; } + //[Display(Name = "开票单价")] + //public decimal Price { set; get; } + //[Display(Name = "结算金额")] + //public decimal Amt { set; get; } + //[Display(Name = "已出库金额")] + //public decimal OutPutAmt { set; get; } + //[Display(Name = "WMS待出库金额")] + //public decimal DiffAmt { set; get; } + [Display(Name = "物料组编码")] + public string MaterialGroupCode { set; get; } + [Display(Name = "物料组(车型)")] + public string MaterialGroup { set; get; } + [Display(Name = "物料组描述")] + public string MaterialDesc { set; get; } + [Display(Name = "备注")] + public string Remark1 { set; get; } + [Display(Name = "状态")] + public int State { set; get; } + + } + + + + + /// /// 有条码业务 /// diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs index 3efce7e7..c2b38446 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs @@ -55,7 +55,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// 红旗H平台准时化-出库 /// - //[AllowAnonymous] + [Authorize(SettleAccountPermissions.WMSHQ.Default)] [Route("api/settleaccount/WMSCusomerKanbanoutput")] public class WMSCusomerKanbanAppService : diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsDetailCancelInterface.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsDetailCancelInterface.cs index 44cd02b3..d5830d70 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsDetailCancelInterface.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsDetailCancelInterface.cs @@ -33,9 +33,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS [Authorize(SettleAccountPermissions.WMSJIT.Default)] [Route("api/settleaccount/WMSOutputDetailCancelDiffReport")] public class WMSOutputDetailCancelDiffReportAppService : - SettleAccountApplicationBase + SettleAccountApplicationBase { - private readonly ISettleAccountBranchEfCoreRepository _wmsRepository; + private readonly ISettleAccountBranchEfCoreRepository _wmsRepository; private readonly WmsOutputSumDapperRepository _dapper; private readonly IExcelImportAppService _excelImportService; @@ -48,10 +48,10 @@ namespace Win.Sfs.SettleAccount.Entities.WMS public WMSOutputDetailCancelDiffReportAppService( WmsOutputSumDapperRepository dapper, - ISettleAccountBranchEfCoreRepository wmsRepository, + ISettleAccountBranchEfCoreRepository wmsRepository, ISettleAccountBranchEfCoreRepository job, IExcelImportAppService excelImportService, - IDistributedCache cache, + IDistributedCache cache, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, ErpSumOutputDapperRepository erpDapper @@ -81,12 +81,12 @@ namespace Win.Sfs.SettleAccount.Entities.WMS var query = _wmsRepository.Where(p => p.Version == version); await query.BatchDeleteAsync(); } - List _lst = new List(); + List _lst = new List(); if (_ls != null && _ls.Count() > 0) { foreach (var itm in _ls) { - _lst.Add(new WmsDetailDiffReport( + _lst.Add(new WmsDetailCancelReport( Guid.NewGuid(), itm.客户, itm.出库类型, @@ -115,7 +115,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS [HttpPost] [Route("WmsDetailReport")] - virtual public async Task> GetListAsync(WmsRequestDetailReportDto input) + virtual public async Task> GetListAsync(WmsRequestDetailReportDto input) { input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); //客户过滤 @@ -131,7 +131,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); var totalCount = await GetCountAsync(input); - return new PagedResultDto(totalCount, entities); + return new PagedResultDto(totalCount, entities); } @@ -176,7 +176,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS //{ // var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, // 0, true); - // List _ls = new List(); + // List _ls = new List(); // if (entities.Count() > 0) // { // var _entity = entities.FirstOrDefault(); @@ -206,7 +206,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS } var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, 0, true); - var dtoDetails = ObjectMapper.Map, List>(entities); + var dtoDetails = ObjectMapper.Map, List>(entities); IExporter _excel = new ExcelExporter(); byte[] result = null; var _fileName = string.Format("撤销清单报表_{0}.xlsx", Guid.NewGuid().ToString()); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index 9d860b55..9a051ac7 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -267,7 +267,7 @@ namespace Win.Sfs.SettleAccount CreateMapWMSOutputSum(); CreateMapWMSDiffOutputSum(); CreateMapWMSWithCodeOutputSum(); - + CreateMapWMSCacelOutputSum(); #endregion } @@ -283,6 +283,11 @@ namespace Win.Sfs.SettleAccount { CreateMap().ReverseMap(); + } + private void CreateMapWMSCacelOutputSum() + { + CreateMap().ReverseMap(); + } /// /// 有条码业务 diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WmsDetailReport.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WmsDetailReport.cs index c984f6f2..fa933172 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WmsDetailReport.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WmsDetailReport.cs @@ -172,7 +172,78 @@ namespace Win.Sfs.SettleAccount.Entities public int State { set; get; } } + public class WmsDetailCancelReport : FullAuditedAggregateRootBase + { + public WmsDetailCancelReport() + { + } + + public WmsDetailCancelReport(Guid id, string client, string type, string version, string billNum, string switchCode, string materialCode, decimal qty, decimal outputQty, decimal diffQty, string materialGroupCode, string materialGroup, string materialDesc, string remark1, int state) : base(id) + { + Version = version; + Type = type; + Client = client; + BillNum = billNum; + SwitchCode = switchCode; + MaterialCode = materialCode; + Qty = qty; + OutputQty = outputQty; + DiffQty = diffQty; + MaterialGroupCode = materialGroupCode; + MaterialGroup = materialGroup; + MaterialDesc = materialDesc; + Remark1 = remark1; + State = state; + } + + [Display(Name = "版本号")] + public string Version { set; get; } + + [Display(Name = "客户")] + public string Client { set; get; } + [Display(Name = "出库类型")] + public string Type { set; get; } + //[Display(Name = "结算编码")] + //public string SettleCode { set; get; } + //[Display(Name = "销售渠道")] + //public string SaleCode { set; get; } + //[Display(Name = "客户代码")] + //public string ClientCode { set; get; } + [Display(Name = "结算单")] + public string BillNum { set; get; } + [Display(Name = "交货编码")] + public string SwitchCode { set; get; } + + [Display(Name = "物料号")] + public string MaterialCode { set; get; } + //[Display(Name = "寄售类别")] + //public string SaleType { set; get; } + [Display(Name = "结算数量")] + public decimal Qty { set; get; } + [Display(Name = "实际出库数量")] + public decimal OutputQty { set; get; } + [Display(Name = "差异数量")] + public decimal DiffQty { set; get; } + //[Display(Name = "开票单价")] + //public decimal Price { set; get; } + //[Display(Name = "结算金额")] + //public decimal Amt { set; get; } + //[Display(Name = "已出库金额")] + //public decimal OutPutAmt { set; get; } + //[Display(Name = "WMS待出库金额")] + //public decimal DiffAmt { set; get; } + [Display(Name = "物料组编码")] + public string MaterialGroupCode { set; get; } + [Display(Name = "物料组(车型)")] + public string MaterialGroup { set; get; } + [Display(Name = "物料组描述")] + public string MaterialDesc { set; get; } + [Display(Name = "备注")] + public string Remark1 { set; get; } + [Display(Name = "状态")] + public int State { set; get; } + } /// /// 有条码 /// diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index 0e3364fa..70b5628d 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -379,6 +379,9 @@ namespace Win.Sfs.SettleAccount builder.ConfigureWmsDetailReport(options); builder.ConfigureWmsDetailDiffReport(options); + builder.ConfigureWmsDetailCancelReport(options); + + //有条码 builder.ConfigureWmsDetailWithCodeReport(options); builder.ConfigureWmsCustomerKanbanOutPut(options); @@ -610,6 +613,34 @@ namespace Win.Sfs.SettleAccount }); } + private static void ConfigureWmsDetailCancelReport(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) + { + + builder.Entity(b => + { + + b.ToTable($"{options.TablePrefix}_WmsDetailCancelReport", options.Schema); + + b.ConfigureByConvention(); + b.Property(x => x.BillNum).IsRequired().HasMaxLength(50);//必填项 + b.Property(x => x.MaterialCode).HasMaxLength(50); + b.Property(x => x.MaterialDesc).HasMaxLength(100); + b.Property(x => x.Client).IsRequired().HasMaxLength(50); + + b.Property(x => x.MaterialCode).HasMaxLength(50); + b.Property(x => x.MaterialDesc).HasMaxLength(150); + + b.Property(x => x.MaterialGroup).HasMaxLength(50); + b.Property(x => x.MaterialGroupCode).HasMaxLength(50); + + //创建组合索引 + + + }); + } + + + /// /// 有条码 ///