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);