From 23f2998d1207fef5eeeae3780817def6268f84fb Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Wed, 29 Jun 2022 15:09:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=B8=B8=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/Materials/MaterialDtoBase.cs | 2 +- .../Entities/HQ_H/HQ_H_PlatformAppService.cs | 22 ++++++ .../Entities/WMS/WMSHQHKanbanAppService.cs | 13 ++++ .../Entities/WMS/WMSKanbanAppService.cs | 21 ++++++ .../Entities/WMS/WMSKanbanExtendAppService.cs | 25 ++++++- .../Entities/WMS/WMSSharePart90AppService.cs | 18 +++++ ...ttleAccountApplicationAutoMapperProfile.cs | 2 +- .../SettleKBWithCodeDapperReportRepository.cs | 1 + .../SettleSparePartDapperReportRepository.cs | 74 ++++++++++++++----- ...FactoryUnSettledDetailDiffExportService.cs | 2 +- .../HQHSettledDetailDiffExportService.cs | 15 +++- .../HQHUnSettledDetailDiffExportService.cs | 17 ++++- .../Services/Report/KanBanUnSettledExport.cs | 17 ++++- .../Report/SettleKBWithCodeExportService.cs | 19 ++++- .../Report/SettleSparePartExportService.cs | 19 ++++- .../Report/SettleUnSparePartExportService.cs | 18 ++++- .../Services/Report/SyncFisService.cs | 45 ++++++++++- .../Services/Report/UnSettledSumService.cs | 36 +++++++++ 18 files changed, 335 insertions(+), 31 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Materials/MaterialDtoBase.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Materials/MaterialDtoBase.cs index 2dd9413c..73734c34 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Materials/MaterialDtoBase.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Materials/MaterialDtoBase.cs @@ -13,7 +13,7 @@ using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.Errors { - public class ErrorBillDto + public class ErrorBillDto : AuditedEntityDtoBase { /// ///错误单据号 diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs index f79e8d62..d2045e8f 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs @@ -16,6 +16,7 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Caching; using Volo.Abp.Domain.Repositories; using Volo.Abp.Guids; +using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.CommonManagers; @@ -23,6 +24,7 @@ using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.HQ_M; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; +using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities.HQ_H @@ -47,6 +49,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H private readonly ISettleAccountBranchEfCoreRepository _versionMRepository; private readonly ISettleAccountBranchEfCoreRepository _repositoryM; + private readonly ErpPartDapperRepository _erpdapperRepository; /// /// 构建方法 /// @@ -59,6 +62,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H IDistributedCache cache, IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, + ErpPartDapperRepository erpdapperRepository, ICommonManager commonManager, ISettleAccountBranchEfCoreRepository versionMRepository, ISettleAccountBranchEfCoreRepository repositoryM @@ -70,6 +74,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H _repository = repository; _versionMRepository = versionMRepository; _repositoryM = repositoryM; + _erpdapperRepository = erpdapperRepository; } /// @@ -85,10 +90,12 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H [HttpPost] [Route("ExcelImport")] [DisableRequestSizeLimit] + [UnitOfWork(false)] [Authorize(SettleAccountPermissions.HQ_HPlatform.Create)] public async Task HQ_H_PlatformUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode) { ExportImporter _exportImporter = new ExportImporter(); + var checkList = new List(); var result = await _exportImporter.UploadExcelImport(files, _excelImportService); if (result == null || result.Count == 0) @@ -97,6 +104,21 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H } var entityList = ObjectMapper.Map, List>(result); + + //和物料主数据中SAP物料号检验是否存在 + foreach (var itm in entityList) + { + if (!_erpdapperRepository.GetMaterialList().Any(p => p.CustomerPartCode == itm.MaterialCode)) + { + checkList.Add(new ErrorExportDto(version, "红旗结算导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty)); + } + } + + if (checkList.Count > 0) + { + return await ExportErrorReportAsync(checkList); + } + //删除版本 var _versionQuery = _versionRepository.Where(p => p.Version == version); await _versionQuery.BatchDeleteAsync(); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs index 14860355..99eca55d 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs @@ -69,6 +69,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts private readonly WMSEfCoreRepository _wmstbRespository; private readonly ISettleAccountBranchEfCoreRepository _job; private readonly IExcelImportAppService _excelImportService; + //private readonly ErpPartDapperRepository _erpdapperRepository; private readonly TaskJobService _service; @@ -92,6 +93,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts WMSEfCoreRepository wmstbRespository, IDistributedCache cache, ISnowflakeIdGenerator snowflakeIdGenerator, + //ErpPartDapperRepository erpdapperRepository, ICommonManager commonManager ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { @@ -101,6 +103,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts _wmsVersionRepository = wmsVersionRepository; _wmsefRespository = wmsefRespository; _excelImportService = excelImportService; + //_erpdapperRepository = erpdapperRepository; } private async Task GetCountAsync(WmsKanbanOutPutDetialRequestDto input) @@ -446,6 +449,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts [HttpPost] [Route("ExcelImport")] [DisableRequestSizeLimit] + //[UnitOfWork(false)] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] public async Task ExcelImport([FromForm] IFormFileCollection files, string version) { @@ -480,6 +484,15 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts } } + ////和物料主数据中SAP物料号检验是否存在 + //foreach (var itm in filteResult) + //{ + // if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode)) + // { + // checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty)); + // } + //} + if (checkList.Count > 0) { diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs index ca1f5fe0..03d56af2 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs @@ -78,6 +78,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts private readonly TaskJobService _service; private readonly WmsDapperRepository _wmsDapper; + + // private readonly ErpPartDapperRepository _erpdapperRepository; /// /// /// @@ -99,6 +101,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts WMSEfCoreRepository wmstbRespository, IDistributedCache cache, ISnowflakeIdGenerator snowflakeIdGenerator, + // ErpPartDapperRepository erpdapperRepository, ICommonManager commonManager, WmsDapperRepository wmsDapper ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) @@ -110,6 +113,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts _wmsefRespository = wmsefRespository; _excelImportService = excelImportService; _dapper = dapper; + // _erpdapperRepository = erpdapperRepository; _wmsDapper = wmsDapper; } @@ -752,6 +756,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts [HttpPost] [Route("ExcelImport")] [DisableRequestSizeLimit] + //[UnitOfWork(false)] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] public async Task ExcelImport([FromForm] IFormFileCollection files, string version) { @@ -776,6 +781,22 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts checkList.Add(new ErrorExportDto(version, "大众看板出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中看板号{0}的结算数量为0,影响出库请检查!", itm.Kanban), string.Empty)); } } + + ////和物料主数据中SAP物料号检验是否存在 + //foreach (var itm in filteResult) + //{ + // if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode)) + // { + // checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty)); + // } + //} + + if (checkList.Count > 0) + { + return await ExportErrorReportAsync(checkList); + } + + //发现导入模板中存在空行,直接过滤掉 var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.Kanban)); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanExtendAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanExtendAppService.cs index c81c7e9f..ac754f8e 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanExtendAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanExtendAppService.cs @@ -51,7 +51,9 @@ using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace Win.Sfs.SettleAccount.Entities.WMS { - + /// + /// 大众无条码看板出库单 + /// [Route("api/settleaccount/wmskanbanoutputextend")] //[AllowAnonymous] [Authorize(SettleAccountPermissions.WMSJIT.Default)] @@ -70,6 +72,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS private readonly WMSEfCoreRepository _wmstbRespository; private readonly ISettleAccountBranchEfCoreRepository _job; private readonly IExcelImportAppService _excelImportService; + private readonly ErpPartDapperRepository _erpdapperRepository; private readonly TaskJobService _service; @@ -94,6 +97,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS KanbanUnSettledDapperRepository dapper, WMSEfCoreRepository wmstbRespository, IDistributedCache cache, + //ErpPartDapperRepository erpdapperRepository, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, WmsDapperRepository wmsDapper @@ -107,6 +111,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS _excelImportService = excelImportService; _dapper = dapper; _wmsDapper = wmsDapper; + // _erpdapperRepository = erpdapperRepository; } private async Task GetCountAsync(WmsKanbanOutPutDetialRequestDto input) @@ -237,6 +242,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS [HttpPost] [Route("ExcelImportWithOutKanban")] [DisableRequestSizeLimit] + //[UnitOfWork(false)] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] public async Task ExcelImportWithOutKanban([FromForm] IFormFileCollection files, string version) { @@ -310,13 +316,26 @@ namespace Win.Sfs.SettleAccount.Entities.WMS // _billNum, // 0, // itm. - + // ); // _lsCopy.Add(_detail); //} //_lst.AddRange(_lsCopy.ToArray()); + var checkList = new List(); ExportImporter _exportImporter = new ExportImporter(); var result = await _exportImporter.ExtendExcelImport(files, _excelImportService); + ////和物料主数据中SAP物料号检验是否存在 + //foreach (var itm in result) + //{ + // if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode)) + // { + // checkList.Add(new ErrorExportDto(version, "大众无条码看板出库单导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty)); + // } + //} + //if (checkList.Count > 0) + //{ + // return await ExportErrorReportAsync(checkList); + //} List _lst = new List(); var _lsCopy = new List(); foreach (var itm in result) @@ -354,7 +373,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS select itm1; var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) }); - var checkList = new List(); + foreach (var itm in errList) { checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) }); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs index 3f2650fb..79ac8e05 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs @@ -44,6 +44,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS private readonly WMSEfCoreRepository _wmstbRespository; private readonly ISettleAccountBranchEfCoreRepository _job; private readonly IExcelImportAppService _excelImportService; + //private readonly ErpPartDapperRepository _erpdapperRepository; private readonly TaskJobService _service; /// @@ -69,6 +70,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS IExcelImportAppService excelImportService, IDistributedCache cache, ISnowflakeIdGenerator snowflakeIdGenerator, + // ErpPartDapperRepository erpdapperRepository, WmsDapperRepository wmsDapper, ICommonManager commonManager ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) @@ -80,6 +82,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS _wmsVersionRepository = wmsVersionRepository; _wmsefRespository = wmsefRespository; _wmsDapper = wmsDapper; + // _erpdapperRepository = erpdapperRepository; } private async Task GetCountAsync(WmsSharePartOutPutDetialRequestDto input) @@ -480,6 +483,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS [HttpPost] [Route("ExcelImport")] [DisableRequestSizeLimit] + //[UnitOfWork(false)] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] public async Task ExcelImport([FromForm] IFormFileCollection files, string version) { @@ -507,6 +511,20 @@ namespace Win.Sfs.SettleAccount.Entities.WMS checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中订单号{0}结算数量为0,影响出库请检查!", itm.OrderBillNum), string.Empty)); } } + + //和物料主数据中SAP物料号检验是否存在 + //foreach (var itm in filteResult) + //{ + // if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode)) + // { + // checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty)); + // } + //} + + if (checkList.Count > 0) + { + return await ExportErrorReportAsync(checkList); + } List _lst = new List(); var _lsCopy = new List(); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index 3c620675..401791c9 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -282,7 +282,7 @@ namespace Win.Sfs.SettleAccount { CreateMap().ReverseMap(); CreateMap().ReverseMap(); - CreateMap().ReverseMap(); + CreateMap().ReverseMap(); CreateMap().ReverseMap(); } 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 index 875cfd35..c1b46d5c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs @@ -244,6 +244,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } + return _lst; } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs index 78b3e270..e927cef9 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs @@ -165,7 +165,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " temp1.发货数量,\n" + " temp1.发货与开票差异,\n" + " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 实际交货数量,\n" + - " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) - ISNULL( temp3.Qty, 0 ) AS 实际交货与开票差异,\n" + + " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) - ISNULL( temp3.Qty, 0 )-ISNULL( TEMP5.Qty, 0 ) AS 实际交货与开票差异,\n" + " ISNULL( temp3.Qty, 0 ) 退货数量,\n" + " ISNULL( TEMP5.Qty, 0 ) 往期已结 \n" + " FROM\n" + @@ -378,7 +378,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var list11 = DbConnection.Query(string.Format(sql10, version)); - + @@ -422,6 +422,43 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var list12 = DbConnection.Query(string.Format(sql11, version)); + //看板号为空的情况下,取外部单号的值 +// var sql12 = " SELECT DISTINCT \n" + +//" t1.* \n" + +//" FROM \n" + +//" ( \n" + +//" SELECT \n" + +//" a.ExternalKanbanNumber AS ExternalKanbanNumber, \n" + +//" a.KanbanNumber AS KanbanNumber, \n" + +//" CONVERT ( VARCHAR ( 100 ), a.AcceptanceDate, 23 ) AS AcceptanceDate, \n" + +//" HQHKanBan, \n" + +//" b2.MaterialCode \n" + +//" FROM \n" + +//" Set_UnHQSettleAccount a \n" + +//" LEFT JOIN Set_material b2 ON a.MaterialCode = b2.CustomerPartCode \n" + +//" WHERE \n" + +//" Version = '{0}' \n" + +//" AND HQHKanBan is null \n" + +//" ) t1 \n" + +//" LEFT JOIN ( \n" + +//" SELECT \n" + +//" HQHKanBan, \n" + +//" MaterialCode \n" + +//" FROM \n" + +//" Set_UnHQSettleAccount a \n" + +//" WHERE \n" + +//" Version = '{0}' \n" + +//" AND HQHKanBan is null \n" + +//" GROUP BY \n" + +//" HQHKanBan, \n" + +//" MaterialCode \n" + +//" HAVING \n" + +//" COUNT ( * ) > 1 \n" + +//" ) t2 ON t1.HQHKanBan = t2.HQHKanBan \n" + +//" AND t1.MaterialCode = t2.MaterialCode "; + +// var list13 = DbConnection.Query(string.Format(sql12, version)); + List _lscopy = new List(); @@ -753,7 +790,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report /// /// 大众备件未结(带单号),包含有发货有结算(条件:发货数量大于结算数据)也整合到大众备件未结中 - /// 用于--寄售未结比对WMS库存 + /// 用于--寄售未结比对WMS库存(因为日期传参问题,单独拿出) /// /// /// @@ -1203,6 +1240,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report /// /// 大众备件未结(带单号),包含有发货有结算(条件:发货数量大于结算数据)也整合到大众备件未结中 + /// 用于备件未结统计 /// /// /// @@ -1250,13 +1288,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " temp1.物料代码,\n" + " temp1.物料描述,\n" + " temp1.发货数量,\n" + -" temp1.开票数量,\n" + +" temp1.已结数量,\n" + " temp1.收货与交货差异,\n" + " ISNULL( temp3.Qty, 0 ) 退货数量,\n" + " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 未结数量,\n" + -" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) 实际发货数量,\n" + +" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.已结数量, 0 ) 实际发货数量,\n" + " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + -" ISNULL( TEMP2.Price, 0 ) * ( ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) ) 实际发货总金额 \n" + +" ISNULL( TEMP2.Price, 0 ) * ( ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.已结数量, 0 ) ) 实际发货总金额 \n" + " FROM\n" + " (\n" + " SELECT\n" + @@ -1264,11 +1302,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " NULL AS 交货日期,\n" + " a.PurchaseOrderNo AS 采购订单号,\n" + " c.MaterialCode AS SAP编码,\n" + -" c.CustomerPartCode AS 物料代码,\n" + +" a.MaterialCode AS 物料代码,\n" + " c.MaterialDesc AS 物料描述,\n" + " c.EstimateTypeDesc AS 物料组,\n" + " ISNULL( a.ReceiptQty, 0 ) AS 发货数量,\n" + -" ISNULL( b.Qty, 0 ) AS 开票数量,\n" + +" ISNULL( b.Qty, 0 ) AS 已结数量,\n" + " ( ISNULL( a.ReceiptQty, 0 ) - ISNULL( b.Qty, 0 ) ) AS 收货与交货差异 \n" + " FROM\n" + " (\n" + @@ -1308,13 +1346,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " temp1.物料代码,\n" + " temp1.物料描述,\n" + " temp1.发货数量,\n" + -" temp1.开票数量,\n" + +" temp1.已结数量,\n" + " temp1.收货与交货差异,\n" + " ISNULL( temp3.Qty, 0 ) 退货数量,\n" + " ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 未结数量,\n" + -" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) 实际发货数量,\n" + +" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.已结数量, 0 ) 实际发货数量,\n" + " ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + -" ISNULL( TEMP2.Price, 0 ) * (ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) ) 实际发货总金额 \n" + +" ISNULL( TEMP2.Price, 0 ) * (ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.已结数量, 0 ) ) 实际发货总金额 \n" + " FROM\n" + " (\n" + " SELECT\n" + @@ -1322,11 +1360,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " NULL AS 交货日期,\n" + " a.PurchaseOrderNo AS 采购订单号,\n" + " c.MaterialCode AS SAP编码,\n" + -" c.CustomerPartCode AS 物料代码,\n" + +" a.MaterialCode AS 物料代码,\n" + " c.MaterialDesc AS 物料描述,\n" + " c.EstimateTypeDesc AS 物料组,\n" + " ISNULL( a.ReceiptQty, 0 ) AS 发货数量,\n" + -" ISNULL( b.ReceiptQty, 0 ) AS 开票数量,\n" + +" ISNULL( b.ReceiptQty, 0 ) AS 已结数量,\n" + " ( ISNULL( b.ReceiptQty, 0 ) - ISNULL( a.ReceiptQty, 0 ) ) AS 收货与交货差异 \n" + " FROM\n" + " (\n" + @@ -1652,7 +1690,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "发货数量")] public decimal 发货数量 { set; get; } - + [ExporterHeader(DisplayName = "往期已结")] + public decimal 往期已结 { set; get; } + [ExporterHeader(DisplayName = "开票数量")] public decimal 开票数量 { set; get; } @@ -1719,9 +1759,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "发货数量")] public decimal 发货数量 { set; get; } - [ExporterHeader(DisplayName = "开票数量", IsIgnore = true)] - public decimal 开票数量 { set; get; } - + [ExporterHeader(DisplayName = "已结数量")] + public decimal 已结数量 { set; get; } + [ExporterHeader(DisplayName = "收货与交货差异", IsIgnore = true)] public decimal 收货与交货差异 { set; get; } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs index 22e6d1fe..f216fb65 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs @@ -125,7 +125,7 @@ namespace SettleAccount.Job.Services.Report ExcelExporter _exporter = new ExcelExporter();//导出Excel var result = _exporter.Append(_ls.ToList(), "红旗系统未对比对红旗主机厂未结") .SeparateBySheet() - .Append(_ls_reversal.ToList(), "红旗主机厂未结比对红旗系统未对") + .Append(_ls_reversal.ToList(), "红旗主机厂未结比对红旗系统未结") .ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); _fileContainer.SaveAsync(_filename, result.Result, true); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs index 32aa200c..274b952c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs @@ -11,6 +11,8 @@ using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Volo.Abp.Uow; using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount; +using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report @@ -24,6 +26,7 @@ namespace SettleAccount.Job.Services.Report private readonly HQHSettledDetailDapperRepository _dapperRepository; private readonly ErpPartDapperRepository _erpdapperRepository; private readonly IBlobContainer _fileContainer; + private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; private readonly OutputService _outputService; private readonly InputService _inputService; @@ -32,7 +35,7 @@ namespace SettleAccount.Job.Services.Report ErpPartDapperRepository erpdapperRepository, HQHSettledDetailDapperRepository dapperRepository, - + ISettleAccountBranchEfCoreRepository errorListRepository, OutputService outputService, InputService inputService , IBlobContainer fileContainer @@ -43,6 +46,7 @@ namespace SettleAccount.Job.Services.Report _erpdapperRepository = erpdapperRepository; _fileContainer = fileContainer; _dapperRepository = dapperRepository; + _errorListRepository = errorListRepository; } [UnitOfWork(false)] @@ -136,7 +140,16 @@ namespace SettleAccount.Job.Services.Report } } + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _errorListRepository.ToList(); + var query = from itm in _ls + join itm1 in _checkList on new { ChassisNumber = itm.订货看板编号, MaterialCode = itm.订货零件号, WmsBillNum = itm.交货单号 } + equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + _ls = query.ToList(); //_outputService.Export(id, _filename, _ls); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs index 46e4a3f2..2fa3f4cc 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs @@ -10,6 +10,8 @@ using TaskJob.Interfaces; using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount; +using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report @@ -26,12 +28,13 @@ namespace SettleAccount.Job.Services.Report private readonly OutputService _outputService; private readonly InputService _inputService; + private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; public HQHUnSettledDetailDiffExportService( ErpPartDapperRepository erpdapperRepository, HQHSettledDetailDapperRepository dapperRepository, - + ISettleAccountBranchEfCoreRepository errorListRepository, OutputService outputService, InputService inputService , IBlobContainer fileContainer @@ -42,6 +45,7 @@ namespace SettleAccount.Job.Services.Report _erpdapperRepository = erpdapperRepository; _fileContainer = fileContainer; _dapperRepository = dapperRepository; + _errorListRepository = errorListRepository; } public string ExportFile(Guid id, List exportName, List p_list) @@ -79,8 +83,17 @@ namespace SettleAccount.Job.Services.Report } } + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _errorListRepository.ToList(); + + var query = from itm in _ls + join itm1 in _checkList on new { ChassisNumber = itm.订货看板编号, MaterialCode = itm.客户物料号, WmsBillNum = itm.交货单号 } + equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + _ls = query.ToList(); - ExcelExporter _exporter = new ExcelExporter();//导出Excel var result = _exporter.Append(_ls.ToList(), "红旗看板未结明细") diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/KanBanUnSettledExport.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/KanBanUnSettledExport.cs index f6bd4d53..186720ae 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/KanBanUnSettledExport.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/KanBanUnSettledExport.cs @@ -10,6 +10,8 @@ using TaskJob.Interfaces; using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount; +using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report @@ -20,8 +22,11 @@ namespace SettleAccount.Job.Services.Report private readonly OutputService _outputService; KanbanUnSettledDapperRepository _dapper; private readonly IBlobContainer _fileContainer; + private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; - public KanBanUnSettledExport(KanbanUnSettledDapperRepository dapper, OutputService outputService, + public KanBanUnSettledExport(KanbanUnSettledDapperRepository dapper, + ISettleAccountBranchEfCoreRepository errorListRepository, + OutputService outputService, IBlobContainer fileContainer ) @@ -31,6 +36,7 @@ namespace SettleAccount.Job.Services.Report _outputService = outputService; _fileContainer = fileContainer; + _errorListRepository = errorListRepository; } public string ExportFile(Guid id, List exportName, List p_list) @@ -93,7 +99,16 @@ namespace SettleAccount.Job.Services.Report } + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _errorListRepository.ToList(); + var query = from itm in _ls + join itm1 in _checkList on new { ChassisNumber = itm.Kanban, MaterialCode = itm.CustomerPartCode, WmsBillNum = itm.WmsBillNum } + equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + _ls = query.ToList(); //if (!string.IsNullOrEmpty(materialCode)) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs index 23bcc463..b8a213b2 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs @@ -6,23 +6,31 @@ using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; +using Win.Sfs.SettleAccount; +using Win.Sfs.SettleAccount.Errors; 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; private readonly ErpPartDapperRepository _erpdapperRepository; + private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; public SettleKBWithCodeExportService(SettleKBWithCodeDapperReportRepository dapper, + ISettleAccountBranchEfCoreRepository errorListRepository, OutputService outputService, ErpPartDapperRepository erpdapperRepository) { _dapper = dapper; _outputService = outputService; _erpdapperRepository = erpdapperRepository; + _errorListRepository = errorListRepository; } @@ -103,9 +111,18 @@ namespace SettleAccount.Job.Services.Report } + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _errorListRepository.ToList(); + var query = from itm in _list + join itm1 in _checkList on new { ChassisNumber = itm.Kanban, MaterialCode = itm.CustomerPartCode, WmsBillNum = itm.WMSDeliveryNote } + equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + _list = query.ToList(); - _outputService.Export(id, _filename, _list); + _outputService.Export(id, _filename, _list.ToList()); return id.ToString(); } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs index 12d4d2be..3baf8472 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs @@ -10,6 +10,8 @@ using TaskJob.Interfaces; using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount; +using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report @@ -22,8 +24,12 @@ namespace SettleAccount.Job.Services.Report private readonly IBlobContainer _fileContainer; private readonly WmsDapperRepository _wmsDapper; + private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; - public SettleSparePartExportService(SettleSparePartDapperReportRepository dapper, ErpPartDapperRepository erpdapperRepository, OutputService outputService + + public SettleSparePartExportService(SettleSparePartDapperReportRepository dapper, + ISettleAccountBranchEfCoreRepository errorListRepository, + ErpPartDapperRepository erpdapperRepository, OutputService outputService , WmsDapperRepository wmsDapper , IBlobContainer fileContainer) { @@ -32,6 +38,7 @@ namespace SettleAccount.Job.Services.Report _erpdapperRepository = erpdapperRepository; _fileContainer = fileContainer; _wmsDapper = wmsDapper; + _errorListRepository = errorListRepository; } @@ -135,6 +142,16 @@ namespace SettleAccount.Job.Services.Report // _outputService.Export(id, fileName, _ls); + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _errorListRepository.ToList(); + + var query = from itm in _ls + join itm1 in _checkList on new { ChassisNumber = itm.采购订单号, MaterialCode = itm.物料代码, WmsBillNum = itm.交货单号 } + equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + _ls = query.ToList(); ExcelExporter _exporter = new ExcelExporter();//导出Excel diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleUnSparePartExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleUnSparePartExportService.cs index 8a2a513d..7bb0e93d 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleUnSparePartExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleUnSparePartExportService.cs @@ -10,6 +10,8 @@ using TaskJob.Interfaces; using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount; +using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report @@ -21,9 +23,12 @@ namespace SettleAccount.Job.Services.Report private readonly ErpPartDapperRepository _erpdapperRepository; private readonly IBlobContainer _fileContainer; private readonly WmsDapperRepository _wmsDapper; + private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; - public SettleUnSparePartExportService(SettleSparePartDapperReportRepository dapper, ErpPartDapperRepository erpdapperRepository, OutputService outputService + public SettleUnSparePartExportService(SettleSparePartDapperReportRepository dapper, + ISettleAccountBranchEfCoreRepository errorListRepository, + ErpPartDapperRepository erpdapperRepository, OutputService outputService , WmsDapperRepository wmsDapper , IBlobContainer fileContainer) { @@ -32,6 +37,7 @@ namespace SettleAccount.Job.Services.Report _erpdapperRepository = erpdapperRepository; _fileContainer = fileContainer; _wmsDapper = wmsDapper; + _errorListRepository = errorListRepository; } @@ -123,6 +129,16 @@ namespace SettleAccount.Job.Services.Report } } + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _errorListRepository.ToList(); + + var query = from itm in _reversels_withcode + join itm1 in _checkList on new { ChassisNumber = itm.采购订单号, MaterialCode = itm.物料代码, WmsBillNum = itm.交货单号 } + equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + _reversels_withcode = query.ToList(); ExcelExporter _exporter = new ExcelExporter();//导出Excel var result = _exporter.Append(_reversels_withcode.ToList(), "大众备件未结明细") diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SyncFisService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SyncFisService.cs index 45591e2b..1e3f10b0 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SyncFisService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SyncFisService.cs @@ -12,6 +12,8 @@ using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Volo.Abp.Uow; using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount; +using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report @@ -28,6 +30,7 @@ namespace SettleAccount.Job.Services.Report private readonly ErpPartDapperRepository _erpDapper; private readonly SettleSparePartDapperReportRepository _sparepartdapper; private readonly IBlobContainer _fileContainer; + private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; public SyncFisService( HQHSettledDetailDapperRepository hqkanbanDapper, KanbanUnSettledDapperRepository kanbanDapper, @@ -36,6 +39,7 @@ namespace SettleAccount.Job.Services.Report ErpPartDapperRepository erpDapper, WmsDapperRepository wmsDapper, SettleSparePartDapperReportRepository sparepartdapper, + ISettleAccountBranchEfCoreRepository errorListRepository, IBlobContainer fileContainer ) { @@ -46,7 +50,8 @@ namespace SettleAccount.Job.Services.Report _outputService = outputService; _erpDapper = erpDapper; _sparepartdapper = sparepartdapper; - _fileContainer = fileContainer; + _fileContainer = fileContainer; + _errorListRepository = errorListRepository; } [UnitOfWork(false)] public string ExportFile(Guid id, List exportName, List p_list) @@ -237,6 +242,17 @@ namespace SettleAccount.Job.Services.Report } } + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _errorListRepository.ToList(); + + var query = from itm in _ls + join itm1 in _checkList on new { ChassisNumber = itm.Kanban, MaterialCode = itm.CustomerPartCode, WmsBillNum = itm.WmsBillNum } + equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + _ls = query.ToList(); + //DiffQty 为实际发货数量=发货数量-结算数量-退货数量 财务要求 var kanbanList = _ls.GroupBy(p => new { p.SapCode, p.MaterialDesc, p.MaterialGroup, p.CustomerPartCode }) @@ -295,6 +311,17 @@ namespace SettleAccount.Job.Services.Report } } + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _errorListRepository.ToList(); + + var query = from itm in _ls + join itm1 in _checkList on new { ChassisNumber = itm.订货看板编号, MaterialCode = itm.客户物料号, WmsBillNum = itm.交货单号 } + equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + _ls = query.ToList(); + var kanbanList = _ls.GroupBy(p => new { p.Sap编码, p.零件中文名称, p.物料组, p.客户物料号 }) .Select(p => new UnSettledSum { @@ -342,6 +369,22 @@ namespace SettleAccount.Job.Services.Report _ls = _ls.Where(p => _groupList.Contains(p.SAP编码)).ToList(); } } + + + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _errorListRepository.ToList(); + + var query = from itm in _ls + join itm1 in _checkList on new { ChassisNumber = itm.采购订单号, MaterialCode = itm.物料代码, WmsBillNum = itm.交货单号 } + equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + + _ls = query.ToList(); + + + //说明 为实际发货数量=发货数量-结算数量-退货数量 财务要求 var kanbanList = _ls.GroupBy(p => new { p.SAP编码, p.物料描述, p.物料代码 }) .Select(p => new UnSettledSum diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs index 61634764..88dbf50a 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs @@ -286,6 +286,17 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms } } + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _errorListRepository.ToList(); + + var query = from itm in _ls + join itm1 in _checkList on new { ChassisNumber = itm.Kanban, MaterialCode = itm.CustomerPartCode, WmsBillNum = itm.WmsBillNum } + equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + _ls = query.ToList(); + //DiffQty 为实际发货数量=发货数量-结算数量-退货数量 财务要求 var kanbanList = _ls.GroupBy(p => new { p.SapCode, p.MaterialDesc, p.MaterialGroup, p.CustomerPartCode }) @@ -344,6 +355,17 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms } } + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _errorListRepository.ToList(); + + var query = from itm in _ls + join itm1 in _checkList on new { ChassisNumber = itm.订货看板编号, MaterialCode = itm.客户物料号, WmsBillNum = itm.交货单号 } + equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + _ls = query.ToList(); + var kanbanList = _ls.GroupBy(p => new { p.Sap编码, p.零件中文名称, p.物料组, p.客户物料号 }) .Select(p => new UnSettledSum { @@ -391,6 +413,20 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms _ls = _ls.Where(p => _groupList.Contains(p.SAP编码)).ToList(); } } + + + //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 + var _checkList = _errorListRepository.ToList(); + + var query = from itm in _ls + join itm1 in _checkList on new { ChassisNumber = itm.采购订单号, MaterialCode = itm.物料代码, WmsBillNum = itm.交货单号 } + equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; + _ls = query.ToList(); + + //说明 为实际发货数量=发货数量-结算数量-退货数量 财务要求 var kanbanList = _ls.GroupBy(p => new { p.SAP编码, p.物料描述, p.物料代码 }) .Select(p => new UnSettledSum