|
|
@ -20,6 +20,7 @@ using Win.Sfs.SettleAccount.Bases; |
|
|
|
using Win.Sfs.SettleAccount.CommonManagers; |
|
|
|
using Win.Sfs.SettleAccount.Constant; |
|
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; |
|
|
|
using Win.Sfs.SettleAccount.Entities.CodeSettings; |
|
|
|
using Win.Sfs.SettleAccount.Entities.Prices; |
|
|
|
using Win.Sfs.SettleAccount.ExcelImporter; |
|
|
|
using Win.Sfs.SettleAccount.ExportReports; |
|
|
@ -80,6 +81,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
/// </summary>
|
|
|
|
private readonly INormalEfCoreRepository<TB_RePartsRelationship, Guid> _tbRePartsRelationshipRepository; |
|
|
|
|
|
|
|
|
|
|
|
private readonly INormalEfCoreRepository<CodeSetting, Guid> _codeRepository; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 构造
|
|
|
|
/// </summary>
|
|
|
@ -94,6 +98,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
INormalEfCoreRepository<PriceListYinDu, Guid> priceYinDuListRepository, |
|
|
|
INormalEfCoreRepository<MaterialRelationship, Guid> materialRelationshipRepository, |
|
|
|
INormalEfCoreRepository<TB_RePartsRelationship, Guid> tbRePartsRelationshipRepository, |
|
|
|
INormalEfCoreRepository<CodeSetting, Guid> codeRepository, |
|
|
|
IDistributedCache<PUB_SA> cache, |
|
|
|
IExcelImportAppService excelImportService, |
|
|
|
ISnowflakeIdGenerator snowflakeIdGenerator, |
|
|
@ -111,6 +116,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
_priceYinDuListRepository = priceYinDuListRepository; |
|
|
|
_materialRelationshipRepository = materialRelationshipRepository; |
|
|
|
_tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; |
|
|
|
_codeRepository = codeRepository; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -317,6 +323,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
//结算分组号
|
|
|
|
var pubSaGroupNums = importPubSaDetails.Select(t => t.GroupNum).Distinct(); |
|
|
|
//已存在的结算分组号
|
|
|
|
var _first = _codeRepository.FirstOrDefault(p => p.Project == "组验证开启" && p.Value == "是"); |
|
|
|
|
|
|
|
if (_first != null) |
|
|
|
{ |
|
|
|
var havPubSaGroupNums = (await _pubSaDetailRepository.GetListAsync(t => t.Place == place && pubSaGroupNums.Contains(t.GroupNum)).ConfigureAwait(false)).Select(t => t.GroupNum).Distinct(); |
|
|
|
if (havPubSaGroupNums.Any() == true) |
|
|
|
{ |
|
|
@ -325,6 +335,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"结算分组号{item}已存在", string.Empty)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!checkList.Any()) |
|
|
|
{ |
|
|
@ -420,6 +431,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
//结算分组号
|
|
|
|
var pubSaGroupNums = pubSaDetails.Select(t => t.GroupNum).Distinct(); |
|
|
|
//已存在的结算分组号
|
|
|
|
var _first = _codeRepository.FirstOrDefault(p => p.Project == "组验证开启" && p.Value == "是"); |
|
|
|
if (_first != null) |
|
|
|
{ |
|
|
|
var havPubSaGroupNums = (await _pubSaDetailRepository.GetListAsync(t => pubSaGroupNums.Contains(t.GroupNum)).ConfigureAwait(false)).Select(t => t.GroupNum).Distinct(); |
|
|
|
if (havPubSaGroupNums.Any() == true) |
|
|
|
{ |
|
|
@ -428,6 +442,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"结算分组号{item}已存在", string.Empty)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!checkList.Any()) |
|
|
|
{ |
|
|
|