From 64b7b7718a198ed284c0f17562c2199fe4a04696 Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Wed, 1 Jun 2022 10:47:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E6=97=97=E4=B8=80=E8=BD=BF=E6=89=8B?= =?UTF-8?q?=E5=B7=A5=E5=87=BA=E5=BA=93=E5=8D=95=E3=80=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=8F=91=E8=B4=A7=E5=87=BA=E5=BA=93=E5=8D=95=E3=80=81?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E6=80=A7=E9=94=80=E5=94=AE=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E5=8D=95=E3=80=81=E5=A4=A7=E4=BC=97=E5=A4=87=E4=BB=B6=E6=97=A0?= =?UTF-8?q?=E5=8D=95=E5=8F=B7=E5=87=BA=E5=BA=93=E5=8D=95=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E4=BA=86SAP=E6=A3=80=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/WMS/WMSCusomerKanbanAppService.cs | 13 +++++++++++++ .../Entities/WMS/WMSSharePartAppService.cs | 12 ++++++++++++ .../Entities/WMS/WmsHQKBOutputAppService.cs | 18 +++++++++++++++++- .../WMS/WmsOneTimeSaleOutputAppService.cs | 13 +++++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) 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 4b5018ec..5fbbdf1e 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.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) @@ -478,6 +481,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, "导入模板中第一页签没有数据,请检查!", string.Empty)); } + if (checkList.Count > 0) { return await ExportErrorReportAsync(checkList); @@ -486,6 +490,15 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.SapMaterialCode));//过滤掉物料号为空的数据 + //和物料主数据中SAP物料号检验是否存在 + foreach (var itm in filteResult) + { + 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)); + } + } + //检验2:导入模板中的结算数据是否为0 foreach (var itm in filteResult) { diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs index 2bf66381..efdc6aa9 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs @@ -75,6 +75,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts private readonly IExcelImportAppService _excelImportService; private readonly TaskJobService _service; + private readonly ErpPartDapperRepository _erpdapperRepository; /// /// /// @@ -94,6 +95,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts IDistributedCache cache, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, + ErpPartDapperRepository erpdapperRepository, ISettleAccountBranchEfCoreRepository wmsRepository90, ISettleAccountBranchEfCoreRepository wmsVersionRepository90, WmsDapperRepository wmsDapper @@ -109,6 +111,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts _wmsRepository90 = wmsRepository90; _wmsVersionRepository90 = wmsVersionRepository90; + _erpdapperRepository = erpdapperRepository; } private async Task GetCountAsync(WmsSharePartOutPutDetialRequestDto input) @@ -674,6 +677,15 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中物料号{0}结算数量为0,影响出库请检查!", itm.MaterialCode), string.Empty)); } } + //和物料主数据中SAP物料号检验是否存在 + foreach (var itm in result) + { + 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); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs index e83e740c..1ea25fbd 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs @@ -51,7 +51,9 @@ using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace Win.Sfs.SettleAccount.Entities.WMS { - + /// + /// 红旗一轿手工出库单 + /// [Route("api/settleaccount/WmsHQKBOutput")] //[AllowAnonymous] [Authorize(SettleAccountPermissions.WMSHQ.Default)] @@ -77,6 +79,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS private readonly TaskJobService _service; private readonly WmsDapperRepository _wmsDapper; + private readonly ErpPartDapperRepository _erpdapperRepository; + /// /// /// @@ -97,6 +101,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS IDistributedCache cache, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, + ErpPartDapperRepository erpdapperRepository, WmsDapperRepository wmsDapper ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { @@ -108,6 +113,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS _excelImportService = excelImportService; _dapper = dapper; _wmsDapper = wmsDapper; + _erpdapperRepository = erpdapperRepository; } private async Task GetCountAsync(WmsKanbanOutPutDetialRequestDto input) @@ -280,6 +286,16 @@ namespace Win.Sfs.SettleAccount.Entities.WMS checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件请填写是或否,影响出库请检查!", itm.SapMaterialCode), string.Empty)); } } + //和物料主数据中SAP物料号检验是否存在 + foreach (var itm in _list) + { + 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); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs index fbec890e..971e32df 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs @@ -50,6 +50,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS private readonly TaskJobService _service; private readonly WmsDapperRepository _wmsDapper; + private readonly ErpPartDapperRepository _erpdapperRepository; /// /// /// @@ -70,6 +71,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS IDistributedCache cache, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, + ErpPartDapperRepository erpdapperRepository, WmsDapperRepository wmsDapper ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { @@ -81,6 +83,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS _excelImportService = excelImportService; _dapper = dapper; _wmsDapper = wmsDapper; + _erpdapperRepository = erpdapperRepository; } private async Task GetCountAsync(WmsOneTimeSaleOutPutDetialRequestDto input) @@ -229,6 +232,16 @@ namespace Win.Sfs.SettleAccount.Entities.WMS { checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, string.Empty, string.Empty, "导入模板中第一页签没有数据,请检查!", string.Empty)); } + + //和物料主数据中SAP物料号检验是否存在 + foreach (var itm in _list) + { + 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);