diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index 948ac471..497acd31 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -152,6 +152,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices else { hasRepeat.IsCancel = false; + + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, item.LU, string.Empty, $"零件号:{item.LU},与已存在合同签订时间、价格重复", string.Empty)); } } @@ -161,6 +163,12 @@ namespace Win.Sfs.SettleAccount.Entities.Prices await _settleAccountDbContext.BulkUpdateAsync(oldPrices).ConfigureAwait(false); await _settleAccountDbContext.BulkInsertAsync(newPriceNoRepeat).ConfigureAwait(false); await transaction.CommitAsync().ConfigureAwait(false); + + if (checkList.Count > 0) + { + var fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { code = ApplicationConsts.ImportFailCode, message = "导入失败", fileName }); + } } catch (Exception) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs index 66e36a83..54664e89 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs @@ -143,6 +143,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices else { hasRepeat.IsCancel = false; + + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, item.LU, string.Empty, $"零件号:{item.LU},与已存在合同签订时间、价格重复", string.Empty)); } } @@ -152,6 +154,13 @@ namespace Win.Sfs.SettleAccount.Entities.Prices await _settleAccountDbContext.BulkUpdateAsync(oldPrices).ConfigureAwait(false); await _settleAccountDbContext.BulkInsertAsync(newPriceNoRepeat).ConfigureAwait(false); await transaction.CommitAsync().ConfigureAwait(false); + + if (checkList.Count > 0) + { + var fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { code = ApplicationConsts.ImportFailCode, message = "导入失败", fileName }); + } + } catch (Exception) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceYinDu.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceYinDu.cs index 708f692f..5aa2e3b0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceYinDu.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceYinDu.cs @@ -138,6 +138,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices else { hasRepeat.IsCancel = false; + + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, item.LU, string.Empty, $"零件号:{item.LU},与已存在合同签订时间、价格重复", string.Empty)); } } @@ -147,6 +149,12 @@ namespace Win.Sfs.SettleAccount.Entities.Prices await _settleAccountDbContext.BulkUpdateAsync(oldPrices).ConfigureAwait(false); await _settleAccountDbContext.BulkInsertAsync(newPriceNoRepeat).ConfigureAwait(false); await transaction.CommitAsync().ConfigureAwait(false); + + if (checkList.Count > 0) + { + var fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { code = ApplicationConsts.ImportFailCode, message = "导入失败", fileName }); + } } catch (Exception) {