Browse Source

更新版本

master
zhaoxinyu 10 months ago
parent
commit
830980ce99
  1. 17
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  2. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  3. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  4. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs

17
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs

@ -18,6 +18,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;
@ -67,6 +68,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// </summary>
private readonly INormalEfCoreRepository<PriceList, Guid> _priceListRepository;
private readonly INormalEfCoreRepository<CodeSetting, Guid> _codeRepository;
/// <summary>
/// 客户零件关系仓储
/// </summary>
@ -97,6 +101,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
IDistributedCache<BBAC_SA> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
INormalEfCoreRepository<CodeSetting, Guid> codeRepository,
ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
@ -109,6 +114,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_priceListRepository = priceListRepository;
_materialRelationshipRepository = materialRelationshipRepository;
_tbRePartsRelationshipRepository = tbRePartsRelationshipRepository;
_codeRepository = codeRepository;
}
/// <summary>
@ -183,6 +192,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
//结算分组号
var bbacSaGroupNums = importBBACSaDetails.Select(t => t.GroupNum).Distinct();
//已存在的结算分组号
var _first=_codeRepository.FirstOrDefault(p => p.Project == "组验证开启" && p.Value == "是");
if (_first!=null)
{
var havBBACSaGroupNums = (await _bbacSaDetailRepository.GetListAsync(t => bbacSaGroupNums.Contains(t.GroupNum)).ConfigureAwait(false)).Select(t => t.GroupNum).Distinct();
if (havBBACSaGroupNums.Any() == true)
{
@ -191,6 +207,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())
{

12
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs

@ -18,6 +18,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;
@ -72,6 +73,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// 替换件关系仓储
/// </summary>
private readonly INormalEfCoreRepository<TB_RePartsRelationship, Guid> _tbRePartsRelationshipRepository;
private readonly INormalEfCoreRepository<CodeSetting, Guid> _codeRepository;
/// <summary>
/// 构造
@ -84,6 +87,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<PriceList, Guid> priceListRepository,
INormalEfCoreRepository<MaterialRelationship, Guid> materialRelationshipRepository,
INormalEfCoreRepository<TB_RePartsRelationship, Guid> tbRePartsRelationshipRepository,
INormalEfCoreRepository<CodeSetting, Guid> codeRepository,
IDistributedCache<HBPO_SA> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
@ -98,6 +102,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_priceListRepository = priceListRepository;
_materialRelationshipRepository = materialRelationshipRepository;
_tbRePartsRelationshipRepository = tbRePartsRelationshipRepository;
_codeRepository = codeRepository;
}
/// <summary>
@ -507,6 +512,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
//结算分组号
var saGroupNums = hbpoSaDetails.Select(t => t.GroupNum).Distinct();
//已存在的结算分组号
var _first = _codeRepository.FirstOrDefault(p => p.Project == "组验证开启" && p.Value == "是");
if (_first != null)
{
var havPubSaGroupNums = (await _hbpoSaDetailRepository.GetListAsync(t => saGroupNums.Contains(t.GroupNum)).ConfigureAwait(false)).Select(t => t.GroupNum).Distinct();
if (havPubSaGroupNums.Any() == true)
{
@ -515,6 +526,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())
{

15
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -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())
{

14
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs

@ -133,15 +133,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
itm2.SetGroupNum(billNum);
billDetails.Add(itm2);
}
var test = details.Sum(p => p.Price * p.Qty);
var count = details.Count;
details = new List<BBAC_CAN_SA_DETAIL>();
sum = itm1.Qty * itm1.Price;
}
var _detailEntity = new BBAC_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm1.KeyCode,
@ -164,8 +160,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
);
_detailEntity.RealPartCode = itm1.RealPartCode;
details.Add(_detailEntity);
}
var billNum1 = OrderNumberGenerator.GenerateOrderNumber("N");
var bbac_sa1 = new BBAC_CAN_SA();
@ -279,7 +273,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
foreach (var itm1 in ls)
{
sum += (itm1.Qty * itm1.Price);
if (sum > 10000000)
{
var billNum = OrderNumberGenerator.GenerateOrderNumber("N");
@ -299,14 +292,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
itm2.SetGroupNum(billNum);
billDetails.Add(itm2);
}
var test = details.Sum(p => p.Price * p.Qty);
details = new List<BBAC_CAN_SA_DETAIL>();
sum = itm1.Qty * itm1.Price;
}
var _detailEntity = new BBAC_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm1.KeyCode,
@ -329,7 +317,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
);
_detailEntity.RealPartCode = itm1.RealPartCode;
details.Add(_detailEntity);
}
var billNum1 = OrderNumberGenerator.GenerateOrderNumber("N");
var bbac_sa1 = new BBAC_CAN_SA();
@ -509,7 +496,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
var part_group_small = t1.Where(p => p.Amt < 10000000).ToList();
if (part_group_big.Count > 0)
{
foreach (var itm in part_group_big)
{
var ls = hbpo_can_list.Where(p => p.LU == itm.LU).ToList();

Loading…
Cancel
Save